Actions
Bug #16092
closed[doc] precedence of modifier-rescue
Bug #16092:
[doc] precedence of modifier-rescue
Description
The docs state that modifier-rescue has higher precedence than assignments which have higher precedence than modifier-if. This is true for
v = expr rescue $! if condition but not for
v = expr if condition rescue $! which is treated as
(v = expr if condition) rescue $! rather than
v = expr if (condition rescue $!)
This goes similarly for
defined? expr rescue $!
not expr rescue $!
expr1 and expr2 rescue $!
expr1 or expr2 rescue $!
So maybe the documentation should state that modifier-rescue has equal precedence to modifier-if & others, with an exception made for assignments? I'm not entirely sure how to describe that exception though.
Files
Actions