Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Parser, Ruby 1.9.2, Ruby 1.9.3
-
Labels:None
-
Number of attachments :
Description
Broken:
system ~/projects/jruby $ jruby -e "lambda { [1].each {|one; bl| } }"
SyntaxError: -e:1: syntax error, unexpected tIDENTIFIER
lambda { [1].each {|one; bl| } }
^
Due to this commit:
commit 3e6d201fe4659f14eb0d0565f1b7680a8f162e22
Author: Hiro Asari <asari.ruby@gmail.com>
Date: Mon Feb 27 10:02:26 2012 -0800
Fix JRUBY-6504: Block parameter syntax issue where the closing | comes at the beginning of the line
Something like this, maybe?
diff --git a/src/org/jruby/parser/Ruby19Parser.y b/src/org/jruby/parser/Ruby19Parser.y index 13ec1a7..7f38dcc 100644 --- a/src/org/jruby/parser/Ruby19Parser.y +++ b/src/org/jruby/parser/Ruby19Parser.y @@ -1374,7 +1374,14 @@ block_param_def : tPIPE opt_bv_decl tPIPE { } // shadowed block variables.... -opt_bv_decl : opt_nl { +opt_bv_decl : none + | opt_nl { + $$ = null; + } + | ';' bv_dels { + $$ = null; + } + | opt_nl ';' bv_dels { $$ = null; } | opt_nl ';' bv_dels opt_nl {FWIW, this came up in 1.9 spec run, so someone's not running specs