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(es/plugin): Add AST query API #6270

Closed
wants to merge 4 commits into from
Closed

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Oct 27, 2022

Description:

Typically, finding an ast node involves 3 ~ 8 levels of nested pattern matching, but I think it can be reduced with this.

  • Basically, it consists of a pattern matcher and an operator
  • Pattern matcher can be written using query! macro
  • $n is one capture group.
  • $n can capture an expression, pattern, or a statement
  • The operator is a closure (need more thinking)
  • Operators are called once for each target node
  • Operators are called with the target AST node of the query by default and called with captured node if there are one or more capturing ($n).

Related issue:

@kdy1 kdy1 added this to the Planned milestone Oct 27, 2022
@kdy1 kdy1 self-assigned this Oct 27, 2022
@kdy1 kdy1 changed the title feat(es/plugin): Add AST query api feat(es/plugin): Add AST query API Oct 27, 2022
@kdy1 kdy1 removed their assignment Jun 13, 2023
@kdy1
Copy link
Member Author

kdy1 commented Jul 6, 2024

Closing as stale

@kdy1 kdy1 closed this Jul 6, 2024
@kdy1 kdy1 deleted the query-api branch July 6, 2024 05:47
@kdy1 kdy1 modified the milestones: Planned, v1.6.10 Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant