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

feat(jmespath): add abstract syntax tree definition #2213

Merged
merged 2 commits into from
Mar 18, 2024
Merged

Conversation

dreamorosi
Copy link
Contributor

Description of your changes

This PR introduces the definition of the components that make up the Abstract Syntax Tree (AST) for the JMESPath utility.

As discussed in the linked utility the AST is a hierarchical representation of the syntactic structure of a JMESPath expression and abstracts away from the specifics of the input text, capturing the components and relationships between them.

Each node in the AST follows a similar structure and is composed by three fields:

  • type a string literal holding the name of the node (i.e. comparator, field, filter_projection, etc.)
  • children an array containing the child nodes of this node (if any) - this helps establish the hierarchy
  • value the value of the node (i.e. any JSON serializable value)

Related issues, RFCs

Issue number: #2210

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Mar 12, 2024
@dreamorosi dreamorosi requested review from a team as code owners March 12, 2024 11:34
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Mar 12, 2024
@dreamorosi dreamorosi linked an issue Mar 12, 2024 that may be closed by this pull request
2 tasks
@github-actions github-actions bot added the feature PRs that introduce new features or minor changes label Mar 12, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@dreamorosi dreamorosi merged commit 76c4cfd into main Mar 18, 2024
12 checks passed
@dreamorosi dreamorosi deleted the feat/jmespath_ast branch March 18, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature PRs that introduce new features or minor changes size/L PRs between 100-499 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: JMESPath abstract syntax tree (AST)
2 participants