Project

General

Profile

Bug #5540

Final comma in argument list before block causes syntax error

Added by Joshua Ballanco over 4 years ago. Updated about 4 years ago.

Status:
Rejected
Priority:
Normal
ruby -v:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
Backport:
2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
[ruby-core:40645]

Description

The following code parses and runs correctly under 1.9.2-p290 but causes a syntax error under 1.9.3-p0:

def test(foo, &block); end
test 'hello', do; end

History

#1 Updated by Joshua Ballanco over 4 years ago

This was introduced by r32235:

* parse.y: comma at the end of line is no longer allowed.
  A patch from Yukihiro Matsumoto  <matz AT ruby-lang.org>.
  (fixed #3456).

Is it intended that the above syntax should no longer be valid in Ruby 1.9.3?

#2 [ruby-core:40691] Updated by Motohiro KOSAKI over 4 years ago

  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to Yukihiro Matsumoto

#3 [ruby-core:42225] Updated by Yukihiro Matsumoto about 4 years ago

  • Status changed from Assigned to Rejected

Syntax error is intentional. It was caused by a 1.9.2 bug.

Matz.

Also available in: Atom PDF