tOP_ASGN and rescue_modifier precedence, with a few confusing examples
parse.y shows that tOP_ASGN has precedence over modifier_rescue.
So I expect that
a = 1 a +=  rescue 5
should be parsed as "(a += ) rescue 5". Furthermore, it should evaluate to 5, and leave a untouched.
But in reality, this raises a TypeError. (If you rescue this TypeError, you can see that a is untouched.)
a = 'a' a += b rescue 'c'
should not raise a NameError (for b), evaluate to 'c', and leave 'a' untouched.
However, in reality, this does not raise any exception, but it evaluates to 'ac' and assigns the value 'ac' to a.
Did I reason this incorrectly? Or is there a bug somewhere?