Bug #4716

Ripper orders rescue_mod subnodes inconsistently [PATCH]

Added by Michael Edgar almost 4 years ago. Updated almost 4 years ago.

[ruby-core:36248]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
ruby -v:ruby 1.9.2p188 (2011-03-28 revision 31204) [x86_64-darwin10.7.0] Backport:

Description

Depending on whether a rescue_mod node is in an assignment context or not, the parse order differs:

pp Ripper.sexp("a rescue b")
[:program,
[[:rescue_mod,
[:var_ref, [:@ident, "b", [1, 9]]],
[:var_ref, [:@ident, "a", [1, 0]]]]]]

pp Ripper.sexp("x = a rescue b")

[:program,
[[:assign,
[:var_field, [:@ident, "x", [1, 0]]],
[:rescue_mod,
[: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.

rescue_mod.diff Magnifier - Patch fixing inconsistent parse order (408 Bytes) Michael Edgar, 05/17/2011 08:21 AM

Associated revisions

Revision 32428
Added by Nobuyoshi Nakada almost 4 years ago

  • parse.y (arg): rescue_mod is in inverse order from other modifiers. patched by michael.j.edgar AT dartmouth.edu at . fixed #4716.

Revision 32428
Added by Nobuyoshi Nakada almost 4 years ago

  • parse.y (arg): rescue_mod is in inverse order from other modifiers. patched by michael.j.edgar AT dartmouth.edu at . fixed #4716.

History

#1 Updated by Michael Edgar almost 4 years ago

Could I get an update on this? Given the potential for a 1.9.3 release, I'd like to see as few Ripper bugs remaining by the time that comes.

#2 Updated by Koichi Sasada almost 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

#3 Updated by Michael Edgar almost 4 years ago

I feel this merits inclusion in Ruby 1.9.3. Otherwise, Ripper will have known user-facing bugs for another point release. A patch has been available for a month and a half, as well. Any chance for an update?

#4 Updated by Nobuyoshi Nakada almost 4 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 . fixed #4716.

Also available in: Atom PDF