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

Rework path expression evaluation #3

Open
shortercode opened this issue Nov 23, 2022 · 0 comments
Open

Rework path expression evaluation #3

shortercode opened this issue Nov 23, 2022 · 0 comments
Labels
JSONata compatibility Can either capture valid or invalid compatibility issues

Comments

@shortercode
Copy link
Collaborator

Our current path expression evaluator is based on a breadth first process that processes data for each path segment in sequence. This is a relatively optimal way to evaluate content but it comes with some tradeoffs in compatibility.

The original algorithm in the JSONata spec is based on a recursive depth first system. This is well suited for certain concepts like binding a variable for a particular branch of the tree. To work around this in our algorithm we had to add a special recurse step for this variable binding, but this doesn't work perfectly.

Resolving these edge cases is becoming increasingly complex and fragile, we've reached the point where the easiest way forward would be to replace our existing algorithm with a depth first system.

@shortercode shortercode added the JSONata compatibility Can either capture valid or invalid compatibility issues label Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSONata compatibility Can either capture valid or invalid compatibility issues
Projects
None yet
Development

No branches or pull requests

1 participant