Skip to content

Another unexpected kDO_BLOCK error in parser #1629

@jlukas

Description

@jlukas

JRuby throws a syntax error where Ruby 1.9 does not:

% rvm 1.9 do irb
1.9.3-p545 :001 >   some_method key: (proc do
1.9.3-p545 :002 >           {
1.9.3-p545 :003 >               key: "#{var}#{var}",
1.9.3-p545 :004 >               other_key: proc do
1.9.3-p545 :005 >                 end
1.9.3-p545 :006?>           }
1.9.3-p545 :007?>       end)
NoMethodError: undefined method `some_method' for main:Object
    from (irb):7
    from /Users/jlukas/.rvm/rubies/ruby-1.9.3-p545/bin/irb:12:in `<main>'
1.9.3-p545 :008 > exit
% rvm jruby do irb
jruby-1.7.11 :001 >   some_method key: (proc do
jruby-1.7.11 :002 >           {
jruby-1.7.11 :003 >               key: "#{var}#{var}",
jruby-1.7.11 :004 >               other_key: proc do
jruby-1.7.11 :005 >                 end
jruby-1.7.11 :006?>           }
jruby-1.7.11 :007?>       end)
SyntaxError: (irb):4: syntax error, unexpected kDO_BLOCK
      other_key: proc do
                       ^
    from org/jruby/RubyKernel.java:1121:in `eval'
    from org/jruby/RubyKernel.java:1521:in `loop'
    from org/jruby/RubyKernel.java:1284:in `catch'
    from org/jruby/RubyKernel.java:1284:in `catch'
    from /Users/jlukas/.rvm/rubies/jruby-1.7.11/bin/irb:13:in `(root)'
jruby-1.7.11 :008 > 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions