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 |
matthias-Q
left a comment
There was a problem hiding this comment.
LGTM. Thanks for fixing the tests.
| (json_traversal | ||
| (json_traversal | ||
| (literal)))) |
There was a problem hiding this comment.
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.