Parser error: syntax error, unexpected ','
------------------------------------------
Key: JRUBY-5513
URL: http://jira.codehaus.org/browse/JRUBY-5513
Project: JRuby
Issue Type: Bug
Components: Interpreter, Parser, Ruby 1.9, RubySpec
Affects Versions: JRuby 1.6RC2
Reporter: Diego Plentz
(This report is originated by this bug https://gist.github.com/769899 I found
while testing a rails 3 app. I tried to isolate as much as I can the test case)
Well, I think that the best way to explain this is with examples:
Code:
class Bla
def method1(a,b)
end
end
def method2(c)
end
f = Bla.new
( f.method1 (method2 "foo"), "bar")
---------------------------------------
MRI 1.9.2-p136 output:
ruby-1.9.2-p136 :050 > f = Bla.new
=> #<Bla:0x000001009e3c38>
ruby-1.9.2-p136 :051 > ( f.method1 (method2 "foo"), "bar")
=> nil
---------------------------------------
Jruby 1.6.0-RC2 output:
jruby-1.6.0.RC2 :025 > f = Bla.new
=> #<Bla:0x2add5681>
jruby-1.6.0.RC2 :026 > ( f.method1 (method2 "foo"), "bar")
(irb):26 warning: don't put space before argument parentheses
SyntaxError: (irb):26: syntax error, unexpected ','
( f.method1 (method2 "foo"), "bar")
^
from org/jruby/RubyKernel.java:1088:in `eval'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:158:in
`eval_input'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:271:in
`signal_status'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:155:in
`eval_input'
from org/jruby/RubyKernel.java:1418:in `loop'
from org/jruby/RubyKernel.java:1191:in `rbCatch'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:154:in
`eval_input'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:71:in `start'
from org/jruby/RubyKernel.java:1191:in `rbCatch'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:70:in `start'
from /Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/bin/irb:17:in `(root)'
---------------------------------------//---------------------------------------
Code 2:
def method1(a,b)
end
def method2(c)
end
( self.method1 (method2 "foo"), "bar")
---------------------------------------
MRI 1.9.2-p136 output:
ruby-1.9.2-p136 :005 > ( self.method1 (method2 "foo"), "bar")
NoMethodError: private method `method1' called for main:Object
from (irb):5
from /Users/plentz/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
---------------------------------------
Jruby 1.6.0-RC2 output:
jruby-1.6.0.RC2 :005 > ( self.method1 (method2 "foo"), "bar")
(irb):5 warning: don't put space before argument parentheses
SyntaxError: (irb):5: syntax error, unexpected ','
( self.method1 (method2 "foo"), "bar")
^
from org/jruby/RubyKernel.java:1088:in `eval'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:158:in
`eval_input'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:271:in
`signal_status'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:155:in
`eval_input'
from org/jruby/RubyKernel.java:1418:in `loop'
from org/jruby/RubyKernel.java:1191:in `rbCatch'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:154:in
`eval_input'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:71:in `start'
from org/jruby/RubyKernel.java:1191:in `rbCatch'
from
/Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/lib/ruby/1.8/irb.rb:70:in `start'
from /Users/plentz/.rvm/rubies/jruby-1.6.0.RC2/bin/irb:17:in `(root)'
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email