Skip to content

Commit 1a88964

Browse files
authored
Grammars for ES2015-ES2022 (#452)
From #451: > I have added preliminary grammars for all JavaScript releases from ES2015 through ES2022 > > - `generate-ecmascript-grammar.mjs` and `grammarkdown.ohm` have been updated to parse later ES specs > - `extract-grammarkdown.mjs` and `dedent.py` have been included to create a clean Grammarkdown grammar from an ES spec > - Extracted & manually cleaned ES grammars for each release > - Per-grammar overrides have been moved from `generate-ecmascript-grammar.mjs` to an `override.json` file, along with productions containing reserved words > - Grammarkdown grammars & overrides have been organized into folders for each version of ES > - Generated Ohm grammars for each ES version > - Grammars appear to parse JS programs correctly in the Ohm editor > - Using the esm module loader syntax is only supported if the start symbol is changed to `Module`
1 parent be831b7 commit 1a88964

32 files changed

+24603
-933
lines changed

examples/ecmascript/gen/es2015.grammar.ohm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -960,19 +960,19 @@ ES2015 {
960960

961961
withYield = /* fixme */
962962

963-
noYield = /* fixme */
963+
noYield = ~any /* is this right? */
964964

965965
withIn = /* fixme */
966966

967-
noIn = /* fixme */
967+
noIn = ~any /* is this right? */
968968

969969
withReturn = /* fixme */
970970

971-
noReturn = /* fixme */
971+
noReturn = ~any /* is this right? */
972972

973973
withDefault = /* fixme */
974974

975-
noDefault = /* fixme */
975+
noDefault = ~any /* is this right? */
976976

977977
break = "break" ~identifierPart
978978
do = "do" ~identifierPart

0 commit comments

Comments
 (0)