[#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:81814] [Ruby trunk Bug#13691] Word- and symbol array literals not valid where regular array is

From: shevegen@...
Date: 2017-06-28 18:00:52 UTC
List: ruby-core #81814
Issue #13691 has been updated by shevegen (Robert A. Heiler).


Hmm you are right. That's interesting. I may be wrong but this may possibly be a limitation of the
parser, otherwise the ruby core team would have probably made it happen. (Though of course there
can be other reasons too... lack of resources... or nobody noticed this yet).

    def foo(*i); pp i; end # => :foo
    foo [:a, :b]  { piyo } # => [[:a, :b]]
    foo  %i(a b)  { piyo } # => SyntaxError: (irb):14: syntax error, unexpected '{', expecting end-of-input foo  %i(a b) { piyo }



----------------------------------------
Bug #13691: Word- and symbol array literals not valid where regular array is
https://bugs.ruby-lang.org/issues/13691#change-65511

* Author: ted (Ted Johansson)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Not sure if this is a limitation of the design space in the parser, or just a missed edge case. (Note that a regular array literal works fine.)


**Steps to reproduce:**

Run ruby -c on:

~~~ ruby
hoge %i(a b) { piyo }
~~~

**Expected behaviour:**

Syntax OK

**Actual behaviour:**

~~~
syntax error, unexpected '{', expecting end-of-input
~~~



-- 
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