-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Symbol literals with interpolation are not allowed in hash patterns #340
Comments
Interesting, whitequark/parser seems to accept it right now, producing this AST, its accepted in 2.7, 3.0, 3.1 and 3.2 here.
On MRI: Ruby 2.7 accepts it. But 3.0, 3.1 and 3.2 not. Unparsers goal was to be able to unparser I think we have to file this issue in |
For full visibility, I've reported this in: whitequark/parser#919. I do not want to filter it out unparser side for the moment. I'll do so with a fixing |
@kddnewton if you are importing unparsers tests, you can just ignore this pattern, or would it be better for you I pushed a removal? |
That's okay! I'm just ignored that one line for now. I appreciate the explanation! |
Well I'd be happy to use YARP in the future as source AST for unparser. So thanks to you. I hope you made dstrings less ambigious in your native AST, I'll check it out soon. Dynamic strings are the only construct that unparser fails on in edge cases right now. |
YARP has two kinds of strings: |
@kddnewton yes helps me already, the story goes a bit deeper. I'll reply here later explaining it. |
Found this while importing your tests into YARP. On this line:
unparser/test/corpus/literal/pattern.rb
Line 20 in 8260882
It's actually a syntax error.
Running
ruby -c
gives:The text was updated successfully, but these errors were encountered: