Actions
Bug #13701
closedRipper fails to parse "proc { |(w, *x, y), z| }"
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin13]
Description
The Ruby formatter rufo has exposed a ripper parsing error when parsing the following ruby code:
proc { |(w, *x, y), z| }
The s-expression below shows that the y identifier is swallowed.
The following ruby spec fails for the same reason:
https://github.com/ruby/spec/blob/master/language/block_spec.rb#L852#L865
$ ruby -rripper -rpp -e 'pp Ripper.sexp("proc { |(w, *x, y), z| }")'
[:program,
[[:method_add_block,
[:method_add_arg, [:fcall, [:@ident, "proc", [1, 0]]], []],
[:brace_block,
[:block_var,
[:params,
[[:mlhs_paren,
[:mlhs_add_star,
[[:mlhs_paren, [:@ident, "w", [1, 9]]]],
[:@ident, "x", [1, 13]]]],
[:@ident, "z", [1, 20]]],
nil,
nil,
nil,
nil,
nil,
nil],
false],
[[:void_stmt]]]]]]
ref: rufo issue: https://github.com/asterite/rufo/issues/73
Updated by nobu (Nobuyoshi Nakada) almost 7 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r59246.
parse.y: f_margs parser events
- parse.y (f_margs): implemented parser events for massign
formal arguments. [ruby-core:81848] [Bug #13701]
Updated by mjago (Martyn Jago) almost 7 years ago
Thank you nobu for the quick fix
Actions
Like0
Like0Like0