-
Notifications
You must be signed in to change notification settings - Fork 869
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
Feature request: parse using a specific syntatic goal #739
Comments
Since acorn doesn't use these goals internally that would be quite a lot of work. It could be possible to implement this on top of acorn. |
Yeah we managed to implement something. the only annoyance is the bitwise flags for what kind of function body is being parsed. Would it be acceptable to expose those in the public API? |
Yes, exporting those would make sense. Do you want to create a pull request? I'd prefer for them to be put into an object in the exported interface, to avoid adding a huge amount of exported identifiers. |
It would be nice to be able to specify which specific goal to use when parsing something:
a, b, c
withFormalParameters[~Yield, ~Await]
->[Identifier, Identifier, Identifier]
const a = 5; return a;
withFunctionBody[~Yield, ~Await]
->[VariableDeclaration, ReturnStatement]
The text was updated successfully, but these errors were encountered: