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
+ ruby31.y: Allow value omission in Hash literals #818
+ ruby31.y: Allow value omission in Hash literals #818
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Initially I was thinking about a new node type (as always 🤦 ), but I like this approach a lot. Once the test is fixed I'd be glad to merge it.
s(:hash, | ||
s(:pair, s(:sym, :a), s(:send, nil, :a)), | ||
s(:pair, s(:sym, :b), s(:send, nil, :b))), | ||
%q{{a:, b:}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a source_maps
argument that has to be passed explicitly (%q{}
).
Also, could you please add source maps checks for both key and value?
630de2b
to
f096464
Compare
Closes whitequark#817. This commit tracks upstream commit ruby/ruby@c60dbcd
f096464
to
56f12ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@skryukov Thanks! |
Follow up to whitequark/parser#818 This PR adds `value_omission` method to `AST::PairNode` for Ruby 3.1's hash value omission. It can replace string match with that named API.
Follow up to whitequark/parser#818 This PR adds `value_omission` method to `AST::PairNode` for Ruby 3.1's hash value omission. It can replace string match with that named API.
Closes #817.
This commit tracks upstream commit ruby/ruby@c60dbcd