From: martyn.jago@... Date: 2017-07-02T11:45:13+00:00 Subject: [ruby-core:81882] [Ruby trunk Bug#13701] Ripper fails to parse "proc { |(w, *x, y), z| }" Issue #13701 has been updated by mjago (Martyn Jago). Thank you nobu for the quick fix ---------------------------------------- Bug #13701: Ripper fails to parse "proc { |(w, *x, y), z| }" https://bugs.ruby-lang.org/issues/13701#change-65609 * Author: mjago (Martyn Jago) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin13] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- The Ruby formatter rufo has exposed a ripper parsing error when parsing the following ruby code: ~~~ ruby 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 -- https://bugs.ruby-lang.org/ Unsubscribe: