Issue 69: parser doesn't handle method[space]statement well #118

Open
consiliens opened this Issue Aug 26, 2011 · 0 comments

Comments

Projects
None yet
1 participant
@consiliens
Contributor

consiliens commented Aug 26, 2011

"
Reported by rogerpack2005, May 30, 2011
Hello.
This line will print 'true' in ruby, print nothing.
puts ('3' + '4') == '5'

interestingly,

puts (3 + 4) == 5

also fails in an odd way (Mirah::InternalCompilerError: Cannot find instance method ==(byte) on java.io.PrintStream)

Thanks!
-roger-


Comment 1 by project member rib...@google.com, Jun 2, 2011
Looks like we treat $Space $LParen ... as paren_args, but jruby treats it as call_args. So we're parsing this as:
(puts('3'+'4')) == '5'

Then I guess we're just dropping it since the return value is ignored, but we shouldn't be doing that to a function call which could (and does in this case) have side effects.


Comment 2 by rogerpack2005, Jun 2, 2011
I don't get any output here, so I'm not sure what's going on...
"

http://code.google.com/p/mirah/issues/detail?id=69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment