[ruby-core:70073] [Ruby trunk - Bug #11380] Parser regression in 2.3?

From: spiketeika@...
Date: 2015-07-21 15:16:32 UTC
List: ruby-core #70073
Issue #11380 has been updated by Kaneko Yuichiro.


I found out that this regression is caused by 50402 (https://github.com/ruby/ruby/commit/fd0e9d2580bf757071683581d34354064c6ceb6a)

```
# prase.rb
def foo(pr, options, &blk)
  p pr.call
end

foo -> { :hello }, a: 1 do end
```

```
$  /usr/local/bin/ruby  -v
ruby 2.3.0dev (2015-04-29 trunk 50401) [x86_64-darwin13]

$  /usr/local/bin/ruby  parse.rb
:hello
```

```
$  /usr/local/bin/ruby  -v
ruby 2.3.0dev (2015-04-29 trunk 50402) [x86_64-darwin13]

$  /usr/local/bin/ruby  parse.rb
../parse.rb:5: syntax error, unexpected keyword_do, expecting end-of-input
foo -> { :hello }, a: 1 do end
```


----------------------------------------
Bug #11380: Parser regression in 2.3?
https://bugs.ruby-lang.org/issues/11380#change-53488

* Author: Akira Matsuda
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0dev (2015-07-21 trunk 51319) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
This code works with 2.2 but causes SyntaxError with 2.3.

~~~
def foo(pr, options, &blk)
  p pr.call
end

foo -> { :hello }, a: 1 do end
~~~


#=> t.rb:5: syntax error, unexpected keyword_do, expecting end-of-input



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next