Skip to content

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

@grddev

Description

@grddev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions