Ripper orders rescue_mod subnodes inconsistently [PATCH]
Depending on whether a rescue_mod node is in an assignment context or not, the parse order differs:
pp Ripper.sexp("a rescue b")
[:var_ref, [:@ident, "b", [1, 9]]],
[:var_ref, [:@ident, "a", [1, 0]]]]]]
pp Ripper.sexp("x = a rescue b")
[:var_field, [:@ident, "x", [1, 0]]],
[:var_ref, [:@ident, "a", [1, 4]]],
[:var_ref, [:@ident, "b", [1, 13]]]]]]]
I've attached a patch that fixes the issue - a patch containing tests will soon follow.
Updated by nobu (Nobuyoshi Nakada) about 9 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r32428.
Michael, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- parse.y (arg): rescue_mod is in inverse order from other modifiers. patched by michael.j.edgar AT dartmouth.edu at [ruby-core:36248]. fixed #4716.