Project

General

Profile

Bug #11389

Regression in method parameter parsing

Added by felixbuenemann (Felix Bünemann) about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-07-22 trunk 51345) [x86_64-darwin15]
[ruby-core:70089]

Description

There is a regression in parameter parsing with current ruby-2.2-head and ruby-head:

# ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
def foo fn, options, █ end
=> :foo
foo -> {}, foo: :bar do; end
=> nil
# ruby 2.2.2p133 (2015-06-12 revision 50295) [x86_64-darwin15]
# ruby 2.3.0dev (2015-07-22 trunk 51345) [x86_64-darwin15]
def foo fn, options, █ end
=> :foo
foo -> {}, foo: :bar do; end
SyntaxError: unexpected keyword_do, expecting end-of-input
# workaround:
foo -> {}, { foo: :bar } do; end
=> nil

Related issues

Is duplicate of Ruby trunk - Bug #11380: Parser regression in 2.3?Closed

Associated revisions

Revision 51519
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 51350: [Backport #11380] [Backport #11389]

* parse.y (lambda_body): pop cmdarg stack for lookahead
  token.   [Bug #11380]

History

#1 [ruby-core:70092] Updated by felixbuenemann (Felix Bünemann) about 2 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED

The issue can be fixed by reverting r50402 which was introduced by #11107.

#2 [ruby-core:70093] Updated by felixbuenemann (Felix Bünemann) about 2 years ago

This bug is a duplicate of #11380.

#3 Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Is duplicate of Bug #11380: Parser regression in 2.3? added

#4 Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Status changed from Open to Closed

Applied in changeset r51350.


parse.y: pop cmdarg

  • parse.y (lambda_body): pop cmdarg stack for lookahead token. [Bug #11380]

#5 [ruby-core:70104] Updated by felixbuenemann (Felix Bünemann) about 2 years ago

Thank you, it works fine now! <3

#6 [ruby-core:70310] Updated by nagachika (Tomoyuki Chikanaga) about 2 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: DONE

r51350 was backported into ruby_2_2 branch at r51519.

#7 Updated by usa (Usaku NAKAMURA) about 2 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: DONE to 2.0.0: UNKNOWN, 2.1: DONE, 2.2: DONE

Also available in: Atom PDF