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

Cannot use complex expressions like hash['foo'] += 1 with hyper-spec #127

Closed
catmando opened this issue Feb 16, 2019 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@catmando
Copy link
Contributor

This is due to an issue in the current unparser gem: mbj/unparser#117

You may get an error like this when running a spec:

(string):1:20: error: unexpected token tOP_ASGN
(string):1: hash.[]("foo") += 1
(string):1: 

The problem is the unparser incorrectly generates hash.[]("foo") += 1 instead of hash['foo'] += 1.

The good news its pretty easy to find such expressions and replace them with something like

hash["foo"] = hash["foo"] + 1

@catmando catmando added the bug Something isn't working label Feb 16, 2019
@mbj
Copy link

mbj commented Feb 16, 2019

You need to pass the modern AST format to unparser.

@catmando catmando added this to To do in ALPHA to production via automation Jun 14, 2019
@catmando
Copy link
Contributor Author

catmando commented Apr 1, 2021

works with parser 3.0 and all settings on per mbj's comment.

catmando added a commit that referenced this issue Apr 2, 2021
@catmando
Copy link
Contributor Author

catmando commented Apr 5, 2021

closed in 1.0.alpha1.7

@catmando catmando closed this as completed Apr 5, 2021
ALPHA to production automation moved this from To do to Done Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants