-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Grammars for ES2015-ES2022 #452
Conversation
- Grammarkdown grammars for es2015-2022 - Tool to extract & dedent grammarkdown grammars - `generate-ecmascript-grammar.mjs` now takes an overrides parameter to allow for per-grammar overrides (useful when getting into `async`/`await` in es2017+
@elgertam I opened a up a new pull request here with your changes, after moving them to a branch in the Ohm repo. (Not sure if there's an easier way to do this such that I can push to the branch.) |
@elgertam One question:
How are these extracted, and what kind of manual cleaning is required? Could this be automated as well? (Not for this PR, but it would be good to document it somewhere in case we want to add that in the future.) From what I can tell, it seems to be a matter of extracting the contents of the |
The extraction process I followed is essentially as you described: download the spec files (from Automation may be possible, especially for the newer grammars. Older grammars have loads of duplicated productions that need to be removed, which were removed using manual clean-up here. These may be extractable in the future with improvements to Ohm's Grammarkdown tooling. Here's the backstory: I did quite a bit of digging around I wanted to avoid further yak shaving so used my own hacked together tools ( Grammars older than ES2018 needed quite a bit of cleanup. The ecmarkup Grammars for ES2018 or newer were all simple to extract using basic DOM APIs and IIRC only needed minimal cleanup. |
Thanks for the details. Would you mind adding that description somewhere in the tree? Either in a README, a comment in extract-grammarkdown.mjs, or wherever you think makes sense. |
I'll going to go ahead and merge this — we can continue the work in follow-up PRs. |
From #451: