-
-
Notifications
You must be signed in to change notification settings - Fork 655
feat(napi/parser): add AST walker #13930
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
base: 09-17-feat_napi_parser_export_visitor_keys
Are you sure you want to change the base?
feat(napi/parser): add AST walker #13930
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
d07fa71
to
1c50c58
Compare
a44ba52
to
f68cffb
Compare
1c50c58
to
098ac21
Compare
f68cffb
to
f7f9e3a
Compare
098ac21
to
c2b060a
Compare
c2b060a
to
4eb80fe
Compare
4eb80fe
to
c8131c1
Compare
f7f9e3a
to
b0abdfd
Compare
c8131c1
to
da2c6f6
Compare
b0abdfd
to
7091e82
Compare
da2c6f6
to
488d5b2
Compare
7091e82
to
fe80787
Compare
fe80787
to
2395e3a
Compare
488d5b2
to
0800b58
Compare
Add an AST visitor to
oxc-parser
.Primarily we need a visitor for Oxlint plugins, but it's easier to develop and test in
oxc-parser
, so I thought I'd add it there first. Oxlint build process will copy the generated files for tree-walking fromnapi/parser
dir, as it does with other files.Notes:
walk.mjs
file is large, so it's lazy-loaded only when user first constructs aVisitor
. AddingVisitor
to the package will not affect start-up time where user only usesparseSync
etc.Visitor
and the visitor object it takes are provided.Program
andProgram:exit
.src-js/visit/visitor.mjs
is copied fromapps/oxlint
with only minor modifications, and conversion from TS to JS. It'd be better if we only had this impl in one place, but that would require convertingoxc-parser
to TS and building with TSDown, likeoxlint
is. Leaving that for later - Convertoxc-parser
to TypeScript #13935.