-
Notifications
You must be signed in to change notification settings - Fork 21
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
It would be great if the AST format would follow the de facto JS standard #2
Comments
Could you please explain any use case in mind? |
entree (i.e., Mozilla Parser API) is the de facto standard for JavaScript parsers. There are several high-performance, widely-used parsers implementing the API: esprima, espree, acorn, etc. Following the same format would, on the one hand, allow the K parser to be used as a parser for various JS tools, and, on the other hand, it would allow us to use any of those parsers for parsing JS programs almost without compatibility issues. Why would you care about the latter? You could, for example, compile the KJS to a K JS rewriter and then deploy the compiled rewriter to a web site. You wouldn't need the entire K infrastructure as the rules are already in AST format, and any program inputs would be parsed using one of the fast pure JS parsers. |
Bottom line, if we want to have any chance of adoption of K in the JS world, we would need to follow their standards, and be able to run in a pure JS mode. |
Indeed, I was thinking of using Shift parser: BTW, what do you mean by compiling to K JS rewriter? Do you mean using the term rewriting engine written in JS that you mentioned before? Could you elaborate it more? |
The standard is informally maintained here:
https://github.com/estree/estree
The text was updated successfully, but these errors were encountered: