[#81492] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — normalperson@...

Issue #13618 has been reported by normalperson (Eric Wong).

12 messages 2017/06/01

[ruby-core:81848] [Ruby trunk Bug#13701] Ripper fails to parse "proc { |(w, *x, y), z| }"

From: martyn.jago@...
Date: 2017-06-30 10:00:39 UTC
List: ruby-core #81848
Issue #13701 has been reported by mjago (Martyn Jago).

----------------------------------------
Bug #13701: Ripper fails to parse "proc { |(w, *x, y), z| }"
https://bugs.ruby-lang.org/issues/13701

* Author: mjago (Martyn Jago)
* Status: Open
* 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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next