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

Ripper doesn't handle private def with nested block #4882

Closed
grddev opened this issue Dec 4, 2017 · 0 comments
Closed

Ripper doesn't handle private def with nested block #4882

grddev opened this issue Dec 4, 2017 · 0 comments
Labels

Comments

@grddev
Copy link
Contributor

grddev commented Dec 4, 2017

In JRuby 9.1.14.0 (and current master), the following command prints nil, whereas for MRI it prints a large S-expression.

ruby -rripper -e "p Ripper.sexp('class C; private def m; a.e do; end; end; end')"

If I remove private or a. the same S-expression is returned from MRI and JRuby. If I change the block to use { ... } or add paranthesis around the def m; ...; end it also works.

Loading the code into JRuby works just fine, but parsing it with Ripper does not.

This seems related to the issue #4663, but the syntax is just slightly different.

@enebo enebo added this to the JRuby 9.1.15.0 milestone Dec 5, 2017
@enebo enebo added the parser label Dec 5, 2017
enebo added a commit that referenced this issue Dec 6, 2017
…nd others.

While slowly figuring out a single-line change which fixed this issue I also
noticed several other mismatches between the two parsers.  Hopefully, at this
point, they are identical.

I also deleted a emacs turd.

RubyParser.y appears to be changed but they were minor whitespace differences
with Ripper.  I tried to make these two files a little bit easier to diff.
@enebo enebo closed this as completed Dec 6, 2017
enebo added a commit that referenced this issue Dec 6, 2017
…k for

duplicated variables in higher level production f_opt and f_block_opt but now
that check is done at the actual variable itself.
enebo added a commit that referenced this issue Dec 12, 2017
…nd others.

While slowly figuring out a single-line change which fixed this issue I also
noticed several other mismatches between the two parsers.  Hopefully, at this
point, they are identical.

I also deleted a emacs turd.

RubyParser.y appears to be changed but they were minor whitespace differences
with Ripper.  I tried to make these two files a little bit easier to diff.
enebo added a commit that referenced this issue Dec 12, 2017
…k for

duplicated variables in higher level production f_opt and f_block_opt but now
that check is done at the actual variable itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants