Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.0 parser fails to parse lambda arrow syntax with space #36

Open
codelion opened this issue Apr 21, 2015 · 3 comments
Open

Ruby 2.0 parser fails to parse lambda arrow syntax with space #36

codelion opened this issue Apr 21, 2015 · 3 comments

Comments

@codelion
Copy link

It seems like there is an inconsistency introduced in ruby 2.0 regarding the use of lambda syntax. The issue is detailed here

In ruby 2.0 the following is valid (notice the space between -> and (message))

hello_world = -> (message) { puts message }

However in ruby 1.9 it gives an error.

The issue is that in jruby-parser this doesn't parse even with CompatVersion set to 2.0. And in the older versions it won't parse, so the files using this cannot be handled with the jruby-parser.

Removing the space between the arrow and the parentheses would allow jruby-parser to parse these files. But there are uses of this syntax (with spaces) in the wild already, e.g. in slop gem. So, there are many files using this syntax that cannot be handled with jruby-parser.

@codelion codelion changed the title Ruby 2.0 parser fails to parse lambda rocket syntax with space Ruby 2.0 parser fails to parse lambda arrow syntax with space Apr 22, 2015
@codelion
Copy link
Author

Hi, just posting on this thread again to try and resurface this and other recent issues I posted about.

@JackWCollins
Copy link

I am running into this issue too.

@Sinjo
Copy link

Sinjo commented Nov 5, 2015

Ran across this issue by chance and remembered the problem. This was actually fixed in JRuby before the JRuby 9000 effort started. I suspect you could apply the patch to this bit of code and you'd be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants