-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: json traversal #170
feat: json traversal #170
Conversation
I added the other json operators and updated the test. Actually it looks like this is it. All other json operations are probably handled by |
Drive-by appreciation comment: I am honestly amazed by your aptitude and the promptness at fixing the issues I've reported. Stellar project maintenance! I certainly wasn't expecting to see all 3 issues addressed the same day I reported them |
the JSON issue has secretly been bugging me for a while (along with array literals and subscripting, but that's for later) and I've always been too busy with other things & other projects to take a look, and it turns out it just fits right into the |
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.
LGTM. Thanks for fixing the tests.
test/corpus/json.txt
Outdated
(json_traversal | ||
(json_traversal | ||
(literal)))) |
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.
This subtree represents the term "user"->'address' ->> 'city'
. It only references a single literal
node which means the other two have been hidden.
I've puts together #171 to show an alternative using the binary_expression
node that will surface all 3 literals and treat the navigation nodes as anonymous operators.
alternative implementation using binary_expression
We should add the new operators to the highlights.scm (i forgot that with |
This looks good to me. I am merging it. I am so surprised that this went so smoothly. (I was hoping that after the recent refactor we could also tackle |
I went looking and we actually got arrays at some point! |
this needs more time than I have for it at the moment but I don't think it'll be too hard to get basic support for #166! element indexing (possibly some common ground with the
array[1,2,3]
syntax?) and jsonpath are bigger considerations though.