From 1a889641ee0f7f3fa65b1d02f648001c60163966 Mon Sep 17 00:00:00 2001 From: Patrick Dubroy Date: Fri, 12 May 2023 15:51:02 +0200 Subject: [PATCH] Grammars for ES2015-ES2022 (#452) From https://github.com/ohmjs/ohm/pull/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` --- examples/ecmascript/gen/es2015.grammar.ohm | 8 +- examples/ecmascript/gen/es2016.grammar.ohm | 1253 ++++++++++++ examples/ecmascript/gen/es2017.grammar.ohm | 1328 +++++++++++++ examples/ecmascript/gen/es2018.grammar.ohm | 1430 ++++++++++++++ examples/ecmascript/gen/es2019.grammar.ohm | 1438 ++++++++++++++ examples/ecmascript/gen/es2020.grammar.ohm | 1460 ++++++++++++++ examples/ecmascript/gen/es2021.grammar.ohm | 1517 +++++++++++++++ examples/ecmascript/gen/es2022.grammar.ohm | 1590 +++++++++++++++ examples/ecmascript/package.json | 6 +- examples/ecmascript/scripts/dedent.py | 46 + .../scripts/extract-grammarkdown.mjs | 63 + .../scripts/generate-ecmascript-grammar.mjs | 329 ++-- examples/ecmascript/scripts/grammarkdown.ohm | 64 +- examples/ecmascript/spec/LICENSE.txt | 6 +- .../ecmascript/spec/es2015/overrides.json | 152 ++ .../{es2015.grammar => es2015/spec.grammar} | 0 .../ecmascript/spec/es2016/overrides.json | 152 ++ examples/ecmascript/spec/es2016/spec.grammar | 1345 +++++++++++++ .../spec/es2016/spec.strict.grammar | 1341 +++++++++++++ .../ecmascript/spec/es2017/overrides.json | 146 ++ examples/ecmascript/spec/es2017/spec.grammar | 1420 ++++++++++++++ .../ecmascript/spec/es2018/overrides.json | 146 ++ examples/ecmascript/spec/es2018/spec.grammar | 1544 +++++++++++++++ .../ecmascript/spec/es2019/overrides.json | 146 ++ examples/ecmascript/spec/es2019/spec.grammar | 1552 +++++++++++++++ .../ecmascript/spec/es2020/overrides.json | 143 ++ examples/ecmascript/spec/es2020/spec.grammar | 1569 +++++++++++++++ .../ecmascript/spec/es2021/overrides.json | 143 ++ examples/ecmascript/spec/es2021/spec.grammar | 1635 ++++++++++++++++ .../ecmascript/spec/es2022/overrides.json | 143 ++ examples/ecmascript/spec/es2022/spec.grammar | 1716 +++++++++++++++++ pnpm-lock.yaml | 1705 +++++++++------- 32 files changed, 24603 insertions(+), 933 deletions(-) create mode 100644 examples/ecmascript/gen/es2016.grammar.ohm create mode 100644 examples/ecmascript/gen/es2017.grammar.ohm create mode 100644 examples/ecmascript/gen/es2018.grammar.ohm create mode 100644 examples/ecmascript/gen/es2019.grammar.ohm create mode 100644 examples/ecmascript/gen/es2020.grammar.ohm create mode 100644 examples/ecmascript/gen/es2021.grammar.ohm create mode 100644 examples/ecmascript/gen/es2022.grammar.ohm create mode 100644 examples/ecmascript/scripts/dedent.py create mode 100644 examples/ecmascript/scripts/extract-grammarkdown.mjs create mode 100644 examples/ecmascript/spec/es2015/overrides.json rename examples/ecmascript/spec/{es2015.grammar => es2015/spec.grammar} (100%) create mode 100644 examples/ecmascript/spec/es2016/overrides.json create mode 100644 examples/ecmascript/spec/es2016/spec.grammar create mode 100644 examples/ecmascript/spec/es2016/spec.strict.grammar create mode 100644 examples/ecmascript/spec/es2017/overrides.json create mode 100644 examples/ecmascript/spec/es2017/spec.grammar create mode 100644 examples/ecmascript/spec/es2018/overrides.json create mode 100644 examples/ecmascript/spec/es2018/spec.grammar create mode 100644 examples/ecmascript/spec/es2019/overrides.json create mode 100644 examples/ecmascript/spec/es2019/spec.grammar create mode 100644 examples/ecmascript/spec/es2020/overrides.json create mode 100644 examples/ecmascript/spec/es2020/spec.grammar create mode 100644 examples/ecmascript/spec/es2021/overrides.json create mode 100644 examples/ecmascript/spec/es2021/spec.grammar create mode 100644 examples/ecmascript/spec/es2022/overrides.json create mode 100644 examples/ecmascript/spec/es2022/spec.grammar diff --git a/examples/ecmascript/gen/es2015.grammar.ohm b/examples/ecmascript/gen/es2015.grammar.ohm index 53f7f99c..ebc7099e 100644 --- a/examples/ecmascript/gen/es2015.grammar.ohm +++ b/examples/ecmascript/gen/es2015.grammar.ohm @@ -960,19 +960,19 @@ ES2015 { withYield = /* fixme */ - noYield = /* fixme */ + noYield = ~any /* is this right? */ withIn = /* fixme */ - noIn = /* fixme */ + noIn = ~any /* is this right? */ withReturn = /* fixme */ - noReturn = /* fixme */ + noReturn = ~any /* is this right? */ withDefault = /* fixme */ - noDefault = /* fixme */ + noDefault = ~any /* is this right? */ break = "break" ~identifierPart do = "do" ~identifierPart diff --git a/examples/ecmascript/gen/es2016.grammar.ohm b/examples/ecmascript/gen/es2016.grammar.ohm new file mode 100644 index 00000000..b7b630ef --- /dev/null +++ b/examples/ecmascript/gen/es2016.grammar.ohm @@ -0,0 +1,1253 @@ +ES2016 { + + Start = Script + + // Override Ohm's built-in definition of space. + space := whiteSpace | lineTerminator | comment + + unicodeZs = "\xA0" | "\u1680" | "\u2000".."\u200A" | "\u202F" | "\u205F" | "\u3000" + + multiLineCommentNoNL = "/*" (~("*/" | lineTerminator) sourceCharacter)* "*/" + + // does not accept lineTerminators, not even implicit ones in a multiLineComment (cf. section 7.4) + spacesNoNL = (whiteSpace | singleLineComment | multiLineCommentNoNL)* + + // A semicolon is "automatically inserted" if a newline or the end of the input stream is + // reached, or the offending token is "}". + // See https://es5.github.io/#x7.9 for more information. + // NOTE: Applications of this rule *must* appear in a lexical context -- either in the body of a + // lexical rule, or inside '#()'. + sc = space* (";" | end) + | spacesNoNL (lineTerminator | ~multiLineCommentNoNL multiLineComment | &"}") + + sourceCharacter = any + + inputElementDiv = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | rightBracePunctuator + + inputElementRegExp = + | whiteSpace + | lineTerminator + | comment + | commonToken + | rightBracePunctuator + | regularExpressionLiteral + + inputElementRegExpOrTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | regularExpressionLiteral + | templateSubstitutionTail + + inputElementTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | templateSubstitutionTail + + whiteSpace = + | "\t" + | "\x0B" + | "\x0C" + | " " + | "\xA0" + | "\uFEFF" + | unicodeZs + + lineTerminator = + | "\n" + | "\r" + | "\u2028" + | "\u2029" + + lineTerminatorSequence = + | "\n" -- alt1 + | "\r" ~"\n" -- alt2 + | "\u2028" -- alt3 + | "\u2029" -- alt4 + | "\r" "\n" -- alt5 + + comment = + | multiLineComment + | singleLineComment + + multiLineComment = + | "/*" multiLineCommentChars? "*/" -- alt1 + + multiLineCommentChars = + (~"*/" sourceCharacter)* + + postAsteriskCommentChars = + | multiLineNotForwardSlashOrAsteriskChar multiLineCommentChars? -- alt1 + | "*" ~"/" postAsteriskCommentChars? -- alt2 + + multiLineNotAsteriskChar = + | ~"*" sourceCharacter + + multiLineNotForwardSlashOrAsteriskChar = + | ~("/" | "*") sourceCharacter + + singleLineComment = + | "//" singleLineCommentChars? -- alt1 + + singleLineCommentChars = + | singleLineCommentChar+ + + singleLineCommentChar = + | ~lineTerminator sourceCharacter + + commonToken = + | identifierName + | punctuator + | numericLiteral + | stringLiteral + | template + + identifierName = + | identifierName identifierPart -- alt2 + | identifierStart -- alt1 + + identifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" unicodeEscapeSequence -- alt4 + + identifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" unicodeEscapeSequence -- alt4 + | "_" -- alt5 /* FIXME */ + + unicodeIDStart = letter /* fixme */ + + unicodeIDContinue = letter | digit /* fixme */ + + reservedWord = + | keyword + | futureReservedWord + | nullLiteral + | booleanLiteral + + keyword = instanceof | continue | debugger | function | extends | finally | default | typeof | export | return | switch | delete | import | break | catch | class | while | const | super | yield | throw | case | else | void | with | this | var | new | for | try | do | in | if + + futureReservedWord = + | enum + | await + + punctuator = ">>>=" | "..." | "===" | "!==" | ">>>" | "<<=" | ">>=" | "**=" | "<=" | ">=" | "==" | "!=" | "++" | "--" | "<<" | ">>" | "&&" | "||" | "+=" | "-=" | "*=" | "%=" | "&=" | "|=" | "^=" | "=>" | "**" | "{" | "(" | ")" | "[" | "]" | "." | #sc | "," | "<" | ">" | "+" | "-" | "*" | "%" | "&" | "|" | "^" | "!" | "~" | "?" | ":" | "=" + + divPunctuator = + | "/" + | "/=" + + rightBracePunctuator = + | "}" + + nullLiteral = + | null + + booleanLiteral = + | true + | false + + numericLiteral = + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + | decimalLiteral + + decimalLiteral = + | decimalIntegerLiteral "." decimalDigits? exponentPart? -- alt1 + | "." decimalDigits exponentPart? -- alt2 + | decimalIntegerLiteral exponentPart? -- alt3 + + decimalIntegerLiteral = + | "0" -- alt1 + | nonZeroDigit decimalDigits? -- alt2 + + decimalDigits = + | decimalDigits decimalDigit -- alt2 + | decimalDigit -- alt1 + + decimalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + nonZeroDigit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + exponentPart = + | exponentIndicator signedInteger -- alt1 + + exponentIndicator = "e" | "E" + + signedInteger = + | decimalDigits -- alt1 + | "+" decimalDigits -- alt2 + | "-" decimalDigits -- alt3 + + binaryIntegerLiteral = + | "0b" binaryDigits -- alt1 + | "0B" binaryDigits -- alt2 + + binaryDigits = + | binaryDigits binaryDigit -- alt2 + | binaryDigit -- alt1 + + binaryDigit = "0" | "1" + + octalIntegerLiteral = + | "0o" octalDigits -- alt1 + | "0O" octalDigits -- alt2 + + octalDigits = + | octalDigits octalDigit -- alt2 + | octalDigit -- alt1 + + octalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" + + hexIntegerLiteral = + | "0x" hexDigits -- alt1 + | "0X" hexDigits -- alt2 + + hexDigits = + | hexDigits hexDigit -- alt2 + | hexDigit -- alt1 + + hexDigit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F" + + stringLiteral = + | "\"" doubleStringCharacters? "\"" -- alt1 + | "'" singleStringCharacters? "'" -- alt2 + + doubleStringCharacters = + | doubleStringCharacter+ + + singleStringCharacters = + | singleStringCharacter+ + + doubleStringCharacter = + | ~("\"" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\\" escapeSequence -- alt2 + | lineContinuation -- alt3 + + singleStringCharacter = + | ~("'" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\\" escapeSequence -- alt2 + | lineContinuation -- alt3 + + lineContinuation = + | "\\" lineTerminatorSequence -- alt1 + + escapeSequence = + | characterEscapeSequence -- alt1 + | "0" ~decimalDigit -- alt2 + | hexEscapeSequence -- alt3 + | unicodeEscapeSequence -- alt4 + + characterEscapeSequence = + | singleEscapeCharacter + | nonEscapeCharacter + + singleEscapeCharacter = "\"" | "\\" | "'" | "b" | "f" | "n" | "r" | "t" | "v" + + nonEscapeCharacter = + | ~(escapeCharacter | lineTerminator) sourceCharacter + + escapeCharacter = + | singleEscapeCharacter + | decimalDigit + | "x" + | "u" + + hexEscapeSequence = + | "x" hexDigit hexDigit -- alt1 + + unicodeEscapeSequence = + | "u" hex4Digits -- alt1 + | "u{" hexDigits "}" -- alt2 + + hex4Digits = + | hexDigit hexDigit hexDigit hexDigit -- alt1 + + regularExpressionLiteral = + | "/" regularExpressionBody "/" regularExpressionFlags -- alt1 + + regularExpressionBody = + | regularExpressionFirstChar regularExpressionChars -- alt1 + + regularExpressionChars = + | regularExpressionChars regularExpressionChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionFirstChar = + | ~("*" | "\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionChar = + | ~("\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionBackslashSequence = + | "\\" regularExpressionNonTerminator -- alt1 + + regularExpressionNonTerminator = + | ~lineTerminator sourceCharacter + + regularExpressionClass = + | "[" regularExpressionClassChars "]" -- alt1 + + regularExpressionClassChars = + | regularExpressionClassChars regularExpressionClassChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionClassChar = + | ~("]" | "\\") regularExpressionNonTerminator + | regularExpressionBackslashSequence + + regularExpressionFlags = + | regularExpressionFlags identifierPart -- alt2 + | /* empty */ -- alt1 + + template = + | noSubstitutionTemplate + | templateHead + + noSubstitutionTemplate = + | "`" templateCharacters? "`" -- alt1 + + templateHead = + | "`" templateCharacters? "${" -- alt1 + + templateSubstitutionTail = + | templateMiddle + | templateTail + + templateMiddle = + | "}" templateCharacters? "${" -- alt1 + + templateTail = + | "}" templateCharacters? "`" -- alt1 + + templateCharacters = + | templateCharacter+ + + templateCharacter = + | "$" ~"{" -- alt1 + | "\\" escapeSequence -- alt2 + | lineContinuation -- alt3 + | lineTerminatorSequence -- alt4 + | ~("`" | "\\" | "$" | lineTerminator) sourceCharacter -- alt5 + + IdentifierReference = + | Identifier -- alt1 + | guardYield yield -- alt2 + + BindingIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + + LabelIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + + Identifier = + | ~reservedWord identifierName + + PrimaryExpression = + | this -- alt1 + | IdentifierReference -- alt2 + | Literal -- alt3 + | ArrayLiteral -- alt4 + | ObjectLiteral -- alt5 + | FunctionExpression -- alt6 + | ClassExpression -- alt7 + | GeneratorExpression -- alt8 + | regularExpressionLiteral -- alt9 + | TemplateLiteral -- alt10 + | CoverParenthesizedExpressionAndArrowParameterList -- alt11 + + CoverParenthesizedExpressionAndArrowParameterList = + | "(" Expression ")" -- alt1 + | "(" ")" -- alt2 + | "(" "..." BindingIdentifier ")" -- alt3 + | "(" "..." BindingPattern ")" -- alt4 + | "(" Expression "," "..." BindingIdentifier ")" -- alt5 + | "(" Expression "," "..." BindingPattern ")" -- alt6 + + ParenthesizedExpression = + | "(" Expression ")" -- alt1 + + Literal = + | nullLiteral + | booleanLiteral + | numericLiteral + | stringLiteral + + ArrayLiteral = + | "[" Elision? "]" -- alt1 + | "[" ElementList "]" -- alt2 + | "[" ElementList "," Elision? "]" -- alt3 + + ElementList = + | ElementList "," Elision? AssignmentExpression -- alt3 + | ElementList "," Elision? SpreadElement -- alt4 + | Elision? AssignmentExpression -- alt1 + | Elision? SpreadElement -- alt2 + + Elision = + | Elision "," -- alt2 + | "," -- alt1 + + SpreadElement = + | "..." AssignmentExpression -- alt1 + + ObjectLiteral = + | "{" "}" -- alt1 + | "{" PropertyDefinitionList "}" -- alt2 + | "{" PropertyDefinitionList "," "}" -- alt3 + + PropertyDefinitionList = + | PropertyDefinitionList "," PropertyDefinition -- alt2 + | PropertyDefinition -- alt1 + + PropertyDefinition = + | MethodDefinition -- alt4 + | PropertyName ":" AssignmentExpression -- alt3 + | IdentifierReference -- alt1 + | CoverInitializedName -- alt2 + + PropertyName = + | LiteralPropertyName + | ComputedPropertyName + + LiteralPropertyName = + | identifierName + | stringLiteral + | numericLiteral + + ComputedPropertyName = + | "[" AssignmentExpression "]" -- alt1 + + CoverInitializedName = + | IdentifierReference Initializer -- alt1 + + Initializer = + | "=" AssignmentExpression -- alt1 + + TemplateLiteral = + | noSubstitutionTemplate -- alt1 + | templateHead Expression TemplateSpans -- alt2 + + TemplateSpans = + | templateTail -- alt1 + | TemplateMiddleList templateTail -- alt2 + + TemplateMiddleList = + | TemplateMiddleList templateMiddle Expression -- alt2 + | templateMiddle Expression -- alt1 + + MemberExpression = + | MemberExpression "[" Expression "]" -- alt2 + | MemberExpression "." identifierName -- alt3 + | MemberExpression TemplateLiteral -- alt4 + | new MemberExpression Arguments -- alt7 + | PrimaryExpression -- alt1 + | SuperProperty -- alt5 + | MetaProperty -- alt6 + + SuperProperty = + | super "[" Expression "]" -- alt1 + | super "." identifierName -- alt2 + + MetaProperty = + | NewTarget + + NewTarget = + | new "." "target" -- alt1 + + NewExpression = + | MemberExpression -- alt1 + | new NewExpression -- alt2 + + CallExpression = + | CallExpression Arguments -- alt3 + | CallExpression "[" Expression "]" -- alt4 + | CallExpression "." identifierName -- alt5 + | CallExpression TemplateLiteral -- alt6 + | MemberExpression Arguments -- alt1 + | SuperCall -- alt2 + + SuperCall = + | super Arguments -- alt1 + + Arguments = + | "(" ")" -- alt1 + | "(" ArgumentList ")" -- alt2 + + ArgumentList = + | ArgumentList "," AssignmentExpression -- alt3 + | ArgumentList "," "..." AssignmentExpression -- alt4 + | AssignmentExpression -- alt1 + | "..." AssignmentExpression -- alt2 + + LeftHandSideExpression = + | CallExpression + | NewExpression + + UpdateExpression = + | LeftHandSideExpression -- alt1 + | LeftHandSideExpression ~lineTerminator "++" -- alt2 + | LeftHandSideExpression ~lineTerminator "--" -- alt3 + | "++" UnaryExpression -- alt4 + | "--" UnaryExpression -- alt5 + + UnaryExpression = + | delete UnaryExpression -- alt2 + | void UnaryExpression -- alt3 + | typeof UnaryExpression -- alt4 + | "+" UnaryExpression -- alt5 + | "-" UnaryExpression -- alt6 + | "~" UnaryExpression -- alt7 + | "!" UnaryExpression -- alt8 + | UpdateExpression -- alt1 + + ExponentiationExpression = + | UnaryExpression -- alt1 + | UpdateExpression "**" ExponentiationExpression -- alt2 + + MultiplicativeExpression = + | MultiplicativeExpression MultiplicativeOperator ExponentiationExpression -- alt2 + | ExponentiationExpression -- alt1 + + MultiplicativeOperator = "*" | "/" | "%" + + AdditiveExpression = + | AdditiveExpression "+" MultiplicativeExpression -- alt2 + | AdditiveExpression "-" MultiplicativeExpression -- alt3 + | MultiplicativeExpression -- alt1 + + ShiftExpression = + | ShiftExpression "<<" AdditiveExpression -- alt2 + | ShiftExpression ">>" AdditiveExpression -- alt3 + | ShiftExpression ">>>" AdditiveExpression -- alt4 + | AdditiveExpression -- alt1 + + RelationalExpression = + | RelationalExpression "<" ShiftExpression -- alt2 + | RelationalExpression ">" ShiftExpression -- alt3 + | RelationalExpression "<=" ShiftExpression -- alt4 + | RelationalExpression ">=" ShiftExpression -- alt5 + | RelationalExpression instanceof ShiftExpression -- alt6 + | RelationalExpression guardIn in ShiftExpression -- alt7 + | ShiftExpression -- alt1 + + EqualityExpression = + | EqualityExpression "==" RelationalExpression -- alt2 + | EqualityExpression "!=" RelationalExpression -- alt3 + | EqualityExpression "===" RelationalExpression -- alt4 + | EqualityExpression "!==" RelationalExpression -- alt5 + | RelationalExpression -- alt1 + + BitwiseANDExpression = + | BitwiseANDExpression "&" EqualityExpression -- alt2 + | EqualityExpression -- alt1 + + BitwiseXORExpression = + | BitwiseXORExpression "^" BitwiseANDExpression -- alt2 + | BitwiseANDExpression -- alt1 + + BitwiseORExpression = + | BitwiseORExpression "|" BitwiseXORExpression -- alt2 + | BitwiseXORExpression -- alt1 + + LogicalANDExpression = + | LogicalANDExpression "&&" BitwiseORExpression -- alt2 + | BitwiseORExpression -- alt1 + + LogicalORExpression = + | LogicalORExpression "||" LogicalANDExpression -- alt2 + | LogicalANDExpression -- alt1 + + ConditionalExpression = + | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2 + | LogicalORExpression -- alt1 + + AssignmentExpression = + | ArrowFunction -- alt3 + | LeftHandSideExpression "=" AssignmentExpression -- alt4 + | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt5 + | ConditionalExpression -- alt1 + | guardYield YieldExpression -- alt2 + + AssignmentOperator = ">>>=" | "<<=" | ">>=" | "**=" | "*=" | "/=" | "%=" | "+=" | "-=" | "&=" | "^=" | "|=" + + AssignmentPattern = + | ObjectAssignmentPattern + | ArrayAssignmentPattern + + ObjectAssignmentPattern = + | "{" "}" -- alt1 + | "{" AssignmentPropertyList "}" -- alt2 + | "{" AssignmentPropertyList "," "}" -- alt3 + + ArrayAssignmentPattern = + | "[" Elision? AssignmentRestElement? "]" -- alt1 + | "[" AssignmentElementList "]" -- alt2 + | "[" AssignmentElementList "," Elision? AssignmentRestElement? "]" -- alt3 + + AssignmentPropertyList = + | AssignmentPropertyList "," AssignmentProperty -- alt2 + | AssignmentProperty -- alt1 + + AssignmentElementList = + | AssignmentElementList "," AssignmentElisionElement -- alt2 + | AssignmentElisionElement -- alt1 + + AssignmentElisionElement = + | Elision? AssignmentElement -- alt1 + + AssignmentProperty = + | IdentifierReference Initializer? -- alt1 + | PropertyName ":" AssignmentElement -- alt2 + + AssignmentElement = + | DestructuringAssignmentTarget Initializer? -- alt1 + + AssignmentRestElement = + | "..." DestructuringAssignmentTarget -- alt1 + + DestructuringAssignmentTarget = + | LeftHandSideExpression + + Expression = + | Expression "," AssignmentExpression -- alt2 + | AssignmentExpression -- alt1 + + Statement = + | BlockStatement -- alt1 + | VariableStatement -- alt2 + | EmptyStatement -- alt3 + | ExpressionStatement -- alt4 + | IfStatement -- alt5 + | BreakableStatement -- alt6 + | ContinueStatement -- alt7 + | BreakStatement -- alt8 + | guardReturn ReturnStatement -- alt9 + | WithStatement -- alt10 + | LabelledStatement -- alt11 + | ThrowStatement -- alt12 + | TryStatement -- alt13 + | DebuggerStatement -- alt14 + + Declaration = + | HoistableDeclaration + | ClassDeclaration + | LexicalDeclaration + + HoistableDeclaration = + | FunctionDeclaration + | GeneratorDeclaration + + BreakableStatement = + | IterationStatement + | SwitchStatement + + BlockStatement = + | Block + + Block = + | "{" StatementList? "}" -- alt1 + + StatementList = + | StatementListItem+ + + StatementListItem = + | Statement + | Declaration + + LexicalDeclaration = + | LetOrConst BindingList #sc -- alt1 + + LetOrConst = + | "let" + | const + + BindingList = + | BindingList "," LexicalBinding -- alt2 + | LexicalBinding -- alt1 + + LexicalBinding = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + VariableStatement = + | var VariableDeclarationList #sc -- alt1 + + VariableDeclarationList = + | VariableDeclarationList "," VariableDeclaration -- alt2 + | VariableDeclaration -- alt1 + + VariableDeclaration = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + BindingPattern = + | ObjectBindingPattern + | ArrayBindingPattern + + ObjectBindingPattern = + | "{" "}" -- alt1 + | "{" BindingPropertyList "}" -- alt2 + | "{" BindingPropertyList "," "}" -- alt3 + + ArrayBindingPattern = + | "[" Elision? BindingRestElement? "]" -- alt1 + | "[" BindingElementList "]" -- alt2 + | "[" BindingElementList "," Elision? BindingRestElement? "]" -- alt3 + + BindingPropertyList = + | BindingPropertyList "," BindingProperty -- alt2 + | BindingProperty -- alt1 + + BindingElementList = + | BindingElementList "," BindingElisionElement -- alt2 + | BindingElisionElement -- alt1 + + BindingElisionElement = + | Elision? BindingElement -- alt1 + + BindingProperty = + | SingleNameBinding -- alt1 + | PropertyName ":" BindingElement -- alt2 + + BindingElement = + | SingleNameBinding -- alt1 + | BindingPattern Initializer? -- alt2 + + SingleNameBinding = + | BindingIdentifier Initializer? -- alt1 + + BindingRestElement = + | "..." BindingIdentifier -- alt1 + | "..." BindingPattern -- alt2 + + EmptyStatement = ";" // note: this semicolon eats newlines + + ExpressionStatement = + | ~("{" | "function" | "class" | ("let" "[")) Expression #sc -- alt1 + + IfStatement = + | if "(" Expression ")" Statement else Statement -- alt1 + | if "(" Expression ")" Statement -- alt2 + + IterationStatement = + | do Statement while "(" Expression ")" #sc -- alt1 + | while "(" Expression ")" Statement -- alt2 + | for "(" ~(("let" "[")) Expression? #sc Expression? #sc Expression? ")" Statement -- alt3 + | for "(" var VariableDeclarationList #sc Expression? #sc Expression? ")" Statement -- alt4 + | for "(" LexicalDeclaration Expression? #sc Expression? ")" Statement -- alt5 + | for "(" ~(("let" "[")) LeftHandSideExpression in Expression ")" Statement -- alt6 + | for "(" var ForBinding in Expression ")" Statement -- alt7 + | for "(" ForDeclaration in Expression ")" Statement -- alt8 + | for "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt9 + | for "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt10 + | for "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt11 + + ForDeclaration = + | LetOrConst ForBinding -- alt1 + + ForBinding = + | BindingIdentifier + | BindingPattern + + ContinueStatement = + | continue #sc -- alt1 + | continue ~lineTerminator LabelIdentifier #sc -- alt2 + + BreakStatement = + | break #sc -- alt1 + | break ~lineTerminator LabelIdentifier #sc -- alt2 + + ReturnStatement = + | return #sc -- alt1 + | return ~lineTerminator Expression #sc -- alt2 + + WithStatement = + | with "(" Expression ")" Statement -- alt1 + + SwitchStatement = + | switch "(" Expression ")" CaseBlock -- alt1 + + CaseBlock = + | "{" CaseClauses? "}" -- alt1 + | "{" CaseClauses? DefaultClause CaseClauses? "}" -- alt2 + + CaseClauses = + | CaseClauses CaseClause -- alt2 + | CaseClause -- alt1 + + CaseClause = + | case Expression ":" StatementList? -- alt1 + + DefaultClause = + | default ":" StatementList? -- alt1 + + LabelledStatement = + | LabelIdentifier ":" LabelledItem -- alt1 + + LabelledItem = + | Statement + | FunctionDeclaration + + ThrowStatement = + | throw ~lineTerminator Expression #sc -- alt1 + + TryStatement = + | try Block Catch -- alt1 + | try Block Finally -- alt2 + | try Block Catch Finally -- alt3 + + Catch = + | catch "(" CatchParameter ")" Block -- alt1 + + Finally = + | finally Block -- alt1 + + CatchParameter = + | BindingIdentifier + | BindingPattern + + DebuggerStatement = + | debugger #sc -- alt1 + + FunctionDeclaration = + | function BindingIdentifier "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + | guardDefault function "(" FormalParameters ")" "{" FunctionBody "}" -- alt2 + + FunctionExpression = + | function BindingIdentifier? "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + + StrictFormalParameters = + | FormalParameters + + FormalParameters = + | FormalParameterList -- alt2 + | /* empty */ -- alt1 + + FormalParameterList = + | FunctionRestParameter -- alt1 + | FormalsList "," FunctionRestParameter -- alt3 + | FormalsList -- alt2 + + FormalsList = + | FormalsList "," FormalParameter -- alt2 + | FormalParameter -- alt1 + + FunctionRestParameter = + | BindingRestElement + + FormalParameter = + | BindingElement + + FunctionBody = + | FunctionStatementList + + FunctionStatementList = + | StatementList? + + ArrowFunction = + | ArrowParameters ~lineTerminator "=>" ConciseBody -- alt1 + + ArrowParameters = + | BindingIdentifier -- alt1 + | CoverParenthesizedExpressionAndArrowParameterList -- alt2 + + ConciseBody = + | ~"{" AssignmentExpression -- alt1 + | "{" FunctionBody "}" -- alt2 + + ArrowFormalParameters = + | "(" StrictFormalParameters ")" -- alt1 + + MethodDefinition = + | PropertyName "(" StrictFormalParameters ")" "{" FunctionBody "}" -- alt1 + | GeneratorMethod -- alt2 + | "get" PropertyName "(" ")" "{" FunctionBody "}" -- alt3 + | "set" PropertyName "(" PropertySetParameterList ")" "{" FunctionBody "}" -- alt4 + + PropertySetParameterList = + | FormalParameter + + GeneratorMethod = + | "*" PropertyName "(" StrictFormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorDeclaration = + | function "*" BindingIdentifier "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + | guardDefault function "*" "(" FormalParameters ")" "{" GeneratorBody "}" -- alt2 + + GeneratorExpression = + | function "*" BindingIdentifier? "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorBody = + | FunctionBody + + YieldExpression = + | yield -- alt1 + | yield ~lineTerminator AssignmentExpression -- alt2 + | yield ~lineTerminator "*" AssignmentExpression -- alt3 + + ClassDeclaration = + | class BindingIdentifier ClassTail -- alt1 + | guardDefault class ClassTail -- alt2 + + ClassExpression = + | class BindingIdentifier? ClassTail -- alt1 + + ClassTail = + | ClassHeritage? "{" ClassBody? "}" -- alt1 + + ClassHeritage = + | extends LeftHandSideExpression -- alt1 + + ClassBody = + | ClassElementList + + ClassElementList = + | ClassElementList ClassElement -- alt2 + | ClassElement -- alt1 + + ClassElement = + | MethodDefinition -- alt1 + | "static" MethodDefinition -- alt2 + | #sc -- alt3 + + Script = + | ScriptBody? + + ScriptBody = + | StatementList + + Module = + | ModuleBody? + + ModuleBody = + | ModuleItemList + + ModuleItemList = + | ModuleItem+ + + ModuleItem = + | ImportDeclaration + | ExportDeclaration + | StatementListItem + + ImportDeclaration = + | import ImportClause FromClause #sc -- alt1 + | import ModuleSpecifier #sc -- alt2 + + ImportClause = + | ImportedDefaultBinding -- alt1 + | NameSpaceImport -- alt2 + | NamedImports -- alt3 + | ImportedDefaultBinding "," NameSpaceImport -- alt4 + | ImportedDefaultBinding "," NamedImports -- alt5 + + ImportedDefaultBinding = + | ImportedBinding + + NameSpaceImport = + | "*" "as" ImportedBinding -- alt1 + + NamedImports = + | "{" "}" -- alt1 + | "{" ImportsList "}" -- alt2 + | "{" ImportsList "," "}" -- alt3 + + FromClause = + | "from" ModuleSpecifier -- alt1 + + ImportsList = + | ImportsList "," ImportSpecifier -- alt2 + | ImportSpecifier -- alt1 + + ImportSpecifier = + | ImportedBinding -- alt1 + | identifierName "as" ImportedBinding -- alt2 + + ModuleSpecifier = + | stringLiteral + + ImportedBinding = + | BindingIdentifier + + ExportDeclaration = + | export "*" FromClause #sc -- alt1 + | export ExportClause FromClause #sc -- alt2 + | export ExportClause #sc -- alt3 + | export VariableStatement -- alt4 + | export Declaration -- alt5 + | export default HoistableDeclaration -- alt6 + | export default ClassDeclaration -- alt7 + | export default ~("function" | "class") AssignmentExpression #sc -- alt8 + + ExportClause = + | "{" "}" -- alt1 + | "{" ExportsList "}" -- alt2 + | "{" ExportsList "," "}" -- alt3 + + ExportsList = + | ExportsList "," ExportSpecifier -- alt2 + | ExportSpecifier -- alt1 + + ExportSpecifier = + | identifierName -- alt1 + | identifierName "as" identifierName -- alt2 + + stringNumericLiteral = + | strWhiteSpace? -- alt1 + | strWhiteSpace? strNumericLiteral strWhiteSpace? -- alt2 + + strWhiteSpace = + | strWhiteSpaceChar strWhiteSpace? -- alt1 + + strWhiteSpaceChar = + | whiteSpace + | lineTerminator + + strNumericLiteral = + | strDecimalLiteral + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + + strDecimalLiteral = + | strUnsignedDecimalLiteral -- alt1 + | "+" strUnsignedDecimalLiteral -- alt2 + | "-" strUnsignedDecimalLiteral -- alt3 + + strUnsignedDecimalLiteral = + | "Infinity" -- alt1 + | decimalDigits "." decimalDigits? exponentPart? -- alt2 + | "." decimalDigits exponentPart? -- alt3 + | decimalDigits exponentPart? -- alt4 + + uri = + | uriCharacters? + + uriCharacters = + | uriCharacter uriCharacters? -- alt1 + + uriCharacter = + | uriReserved + | uriUnescaped + | uriEscaped + + uriReserved = #sc | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," + + uriUnescaped = + | uriAlpha + | decimalDigit + | uriMark + + uriEscaped = + | "%" hexDigit hexDigit -- alt1 + + uriAlpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + uriMark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" + + pattern = + | disjunction + + disjunction = + | alternative -- alt1 + | alternative "|" disjunction -- alt2 + + alternative = + | alternative term -- alt2 + | /* empty */ -- alt1 + + term = + | assertion -- alt1 + | atom -- alt2 + | atom quantifier -- alt3 + + assertion = + | "^" -- alt1 + | "$" -- alt2 + | "\\" "b" -- alt3 + | "\\" "B" -- alt4 + | "(" "?" "=" disjunction ")" -- alt5 + | "(" "?" "!" disjunction ")" -- alt6 + + quantifier = + | quantifierPrefix -- alt1 + | quantifierPrefix "?" -- alt2 + + quantifierPrefix = + | "*" -- alt1 + | "+" -- alt2 + | "?" -- alt3 + | "{" decimalDigits "}" -- alt4 + | "{" decimalDigits "," "}" -- alt5 + | "{" decimalDigits "," decimalDigits "}" -- alt6 + + atom = + | patternCharacter -- alt1 + | "." -- alt2 + | "\\" atomEscape -- alt3 + | characterClass -- alt4 + | "(" disjunction ")" -- alt5 + | "(" "?" ":" disjunction ")" -- alt6 + + syntaxCharacter = "\\" | "^" | "$" | "." | "*" | "+" | "?" | "(" | ")" | "[" | "]" | "{" | "}" | "|" + + patternCharacter = + | ~syntaxCharacter sourceCharacter + + atomEscape = + | decimalEscape + | characterEscape + | characterClassEscape + + characterEscape = + | controlEscape -- alt1 + | "c" controlLetter -- alt2 + | hexEscapeSequence -- alt3 + | regExpUnicodeEscapeSequence -- alt4 + | identityEscape -- alt5 + + controlEscape = "f" | "n" | "r" | "t" | "v" + + controlLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + regExpUnicodeEscapeSequence = + | guardU "u" leadSurrogate "\\u" trailSurrogate -- alt1 + | guardU "u" leadSurrogate -- alt2 + | guardU "u" trailSurrogate -- alt3 + | guardU "u" nonSurrogate -- alt4 + | guardU "u" hex4Digits -- alt5 + | guardU "u{" hexDigits "}" -- alt6 + + leadSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF */ -- alt1 + + trailSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF */ -- alt1 + + nonSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF */ -- alt1 + + identityEscape = + | guardU syntaxCharacter -- alt1 + | guardU "/" -- alt2 + | guardU ~unicodeIDContinue sourceCharacter -- alt3 + + decimalEscape = + | decimalIntegerLiteral ~decimalDigit -- alt1 + + characterClassEscape = "d" | "D" | "s" | "S" | "w" | "W" + + characterClass = + | "[" ~("^") classRanges "]" -- alt1 + | "[" "^" classRanges "]" -- alt2 + + classRanges = + | /* empty */ -- alt1 + | nonemptyClassRanges -- alt2 + + nonemptyClassRanges = + | classAtom -- alt1 + | classAtom nonemptyClassRangesNoDash -- alt2 + | classAtom "-" classAtom classRanges -- alt3 + + nonemptyClassRangesNoDash = + | classAtom -- alt1 + | classAtomNoDash nonemptyClassRangesNoDash -- alt2 + | classAtomNoDash "-" classAtom classRanges -- alt3 + + classAtom = + | "-" + | classAtomNoDash + + classAtomNoDash = + | ~("\\" | "]" | "-") sourceCharacter -- alt1 + | "\\" classEscape -- alt2 + + classEscape = + | decimalEscape -- alt1 + | "b" -- alt2 + | guardU "-" -- alt3 + | characterEscape -- alt4 + | characterClassEscape -- alt5 + + withYield = /* fixme */ + + noYield = ~any /* is this right? */ + + withIn = /* fixme */ + + noIn = ~any /* is this right? */ + + withReturn = /* fixme */ + + noReturn = ~any /* is this right? */ + + withDefault = /* fixme */ + + noDefault = ~any /* is this right? */ + + withU = /* fixme */ + + noU = ~any /* is this right? */ + + break = "break" ~identifierPart + do = "do" ~identifierPart + in = "in" ~identifierPart + typeof = "typeof" ~identifierPart + case = "case" ~identifierPart + else = "else" ~identifierPart + instanceof = "instanceof" ~identifierPart + var = "var" ~identifierPart + catch = "catch" ~identifierPart + export = "export" ~identifierPart + new = "new" ~identifierPart + void = "void" ~identifierPart + class = "class" ~identifierPart + extends = "extends" ~identifierPart + return = "return" ~identifierPart + while = "while" ~identifierPart + const = "const" ~identifierPart + finally = "finally" ~identifierPart + super = "super" ~identifierPart + with = "with" ~identifierPart + continue = "continue" ~identifierPart + for = "for" ~identifierPart + switch = "switch" ~identifierPart + yield = "yield" ~identifierPart + debugger = "debugger" ~identifierPart + function = "function" ~identifierPart + this = "this" ~identifierPart + default = "default" ~identifierPart + if = "if" ~identifierPart + throw = "throw" ~identifierPart + delete = "delete" ~identifierPart + import = "import" ~identifierPart + try = "try" ~identifierPart + enum = "enum" ~identifierPart + await = "await" ~identifierPart + null = "null" ~identifierPart + true = "true" ~identifierPart + false = "false" ~identifierPart +} diff --git a/examples/ecmascript/gen/es2017.grammar.ohm b/examples/ecmascript/gen/es2017.grammar.ohm new file mode 100644 index 00000000..a2f6efc3 --- /dev/null +++ b/examples/ecmascript/gen/es2017.grammar.ohm @@ -0,0 +1,1328 @@ +ES2017 { + + Start = Script + + // Override Ohm's built-in definition of space. + space := whiteSpace | lineTerminator | comment + + unicodeZs = "\xA0" | "\u1680" | "\u2000".."\u200A" | "\u202F" | "\u205F" | "\u3000" + + multiLineCommentNoNL = "/*" (~("*/" | lineTerminator) sourceCharacter)* "*/" + + // does not accept lineTerminators, not even implicit ones in a multiLineComment (cf. section 7.4) + spacesNoNL = (whiteSpace | singleLineComment | multiLineCommentNoNL)* + + // A semicolon is "automatically inserted" if a newline or the end of the input stream is + // reached, or the offending token is "}". + // See https://es5.github.io/#x7.9 for more information. + // NOTE: Applications of this rule *must* appear in a lexical context -- either in the body of a + // lexical rule, or inside '#()'. + sc = space* (";" | end) + | spacesNoNL (lineTerminator | ~multiLineCommentNoNL multiLineComment | &"}") + + sourceCharacter = any + + inputElementDiv = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | rightBracePunctuator + + inputElementRegExp = + | whiteSpace + | lineTerminator + | comment + | commonToken + | rightBracePunctuator + | regularExpressionLiteral + + inputElementRegExpOrTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | regularExpressionLiteral + | templateSubstitutionTail + + inputElementTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | templateSubstitutionTail + + whiteSpace = + | "\t" + | "\x0B" + | "\x0C" + | " " + | "\xA0" + | "\uFEFF" + | unicodeZs + + lineTerminator = + | "\n" + | "\r" + | "\u2028" + | "\u2029" + + lineTerminatorSequence = + | "\n" -- alt1 + | "\r" ~"\n" -- alt2 + | "\u2028" -- alt3 + | "\u2029" -- alt4 + | "\r" "\n" -- alt5 + + comment = + | multiLineComment + | singleLineComment + + multiLineComment = + | "/*" multiLineCommentChars? "*/" -- alt1 + + multiLineCommentChars = + (~"*/" sourceCharacter)* + + postAsteriskCommentChars = + | multiLineNotForwardSlashOrAsteriskChar multiLineCommentChars? -- alt1 + | "*" ~"/" postAsteriskCommentChars? -- alt2 + + multiLineNotAsteriskChar = + | ~"*" sourceCharacter + + multiLineNotForwardSlashOrAsteriskChar = + | ~("/" | "*") sourceCharacter + + singleLineComment = + | "//" singleLineCommentChars? -- alt1 + + singleLineCommentChars = + | singleLineCommentChar+ + + singleLineCommentChar = + | ~lineTerminator sourceCharacter + + commonToken = + | identifierName + | punctuator + | numericLiteral + | stringLiteral + | template + + identifierName = + | identifierName identifierPart -- alt2 + | identifierStart -- alt1 + + identifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" unicodeEscapeSequence -- alt4 + + identifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" unicodeEscapeSequence -- alt4 + | "_" -- alt5 /* FIXME */ + + unicodeIDStart = letter /* fixme */ + + unicodeIDContinue = letter | digit /* fixme */ + + reservedWord = + | keyword + | futureReservedWord + | nullLiteral + | booleanLiteral + + keyword = + | await -- alt1 + | break -- alt2 + | case catch class const continue -- alt3 + | debugger default delete do -- alt4 + | else export extends -- alt5 + | finally for function -- alt6 + | if import in instanceof -- alt7 + | new -- alt8 + | return -- alt9 + | super switch -- alt10 + | this throw try typeof -- alt11 + | var void -- alt12 + | while with -- alt13 + | yield -- alt14 + + futureReservedWord = + | enum + + punctuator = + | "{" "(" ")" "[" "]" -- alt1 + | "." "..." #sc "," -- alt2 + | "<" ">" "<=" ">=" -- alt3 + | "==" "!=" "===" "!==" -- alt4 + | "+" "-" "*" "%" "**" -- alt5 + | "++" "--" -- alt6 + | "<<" ">>" ">>>" -- alt7 + | "&" "|" "^" -- alt8 + | "!" "~" -- alt9 + | "&&" "||" -- alt10 + | "?" ":" -- alt11 + | "=" "+=" "-=" "*=" "%=" "**=" "<<=" ">>=" ">>>=" "&=" "|=" "^=" -- alt12 + | "=>" -- alt13 + + divPunctuator = + | "/" + | "/=" + + rightBracePunctuator = + | "}" + + nullLiteral = + | null + + booleanLiteral = + | true + | false + + numericLiteral = + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + | decimalLiteral + + decimalLiteral = + | decimalIntegerLiteral "." decimalDigits? exponentPart? -- alt1 + | "." decimalDigits exponentPart? -- alt2 + | decimalIntegerLiteral exponentPart? -- alt3 + + decimalIntegerLiteral = + | "0" -- alt1 + | nonZeroDigit decimalDigits? -- alt2 + + decimalDigits = + | decimalDigits decimalDigit -- alt2 + | decimalDigit -- alt1 + + decimalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + nonZeroDigit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + exponentPart = + | exponentIndicator signedInteger -- alt1 + + exponentIndicator = "e" | "E" + + signedInteger = + | decimalDigits -- alt1 + | "+" decimalDigits -- alt2 + | "-" decimalDigits -- alt3 + + binaryIntegerLiteral = + | "0b" binaryDigits -- alt1 + | "0B" binaryDigits -- alt2 + + binaryDigits = + | binaryDigits binaryDigit -- alt2 + | binaryDigit -- alt1 + + binaryDigit = "0" | "1" + + octalIntegerLiteral = + | "0o" octalDigits -- alt1 + | "0O" octalDigits -- alt2 + + octalDigits = + | octalDigits octalDigit -- alt2 + | octalDigit -- alt1 + + octalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" + + hexIntegerLiteral = + | "0x" hexDigits -- alt1 + | "0X" hexDigits -- alt2 + + hexDigits = + | hexDigits hexDigit -- alt2 + | hexDigit -- alt1 + + hexDigit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F" + + stringLiteral = + | "\"" doubleStringCharacters? "\"" -- alt1 + | "'" singleStringCharacters? "'" -- alt2 + + doubleStringCharacters = + | doubleStringCharacter+ + + singleStringCharacters = + | singleStringCharacter+ + + doubleStringCharacter = + | ~("\"" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\\" escapeSequence -- alt2 + | lineContinuation -- alt3 + + singleStringCharacter = + | ~("'" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\\" escapeSequence -- alt2 + | lineContinuation -- alt3 + + lineContinuation = + | "\\" lineTerminatorSequence -- alt1 + + escapeSequence = + | characterEscapeSequence -- alt1 + | "0" ~decimalDigit -- alt2 + | hexEscapeSequence -- alt3 + | unicodeEscapeSequence -- alt4 + + characterEscapeSequence = + | singleEscapeCharacter + | nonEscapeCharacter + + singleEscapeCharacter = "\"" | "\\" | "'" | "b" | "f" | "n" | "r" | "t" | "v" + + nonEscapeCharacter = + | ~(escapeCharacter | lineTerminator) sourceCharacter + + escapeCharacter = + | singleEscapeCharacter + | decimalDigit + | "x" + | "u" + + hexEscapeSequence = + | "x" hexDigit hexDigit -- alt1 + + unicodeEscapeSequence = + | "u" hex4Digits -- alt1 + | "u{" hexDigits "}" -- alt2 + + hex4Digits = + | hexDigit hexDigit hexDigit hexDigit -- alt1 + + regularExpressionLiteral = + | "/" regularExpressionBody "/" regularExpressionFlags -- alt1 + + regularExpressionBody = + | regularExpressionFirstChar regularExpressionChars -- alt1 + + regularExpressionChars = + | regularExpressionChars regularExpressionChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionFirstChar = + | ~("*" | "\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionChar = + | ~("\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionBackslashSequence = + | "\\" regularExpressionNonTerminator -- alt1 + + regularExpressionNonTerminator = + | ~lineTerminator sourceCharacter + + regularExpressionClass = + | "[" regularExpressionClassChars "]" -- alt1 + + regularExpressionClassChars = + | regularExpressionClassChars regularExpressionClassChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionClassChar = + | ~("]" | "\\") regularExpressionNonTerminator + | regularExpressionBackslashSequence + + regularExpressionFlags = + | regularExpressionFlags identifierPart -- alt2 + | /* empty */ -- alt1 + + template = + | noSubstitutionTemplate + | templateHead + + noSubstitutionTemplate = + | "`" templateCharacters? "`" -- alt1 + + templateHead = + | "`" templateCharacters? "${" -- alt1 + + templateSubstitutionTail = + | templateMiddle + | templateTail + + templateMiddle = + | "}" templateCharacters? "${" -- alt1 + + templateTail = + | "}" templateCharacters? "`" -- alt1 + + templateCharacters = + | templateCharacter+ + + templateCharacter = + | "$" ~"{" -- alt1 + | "\\" escapeSequence -- alt2 + | lineContinuation -- alt3 + | lineTerminatorSequence -- alt4 + | ~("`" | "\\" | "$" | lineTerminator) sourceCharacter -- alt5 + + IdentifierReference = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + BindingIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + LabelIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + Identifier = + | ~reservedWord identifierName + + PrimaryExpression = + | this -- alt1 + | IdentifierReference -- alt2 + | Literal -- alt3 + | ArrayLiteral -- alt4 + | ObjectLiteral -- alt5 + | FunctionExpression -- alt6 + | ClassExpression -- alt7 + | GeneratorExpression -- alt8 + | AsyncFunctionExpression -- alt9 + | regularExpressionLiteral -- alt10 + | TemplateLiteral -- alt11 + | CoverParenthesizedExpressionAndArrowParameterList -- alt12 + + CoverParenthesizedExpressionAndArrowParameterList = + | "(" Expression ")" -- alt1 + | "(" Expression "," ")" -- alt2 + | "(" ")" -- alt3 + | "(" "..." BindingIdentifier ")" -- alt4 + | "(" "..." BindingPattern ")" -- alt5 + | "(" Expression "," "..." BindingIdentifier ")" -- alt6 + | "(" Expression "," "..." BindingPattern ")" -- alt7 + + ParenthesizedExpression = + | "(" Expression ")" -- alt1 + + Literal = + | nullLiteral + | booleanLiteral + | numericLiteral + | stringLiteral + + ArrayLiteral = + | "[" Elision? "]" -- alt1 + | "[" ElementList "]" -- alt2 + | "[" ElementList "," Elision? "]" -- alt3 + + ElementList = + | ElementList "," Elision? AssignmentExpression -- alt3 + | ElementList "," Elision? SpreadElement -- alt4 + | Elision? AssignmentExpression -- alt1 + | Elision? SpreadElement -- alt2 + + Elision = + | Elision "," -- alt2 + | "," -- alt1 + + SpreadElement = + | "..." AssignmentExpression -- alt1 + + ObjectLiteral = + | "{" "}" -- alt1 + | "{" PropertyDefinitionList "}" -- alt2 + | "{" PropertyDefinitionList "," "}" -- alt3 + + PropertyDefinitionList = + | PropertyDefinitionList "," PropertyDefinition -- alt2 + | PropertyDefinition -- alt1 + + PropertyDefinition = + | MethodDefinition -- alt4 + | PropertyName ":" AssignmentExpression -- alt3 + | IdentifierReference -- alt1 + | CoverInitializedName -- alt2 + + PropertyName = + | LiteralPropertyName + | ComputedPropertyName + + LiteralPropertyName = + | identifierName + | stringLiteral + | numericLiteral + + ComputedPropertyName = + | "[" AssignmentExpression "]" -- alt1 + + CoverInitializedName = + | IdentifierReference Initializer -- alt1 + + Initializer = + | "=" AssignmentExpression -- alt1 + + TemplateLiteral = + | noSubstitutionTemplate -- alt1 + | templateHead Expression TemplateSpans -- alt2 + + TemplateSpans = + | templateTail -- alt1 + | TemplateMiddleList templateTail -- alt2 + + TemplateMiddleList = + | TemplateMiddleList templateMiddle Expression -- alt2 + | templateMiddle Expression -- alt1 + + MemberExpression = + | MemberExpression "[" Expression "]" -- alt2 + | MemberExpression "." identifierName -- alt3 + | MemberExpression TemplateLiteral -- alt4 + | new MemberExpression Arguments -- alt7 + | PrimaryExpression -- alt1 + | SuperProperty -- alt5 + | MetaProperty -- alt6 + + SuperProperty = + | super "[" Expression "]" -- alt1 + | super "." identifierName -- alt2 + + MetaProperty = + | NewTarget + + NewTarget = + | new "." "target" -- alt1 + + NewExpression = + | MemberExpression -- alt1 + | new NewExpression -- alt2 + + CallExpression = + | CallExpression Arguments -- alt3 + | CallExpression "[" Expression "]" -- alt4 + | CallExpression "." identifierName -- alt5 + | CallExpression TemplateLiteral -- alt6 + | CoverCallExpressionAndAsyncArrowHead -- alt1 + | SuperCall -- alt2 + + SuperCall = + | super Arguments -- alt1 + + Arguments = + | "(" ")" -- alt1 + | "(" ArgumentList ")" -- alt2 + | "(" ArgumentList "," ")" -- alt3 + + ArgumentList = + | ArgumentList "," AssignmentExpression -- alt3 + | ArgumentList "," "..." AssignmentExpression -- alt4 + | AssignmentExpression -- alt1 + | "..." AssignmentExpression -- alt2 + + LeftHandSideExpression = + | CallExpression + | NewExpression + + CallMemberExpression = + | MemberExpression Arguments -- alt1 + + UpdateExpression = + | LeftHandSideExpression -- alt1 + | LeftHandSideExpression ~lineTerminator "++" -- alt2 + | LeftHandSideExpression ~lineTerminator "--" -- alt3 + | "++" UnaryExpression -- alt4 + | "--" UnaryExpression -- alt5 + + UnaryExpression = + | delete UnaryExpression -- alt2 + | void UnaryExpression -- alt3 + | typeof UnaryExpression -- alt4 + | "+" UnaryExpression -- alt5 + | "-" UnaryExpression -- alt6 + | "~" UnaryExpression -- alt7 + | "!" UnaryExpression -- alt8 + | guardAwait AwaitExpression -- alt9 + | UpdateExpression -- alt1 + + ExponentiationExpression = + | UnaryExpression -- alt1 + | UpdateExpression "**" ExponentiationExpression -- alt2 + + MultiplicativeExpression = + | MultiplicativeExpression MultiplicativeOperator ExponentiationExpression -- alt2 + | ExponentiationExpression -- alt1 + + MultiplicativeOperator = "*" | "/" | "%" + + AdditiveExpression = + | AdditiveExpression "+" MultiplicativeExpression -- alt2 + | AdditiveExpression "-" MultiplicativeExpression -- alt3 + | MultiplicativeExpression -- alt1 + + ShiftExpression = + | ShiftExpression "<<" AdditiveExpression -- alt2 + | ShiftExpression ">>" AdditiveExpression -- alt3 + | ShiftExpression ">>>" AdditiveExpression -- alt4 + | AdditiveExpression -- alt1 + + RelationalExpression = + | RelationalExpression "<" ShiftExpression -- alt2 + | RelationalExpression ">" ShiftExpression -- alt3 + | RelationalExpression "<=" ShiftExpression -- alt4 + | RelationalExpression ">=" ShiftExpression -- alt5 + | RelationalExpression instanceof ShiftExpression -- alt6 + | RelationalExpression guardIn in ShiftExpression -- alt7 + | ShiftExpression -- alt1 + + EqualityExpression = + | EqualityExpression "==" RelationalExpression -- alt2 + | EqualityExpression "!=" RelationalExpression -- alt3 + | EqualityExpression "===" RelationalExpression -- alt4 + | EqualityExpression "!==" RelationalExpression -- alt5 + | RelationalExpression -- alt1 + + BitwiseANDExpression = + | BitwiseANDExpression "&" EqualityExpression -- alt2 + | EqualityExpression -- alt1 + + BitwiseXORExpression = + | BitwiseXORExpression "^" BitwiseANDExpression -- alt2 + | BitwiseANDExpression -- alt1 + + BitwiseORExpression = + | BitwiseORExpression "|" BitwiseXORExpression -- alt2 + | BitwiseXORExpression -- alt1 + + LogicalANDExpression = + | LogicalANDExpression "&&" BitwiseORExpression -- alt2 + | BitwiseORExpression -- alt1 + + LogicalORExpression = + | LogicalORExpression "||" LogicalANDExpression -- alt2 + | LogicalANDExpression -- alt1 + + ConditionalExpression = + | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2 + | LogicalORExpression -- alt1 + + AssignmentExpression = + | AsyncArrowFunction -- alt4 + | ArrowFunction -- alt3 + | LeftHandSideExpression "=" AssignmentExpression -- alt5 + | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6 + | ConditionalExpression -- alt1 + | guardYield YieldExpression -- alt2 + + AssignmentOperator = ">>>=" | "<<=" | ">>=" | "**=" | "*=" | "/=" | "%=" | "+=" | "-=" | "&=" | "^=" | "|=" + + AssignmentPattern = + | ObjectAssignmentPattern + | ArrayAssignmentPattern + + ObjectAssignmentPattern = + | "{" "}" -- alt1 + | "{" AssignmentPropertyList "}" -- alt2 + | "{" AssignmentPropertyList "," "}" -- alt3 + + ArrayAssignmentPattern = + | "[" Elision? AssignmentRestElement? "]" -- alt1 + | "[" AssignmentElementList "]" -- alt2 + | "[" AssignmentElementList "," Elision? AssignmentRestElement? "]" -- alt3 + + AssignmentPropertyList = + | AssignmentPropertyList "," AssignmentProperty -- alt2 + | AssignmentProperty -- alt1 + + AssignmentElementList = + | AssignmentElementList "," AssignmentElisionElement -- alt2 + | AssignmentElisionElement -- alt1 + + AssignmentElisionElement = + | Elision? AssignmentElement -- alt1 + + AssignmentProperty = + | IdentifierReference Initializer? -- alt1 + | PropertyName ":" AssignmentElement -- alt2 + + AssignmentElement = + | DestructuringAssignmentTarget Initializer? -- alt1 + + AssignmentRestElement = + | "..." DestructuringAssignmentTarget -- alt1 + + DestructuringAssignmentTarget = + | LeftHandSideExpression + + Expression = + | Expression "," AssignmentExpression -- alt2 + | AssignmentExpression -- alt1 + + Statement = + | BlockStatement -- alt1 + | VariableStatement -- alt2 + | EmptyStatement -- alt3 + | ExpressionStatement -- alt4 + | IfStatement -- alt5 + | BreakableStatement -- alt6 + | ContinueStatement -- alt7 + | BreakStatement -- alt8 + | guardReturn ReturnStatement -- alt9 + | WithStatement -- alt10 + | LabelledStatement -- alt11 + | ThrowStatement -- alt12 + | TryStatement -- alt13 + | DebuggerStatement -- alt14 + + Declaration = + | HoistableDeclaration + | ClassDeclaration + | LexicalDeclaration + + HoistableDeclaration = + | FunctionDeclaration + | GeneratorDeclaration + | AsyncFunctionDeclaration + + BreakableStatement = + | IterationStatement + | SwitchStatement + + BlockStatement = + | Block + + Block = + | "{" StatementList? "}" -- alt1 + + StatementList = + | StatementListItem+ + + StatementListItem = + | Statement + | Declaration + + LexicalDeclaration = + | LetOrConst BindingList #sc -- alt1 + + LetOrConst = + | "let" + | const + + BindingList = + | BindingList "," LexicalBinding -- alt2 + | LexicalBinding -- alt1 + + LexicalBinding = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + VariableStatement = + | var VariableDeclarationList #sc -- alt1 + + VariableDeclarationList = + | VariableDeclarationList "," VariableDeclaration -- alt2 + | VariableDeclaration -- alt1 + + VariableDeclaration = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + BindingPattern = + | ObjectBindingPattern + | ArrayBindingPattern + + ObjectBindingPattern = + | "{" "}" -- alt1 + | "{" BindingPropertyList "}" -- alt2 + | "{" BindingPropertyList "," "}" -- alt3 + + ArrayBindingPattern = + | "[" Elision? BindingRestElement? "]" -- alt1 + | "[" BindingElementList "]" -- alt2 + | "[" BindingElementList "," Elision? BindingRestElement? "]" -- alt3 + + BindingPropertyList = + | BindingPropertyList "," BindingProperty -- alt2 + | BindingProperty -- alt1 + + BindingElementList = + | BindingElementList "," BindingElisionElement -- alt2 + | BindingElisionElement -- alt1 + + BindingElisionElement = + | Elision? BindingElement -- alt1 + + BindingProperty = + | SingleNameBinding -- alt1 + | PropertyName ":" BindingElement -- alt2 + + BindingElement = + | SingleNameBinding -- alt1 + | BindingPattern Initializer? -- alt2 + + SingleNameBinding = + | BindingIdentifier Initializer? -- alt1 + + BindingRestElement = + | "..." BindingIdentifier -- alt1 + | "..." BindingPattern -- alt2 + + EmptyStatement = ";" // note: this semicolon eats newlines + + ExpressionStatement = + | ~("{" | "function" | ("async" ~lineTerminator "function") | "class" | ("let" "[")) Expression #sc -- alt1 + + IfStatement = + | if "(" Expression ")" Statement else Statement -- alt1 + | if "(" Expression ")" Statement -- alt2 + + IterationStatement = + | do Statement while "(" Expression ")" #sc -- alt1 + | while "(" Expression ")" Statement -- alt2 + | for "(" ~(("let" "[")) Expression? #sc Expression? #sc Expression? ")" Statement -- alt3 + | for "(" var VariableDeclarationList #sc Expression? #sc Expression? ")" Statement -- alt4 + | for "(" LexicalDeclaration Expression? #sc Expression? ")" Statement -- alt5 + | for "(" ~(("let" "[")) LeftHandSideExpression in Expression ")" Statement -- alt6 + | for "(" var ForBinding in Expression ")" Statement -- alt7 + | for "(" ForDeclaration in Expression ")" Statement -- alt8 + | for "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt9 + | for "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt10 + | for "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt11 + + ForDeclaration = + | LetOrConst ForBinding -- alt1 + + ForBinding = + | BindingIdentifier + | BindingPattern + + ContinueStatement = + | continue #sc -- alt1 + | continue ~lineTerminator LabelIdentifier #sc -- alt2 + + BreakStatement = + | break #sc -- alt1 + | break ~lineTerminator LabelIdentifier #sc -- alt2 + + ReturnStatement = + | return #sc -- alt1 + | return ~lineTerminator Expression #sc -- alt2 + + WithStatement = + | with "(" Expression ")" Statement -- alt1 + + SwitchStatement = + | switch "(" Expression ")" CaseBlock -- alt1 + + CaseBlock = + | "{" CaseClauses? "}" -- alt1 + | "{" CaseClauses? DefaultClause CaseClauses? "}" -- alt2 + + CaseClauses = + | CaseClauses CaseClause -- alt2 + | CaseClause -- alt1 + + CaseClause = + | case Expression ":" StatementList? -- alt1 + + DefaultClause = + | default ":" StatementList? -- alt1 + + LabelledStatement = + | LabelIdentifier ":" LabelledItem -- alt1 + + LabelledItem = + | Statement + | FunctionDeclaration + + ThrowStatement = + | throw ~lineTerminator Expression #sc -- alt1 + + TryStatement = + | try Block Catch -- alt1 + | try Block Finally -- alt2 + | try Block Catch Finally -- alt3 + + Catch = + | catch "(" CatchParameter ")" Block -- alt1 + + Finally = + | finally Block -- alt1 + + CatchParameter = + | BindingIdentifier + | BindingPattern + + DebuggerStatement = + | debugger #sc -- alt1 + + FunctionDeclaration = + | function BindingIdentifier "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + | guardDefault function "(" FormalParameters ")" "{" FunctionBody "}" -- alt2 + + FunctionExpression = + | function BindingIdentifier? "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + + UniqueFormalParameters = + | FormalParameters + + FormalParameters = + | FunctionRestParameter -- alt2 + | FormalParameterList -- alt3 + | FormalParameterList "," -- alt4 + | FormalParameterList "," FunctionRestParameter -- alt5 + | /* empty */ -- alt1 + + FormalParameterList = + | FormalParameterList "," FormalParameter -- alt2 + | FormalParameter -- alt1 + + FunctionRestParameter = + | BindingRestElement + + FormalParameter = + | BindingElement + + FunctionBody = + | FunctionStatementList + + FunctionStatementList = + | StatementList? + + ArrowFunction = + | ArrowParameters ~lineTerminator "=>" ConciseBody -- alt1 + + ArrowParameters = + | BindingIdentifier -- alt1 + | CoverParenthesizedExpressionAndArrowParameterList -- alt2 + + ConciseBody = + | ~"{" AssignmentExpression -- alt1 + | "{" FunctionBody "}" -- alt2 + + ArrowFormalParameters = + | "(" UniqueFormalParameters ")" -- alt1 + + MethodDefinition = + | PropertyName "(" UniqueFormalParameters ")" "{" FunctionBody "}" -- alt1 + | GeneratorMethod -- alt2 + | AsyncMethod -- alt3 + | "get" PropertyName "(" ")" "{" FunctionBody "}" -- alt4 + | "set" PropertyName "(" PropertySetParameterList ")" "{" FunctionBody "}" -- alt5 + + PropertySetParameterList = + | FormalParameter + + GeneratorMethod = + | "*" PropertyName "(" UniqueFormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorDeclaration = + | function "*" BindingIdentifier "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + | guardDefault function "*" "(" FormalParameters ")" "{" GeneratorBody "}" -- alt2 + + GeneratorExpression = + | function "*" BindingIdentifier? "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorBody = + | FunctionBody + + YieldExpression = + | yield -- alt1 + | yield ~lineTerminator AssignmentExpression -- alt2 + | yield ~lineTerminator "*" AssignmentExpression -- alt3 + + ClassDeclaration = + | class BindingIdentifier ClassTail -- alt1 + | guardDefault class ClassTail -- alt2 + + ClassExpression = + | class BindingIdentifier? ClassTail -- alt1 + + ClassTail = + | ClassHeritage? "{" ClassBody? "}" -- alt1 + + ClassHeritage = + | extends LeftHandSideExpression -- alt1 + + ClassBody = + | ClassElementList + + ClassElementList = + | ClassElementList ClassElement -- alt2 + | ClassElement -- alt1 + + ClassElement = + | MethodDefinition -- alt1 + | "static" MethodDefinition -- alt2 + | #sc -- alt3 + + AsyncFunctionDeclaration = + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncFunctionExpression = + | "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncMethod = + | "async" ~lineTerminator PropertyName "(" UniqueFormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + + AsyncFunctionBody = + | FunctionBody + + AwaitExpression = + | await UnaryExpression -- alt1 + + AsyncArrowFunction = + | "async" ~lineTerminator AsyncArrowBindingIdentifier ~lineTerminator "=>" AsyncConciseBody -- alt1 + | CoverCallExpressionAndAsyncArrowHead ~lineTerminator "=>" AsyncConciseBody -- alt2 + + AsyncConciseBody = + | ~"{" AssignmentExpression -- alt1 + | "{" AsyncFunctionBody "}" -- alt2 + + AsyncArrowBindingIdentifier = + | BindingIdentifier + + CoverCallExpressionAndAsyncArrowHead = + | MemberExpression Arguments -- alt1 + + AsyncArrowHead = + | "async" ~lineTerminator ArrowFormalParameters -- alt1 + + Script = + | ScriptBody? + + ScriptBody = + | StatementList + + Module = + | ModuleBody? + + ModuleBody = + | ModuleItemList + + ModuleItemList = + | ModuleItem+ + + ModuleItem = + | ImportDeclaration + | ExportDeclaration + | StatementListItem + + ImportDeclaration = + | import ImportClause FromClause #sc -- alt1 + | import ModuleSpecifier #sc -- alt2 + + ImportClause = + | ImportedDefaultBinding -- alt1 + | NameSpaceImport -- alt2 + | NamedImports -- alt3 + | ImportedDefaultBinding "," NameSpaceImport -- alt4 + | ImportedDefaultBinding "," NamedImports -- alt5 + + ImportedDefaultBinding = + | ImportedBinding + + NameSpaceImport = + | "*" "as" ImportedBinding -- alt1 + + NamedImports = + | "{" "}" -- alt1 + | "{" ImportsList "}" -- alt2 + | "{" ImportsList "," "}" -- alt3 + + FromClause = + | "from" ModuleSpecifier -- alt1 + + ImportsList = + | ImportsList "," ImportSpecifier -- alt2 + | ImportSpecifier -- alt1 + + ImportSpecifier = + | ImportedBinding -- alt1 + | identifierName "as" ImportedBinding -- alt2 + + ModuleSpecifier = + | stringLiteral + + ImportedBinding = + | BindingIdentifier + + ExportDeclaration = + | export "*" FromClause #sc -- alt1 + | export ExportClause FromClause #sc -- alt2 + | export ExportClause #sc -- alt3 + | export VariableStatement -- alt4 + | export Declaration -- alt5 + | export default HoistableDeclaration -- alt6 + | export default ClassDeclaration -- alt7 + | export default ~("function" | ("async" ~lineTerminator "function") | "class") AssignmentExpression #sc -- alt8 + + ExportClause = + | "{" "}" -- alt1 + | "{" ExportsList "}" -- alt2 + | "{" ExportsList "," "}" -- alt3 + + ExportsList = + | ExportsList "," ExportSpecifier -- alt2 + | ExportSpecifier -- alt1 + + ExportSpecifier = + | identifierName -- alt1 + | identifierName "as" identifierName -- alt2 + + stringNumericLiteral = + | strWhiteSpace? -- alt1 + | strWhiteSpace? strNumericLiteral strWhiteSpace? -- alt2 + + strWhiteSpace = + | strWhiteSpaceChar strWhiteSpace? -- alt1 + + strWhiteSpaceChar = + | whiteSpace + | lineTerminator + + strNumericLiteral = + | strDecimalLiteral + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + + strDecimalLiteral = + | strUnsignedDecimalLiteral -- alt1 + | "+" strUnsignedDecimalLiteral -- alt2 + | "-" strUnsignedDecimalLiteral -- alt3 + + strUnsignedDecimalLiteral = + | "Infinity" -- alt1 + | decimalDigits "." decimalDigits? exponentPart? -- alt2 + | "." decimalDigits exponentPart? -- alt3 + | decimalDigits exponentPart? -- alt4 + + uri = + | uriCharacters? + + uriCharacters = + | uriCharacter uriCharacters? -- alt1 + + uriCharacter = + | uriReserved + | uriUnescaped + | uriEscaped + + uriReserved = #sc | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," + + uriUnescaped = + | uriAlpha + | decimalDigit + | uriMark + + uriEscaped = + | "%" hexDigit hexDigit -- alt1 + + uriAlpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + uriMark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" + + pattern = + | disjunction + + disjunction = + | alternative -- alt1 + | alternative "|" disjunction -- alt2 + + alternative = + | alternative term -- alt2 + | /* empty */ -- alt1 + + term = + | assertion -- alt1 + | atom -- alt2 + | atom quantifier -- alt3 + + assertion = + | "^" -- alt1 + | "$" -- alt2 + | "\\" "b" -- alt3 + | "\\" "B" -- alt4 + | "(" "?" "=" disjunction ")" -- alt5 + | "(" "?" "!" disjunction ")" -- alt6 + + quantifier = + | quantifierPrefix -- alt1 + | quantifierPrefix "?" -- alt2 + + quantifierPrefix = + | "*" -- alt1 + | "+" -- alt2 + | "?" -- alt3 + | "{" decimalDigits "}" -- alt4 + | "{" decimalDigits "," "}" -- alt5 + | "{" decimalDigits "," decimalDigits "}" -- alt6 + + atom = + | patternCharacter -- alt1 + | "." -- alt2 + | "\\" atomEscape -- alt3 + | characterClass -- alt4 + | "(" disjunction ")" -- alt5 + | "(" "?" ":" disjunction ")" -- alt6 + + syntaxCharacter = "\\" | "^" | "$" | "." | "*" | "+" | "?" | "(" | ")" | "[" | "]" | "{" | "}" | "|" + + patternCharacter = + | ~syntaxCharacter sourceCharacter + + atomEscape = + | decimalEscape + | characterClassEscape + | characterEscape + + characterEscape = + | controlEscape -- alt1 + | "c" controlLetter -- alt2 + | "0" ~decimalDigit -- alt3 + | hexEscapeSequence -- alt4 + | regExpUnicodeEscapeSequence -- alt5 + | identityEscape -- alt6 + + controlEscape = "f" | "n" | "r" | "t" | "v" + + controlLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + regExpUnicodeEscapeSequence = + | guardU "u" leadSurrogate "\\u" trailSurrogate -- alt1 + | guardU "u" leadSurrogate -- alt2 + | guardU "u" trailSurrogate -- alt3 + | guardU "u" nonSurrogate -- alt4 + | guardU "u" hex4Digits -- alt5 + | guardU "u{" hexDigits "}" -- alt6 + + leadSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF */ -- alt1 + + trailSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF */ -- alt1 + + nonSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF */ -- alt1 + + identityEscape = + | guardU syntaxCharacter -- alt1 + | guardU "/" -- alt2 + | guardU ~unicodeIDContinue sourceCharacter -- alt3 + + decimalEscape = + | nonZeroDigit decimalDigits? ~decimalDigit -- alt1 + + characterClassEscape = "d" | "D" | "s" | "S" | "w" | "W" + + characterClass = + | "[" ~("^") classRanges "]" -- alt1 + | "[" "^" classRanges "]" -- alt2 + + classRanges = + | /* empty */ -- alt1 + | nonemptyClassRanges -- alt2 + + nonemptyClassRanges = + | classAtom -- alt1 + | classAtom nonemptyClassRangesNoDash -- alt2 + | classAtom "-" classAtom classRanges -- alt3 + + nonemptyClassRangesNoDash = + | classAtom -- alt1 + | classAtomNoDash nonemptyClassRangesNoDash -- alt2 + | classAtomNoDash "-" classAtom classRanges -- alt3 + + classAtom = + | "-" + | classAtomNoDash + + classAtomNoDash = + | ~("\\" | "]" | "-") sourceCharacter -- alt1 + | "\\" classEscape -- alt2 + + classEscape = + | "b" -- alt1 + | guardU "-" -- alt2 + | characterClassEscape -- alt3 + | characterEscape -- alt4 + + withYield = /* fixme */ + + noYield = ~any /* is this right? */ + + withAwait = /* fixme */ + + noAwait = ~any /* is this right? */ + + withIn = /* fixme */ + + noIn = ~any /* is this right? */ + + withReturn = /* fixme */ + + noReturn = ~any /* is this right? */ + + withDefault = /* fixme */ + + noDefault = ~any /* is this right? */ + + withU = /* fixme */ + + noU = ~any /* is this right? */ + + await = "await" ~identifierPart + break = "break" ~identifierPart + case = "case" ~identifierPart + catch = "catch" ~identifierPart + class = "class" ~identifierPart + const = "const" ~identifierPart + continue = "continue" ~identifierPart + debugger = "debugger" ~identifierPart + default = "default" ~identifierPart + delete = "delete" ~identifierPart + do = "do" ~identifierPart + else = "else" ~identifierPart + export = "export" ~identifierPart + extends = "extends" ~identifierPart + finally = "finally" ~identifierPart + for = "for" ~identifierPart + function = "function" ~identifierPart + if = "if" ~identifierPart + import = "import" ~identifierPart + in = "in" ~identifierPart + instanceof = "instanceof" ~identifierPart + new = "new" ~identifierPart + return = "return" ~identifierPart + super = "super" ~identifierPart + switch = "switch" ~identifierPart + this = "this" ~identifierPart + throw = "throw" ~identifierPart + try = "try" ~identifierPart + typeof = "typeof" ~identifierPart + var = "var" ~identifierPart + void = "void" ~identifierPart + while = "while" ~identifierPart + with = "with" ~identifierPart + yield = "yield" ~identifierPart + enum = "enum" ~identifierPart + null = "null" ~identifierPart + true = "true" ~identifierPart + false = "false" ~identifierPart +} diff --git a/examples/ecmascript/gen/es2018.grammar.ohm b/examples/ecmascript/gen/es2018.grammar.ohm new file mode 100644 index 00000000..1b27bb30 --- /dev/null +++ b/examples/ecmascript/gen/es2018.grammar.ohm @@ -0,0 +1,1430 @@ +ES2018 { + + Start = Script + + // Override Ohm's built-in definition of space. + space := whiteSpace | lineTerminator | comment + + unicodeZs = "\xA0" | "\u1680" | "\u2000".."\u200A" | "\u202F" | "\u205F" | "\u3000" + + multiLineCommentNoNL = "/*" (~("*/" | lineTerminator) sourceCharacter)* "*/" + + // does not accept lineTerminators, not even implicit ones in a multiLineComment (cf. section 7.4) + spacesNoNL = (whiteSpace | singleLineComment | multiLineCommentNoNL)* + + // A semicolon is "automatically inserted" if a newline or the end of the input stream is + // reached, or the offending token is "}". + // See https://es5.github.io/#x7.9 for more information. + // NOTE: Applications of this rule *must* appear in a lexical context -- either in the body of a + // lexical rule, or inside '#()'. + sc = space* (";" | end) + | spacesNoNL (lineTerminator | ~multiLineCommentNoNL multiLineComment | &"}") + + sourceCharacter = any + + inputElementDiv = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | rightBracePunctuator + + inputElementRegExp = + | whiteSpace + | lineTerminator + | comment + | commonToken + | rightBracePunctuator + | regularExpressionLiteral + + inputElementRegExpOrTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | regularExpressionLiteral + | templateSubstitutionTail + + inputElementTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | templateSubstitutionTail + + whiteSpace = + | "\t" + | "\x0B" + | "\x0C" + | " " + | "\xA0" + | "\uFEFF" + | unicodeZs + + lineTerminator = + | "\n" + | "\r" + | "\u2028" + | "\u2029" + + lineTerminatorSequence = + | "\n" -- alt1 + | "\r" ~"\n" -- alt2 + | "\u2028" -- alt3 + | "\u2029" -- alt4 + | "\r" "\n" -- alt5 + + comment = + | multiLineComment + | singleLineComment + + multiLineComment = + | "/*" multiLineCommentChars? "*/" -- alt1 + + multiLineCommentChars = + (~"*/" sourceCharacter)* + + postAsteriskCommentChars = + | multiLineNotForwardSlashOrAsteriskChar multiLineCommentChars? -- alt1 + | "*" ~"/" postAsteriskCommentChars? -- alt2 + + multiLineNotAsteriskChar = + | ~"*" sourceCharacter + + multiLineNotForwardSlashOrAsteriskChar = + | ~("/" | "*") sourceCharacter + + singleLineComment = + | "//" singleLineCommentChars? -- alt1 + + singleLineCommentChars = + | singleLineCommentChar+ + + singleLineCommentChar = + | ~lineTerminator sourceCharacter + + commonToken = + | identifierName + | punctuator + | numericLiteral + | stringLiteral + | template + + identifierName = + | identifierName identifierPart -- alt2 + | identifierStart -- alt1 + + identifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" unicodeEscapeSequence -- alt4 + + identifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "\\" unicodeEscapeSequence -- alt3 + | "_" -- alt4 /* FIXME */ + + unicodeIDStart = letter /* fixme */ + + unicodeIDContinue = letter | digit /* fixme */ + + reservedWord = + | keyword + | futureReservedWord + | nullLiteral + | booleanLiteral + + keyword = instanceof | continue | debugger | function | default | extends | finally | delete | export | import | return | switch | typeof | await | break | catch | class | const | super | throw | while | yield | case | else | this | void | with | for | new | try | var | do | if | in + + futureReservedWord = + | enum + + punctuator = ">>>=" | "..." | "===" | "!==" | ">>>" | "**=" | "<<=" | ">>=" | "<=" | ">=" | "==" | "!=" | "**" | "++" | "--" | "<<" | ">>" | "&&" | "||" | "+=" | "-=" | "*=" | "%=" | "&=" | "|=" | "^=" | "=>" | "{" | "(" | ")" | "[" | "]" | "." | #sc | "," | "<" | ">" | "+" | "-" | "*" | "%" | "&" | "|" | "^" | "!" | "~" | "?" | ":" | "=" + + divPunctuator = + | "/" + | "/=" + + rightBracePunctuator = + | "}" + + nullLiteral = + | null + + booleanLiteral = + | true + | false + + numericLiteral = + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + | decimalLiteral + + decimalLiteral = + | decimalIntegerLiteral "." decimalDigits? exponentPart? -- alt1 + | "." decimalDigits exponentPart? -- alt2 + | decimalIntegerLiteral exponentPart? -- alt3 + + decimalIntegerLiteral = + | "0" -- alt1 + | nonZeroDigit decimalDigits? -- alt2 + + decimalDigits = + | decimalDigits decimalDigit -- alt2 + | decimalDigit -- alt1 + + decimalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + nonZeroDigit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + exponentPart = + | exponentIndicator signedInteger -- alt1 + + exponentIndicator = "e" | "E" + + signedInteger = + | decimalDigits -- alt1 + | "+" decimalDigits -- alt2 + | "-" decimalDigits -- alt3 + + binaryIntegerLiteral = + | "0b" binaryDigits -- alt1 + | "0B" binaryDigits -- alt2 + + binaryDigits = + | binaryDigits binaryDigit -- alt2 + | binaryDigit -- alt1 + + binaryDigit = "0" | "1" + + octalIntegerLiteral = + | "0o" octalDigits -- alt1 + | "0O" octalDigits -- alt2 + + octalDigits = + | octalDigits octalDigit -- alt2 + | octalDigit -- alt1 + + octalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" + + hexIntegerLiteral = + | "0x" hexDigits -- alt1 + | "0X" hexDigits -- alt2 + + hexDigits = + | hexDigits hexDigit -- alt2 + | hexDigit -- alt1 + + hexDigit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F" + + stringLiteral = + | "\"" doubleStringCharacters? "\"" -- alt1 + | "'" singleStringCharacters? "'" -- alt2 + + doubleStringCharacters = + | doubleStringCharacter+ + + singleStringCharacters = + | singleStringCharacter+ + + doubleStringCharacter = + | ~("\"" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\\" escapeSequence -- alt2 + | lineContinuation -- alt3 + + singleStringCharacter = + | ~("'" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\\" escapeSequence -- alt2 + | lineContinuation -- alt3 + + lineContinuation = + | "\\" lineTerminatorSequence -- alt1 + + escapeSequence = + | characterEscapeSequence -- alt1 + | "0" ~decimalDigit -- alt2 + | hexEscapeSequence -- alt3 + | unicodeEscapeSequence -- alt4 + + characterEscapeSequence = + | singleEscapeCharacter + | nonEscapeCharacter + + singleEscapeCharacter = "\"" | "\\" | "'" | "b" | "f" | "n" | "r" | "t" | "v" + + nonEscapeCharacter = + | ~(escapeCharacter | lineTerminator) sourceCharacter + + escapeCharacter = + | singleEscapeCharacter + | decimalDigit + | "x" + | "u" + + hexEscapeSequence = + | "x" hexDigit hexDigit -- alt1 + + unicodeEscapeSequence = + | "u" hex4Digits -- alt1 + | "u{" codePoint "}" -- alt2 + + hex4Digits = + | hexDigit hexDigit hexDigit hexDigit -- alt1 + + regularExpressionLiteral = + | "/" regularExpressionBody "/" regularExpressionFlags -- alt1 + + regularExpressionBody = + | regularExpressionFirstChar regularExpressionChars -- alt1 + + regularExpressionChars = + | regularExpressionChars regularExpressionChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionFirstChar = + | ~("*" | "\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionChar = + | ~("\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionBackslashSequence = + | "\\" regularExpressionNonTerminator -- alt1 + + regularExpressionNonTerminator = + | ~lineTerminator sourceCharacter + + regularExpressionClass = + | "[" regularExpressionClassChars "]" -- alt1 + + regularExpressionClassChars = + | regularExpressionClassChars regularExpressionClassChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionClassChar = + | ~("]" | "\\") regularExpressionNonTerminator + | regularExpressionBackslashSequence + + regularExpressionFlags = + | regularExpressionFlags identifierPart -- alt2 + | /* empty */ -- alt1 + + template = + | noSubstitutionTemplate + | templateHead + + noSubstitutionTemplate = + | "`" templateCharacters? "`" -- alt1 + + templateHead = + | "`" templateCharacters? "${" -- alt1 + + templateSubstitutionTail = + | templateMiddle + | templateTail + + templateMiddle = + | "}" templateCharacters? "${" -- alt1 + + templateTail = + | "}" templateCharacters? "`" -- alt1 + + templateCharacters = + | templateCharacter+ + + templateCharacter = + | "$" ~"{" -- alt1 + | "\\" escapeSequence -- alt2 + | "\\" notEscapeSequence -- alt3 + | lineContinuation -- alt4 + | lineTerminatorSequence -- alt5 + | ~("`" | "\\" | "$" | lineTerminator) sourceCharacter -- alt6 + + notEscapeSequence = + | "0" decimalDigit -- alt1 + | ~"0" decimalDigit -- alt2 + | "x" ~hexDigit -- alt3 + | "x" hexDigit ~hexDigit -- alt4 + | "u" ~hexDigit ~"{" -- alt5 + | "u" hexDigit ~hexDigit -- alt6 + | "u" hexDigit hexDigit ~hexDigit -- alt7 + | "u" hexDigit hexDigit hexDigit ~hexDigit -- alt8 + | "u" "{" ~hexDigit -- alt9 + | "u" "{" notCodePoint ~hexDigit -- alt10 + | "u" "{" codePoint ~hexDigit ~"}" -- alt11 + + notCodePoint = + | hexDigits /* FIXME Assertion: > but only if MV of HexDigits > 0x10FFFF */ -- alt1 + + codePoint = + | hexDigits /* FIXME Assertion: > but only if MV of HexDigits ≤ 0x10FFFF */ -- alt1 + + IdentifierReference = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + BindingIdentifier = + | Identifier + | yield + | await + + LabelIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + Identifier = + | ~reservedWord identifierName + + PrimaryExpression = + | this -- alt1 + | IdentifierReference -- alt2 + | Literal -- alt3 + | ArrayLiteral -- alt4 + | ObjectLiteral -- alt5 + | FunctionExpression -- alt6 + | ClassExpression -- alt7 + | GeneratorExpression -- alt8 + | AsyncFunctionExpression -- alt9 + | AsyncGeneratorExpression -- alt10 + | regularExpressionLiteral -- alt11 + | TemplateLiteral -- alt12 + | CoverParenthesizedExpressionAndArrowParameterList -- alt13 + + CoverParenthesizedExpressionAndArrowParameterList = + | "(" Expression ")" -- alt1 + | "(" Expression "," ")" -- alt2 + | "(" ")" -- alt3 + | "(" "..." BindingIdentifier ")" -- alt4 + | "(" "..." BindingPattern ")" -- alt5 + | "(" Expression "," "..." BindingIdentifier ")" -- alt6 + | "(" Expression "," "..." BindingPattern ")" -- alt7 + + ParenthesizedExpression = + | "(" Expression ")" -- alt1 + + Literal = + | nullLiteral + | booleanLiteral + | numericLiteral + | stringLiteral + + ArrayLiteral = + | "[" Elision? "]" -- alt1 + | "[" ElementList "]" -- alt2 + | "[" ElementList "," Elision? "]" -- alt3 + + ElementList = + | ElementList "," Elision? AssignmentExpression -- alt3 + | ElementList "," Elision? SpreadElement -- alt4 + | Elision? AssignmentExpression -- alt1 + | Elision? SpreadElement -- alt2 + + Elision = + | Elision "," -- alt2 + | "," -- alt1 + + SpreadElement = + | "..." AssignmentExpression -- alt1 + + ObjectLiteral = + | "{" "}" -- alt1 + | "{" PropertyDefinitionList "}" -- alt2 + | "{" PropertyDefinitionList "," "}" -- alt3 + + PropertyDefinitionList = + | PropertyDefinitionList "," PropertyDefinition -- alt2 + | PropertyDefinition -- alt1 + + PropertyDefinition = + | MethodDefinition -- alt4 + | PropertyName ":" AssignmentExpression -- alt3 + | IdentifierReference -- alt1 + | CoverInitializedName -- alt2 + | "..." AssignmentExpression -- alt5 + + PropertyName = + | LiteralPropertyName + | ComputedPropertyName + + LiteralPropertyName = + | identifierName + | stringLiteral + | numericLiteral + + ComputedPropertyName = + | "[" AssignmentExpression "]" -- alt1 + + CoverInitializedName = + | IdentifierReference Initializer -- alt1 + + Initializer = + | "=" AssignmentExpression -- alt1 + + TemplateLiteral = + | noSubstitutionTemplate + | SubstitutionTemplate + + SubstitutionTemplate = + | templateHead Expression TemplateSpans -- alt1 + + TemplateSpans = + | templateTail -- alt1 + | TemplateMiddleList templateTail -- alt2 + + TemplateMiddleList = + | TemplateMiddleList templateMiddle Expression -- alt2 + | templateMiddle Expression -- alt1 + + MemberExpression = + | MemberExpression "[" Expression "]" -- alt2 + | MemberExpression "." identifierName -- alt3 + | MemberExpression TemplateLiteral -- alt4 + | new MemberExpression Arguments -- alt7 + | PrimaryExpression -- alt1 + | SuperProperty -- alt5 + | MetaProperty -- alt6 + + SuperProperty = + | super "[" Expression "]" -- alt1 + | super "." identifierName -- alt2 + + MetaProperty = + | NewTarget + + NewTarget = + | new "." "target" -- alt1 + + NewExpression = + | MemberExpression -- alt1 + | new NewExpression -- alt2 + + CallExpression = + | CallExpression Arguments -- alt3 + | CallExpression "[" Expression "]" -- alt4 + | CallExpression "." identifierName -- alt5 + | CallExpression TemplateLiteral -- alt6 + | CoverCallExpressionAndAsyncArrowHead -- alt1 + | SuperCall -- alt2 + + SuperCall = + | super Arguments -- alt1 + + Arguments = + | "(" ")" -- alt1 + | "(" ArgumentList ")" -- alt2 + | "(" ArgumentList "," ")" -- alt3 + + ArgumentList = + | ArgumentList "," AssignmentExpression -- alt3 + | ArgumentList "," "..." AssignmentExpression -- alt4 + | AssignmentExpression -- alt1 + | "..." AssignmentExpression -- alt2 + + LeftHandSideExpression = + | CallExpression + | NewExpression + + CallMemberExpression = + | MemberExpression Arguments -- alt1 + + UpdateExpression = + | LeftHandSideExpression -- alt1 + | LeftHandSideExpression ~lineTerminator "++" -- alt2 + | LeftHandSideExpression ~lineTerminator "--" -- alt3 + | "++" UnaryExpression -- alt4 + | "--" UnaryExpression -- alt5 + + UnaryExpression = + | delete UnaryExpression -- alt2 + | void UnaryExpression -- alt3 + | typeof UnaryExpression -- alt4 + | "+" UnaryExpression -- alt5 + | "-" UnaryExpression -- alt6 + | "~" UnaryExpression -- alt7 + | "!" UnaryExpression -- alt8 + | guardAwait AwaitExpression -- alt9 + | UpdateExpression -- alt1 + + ExponentiationExpression = + | UnaryExpression -- alt1 + | UpdateExpression "**" ExponentiationExpression -- alt2 + + MultiplicativeExpression = + | MultiplicativeExpression MultiplicativeOperator ExponentiationExpression -- alt2 + | ExponentiationExpression -- alt1 + + MultiplicativeOperator = "*" | "/" | "%" + + AdditiveExpression = + | AdditiveExpression "+" MultiplicativeExpression -- alt2 + | AdditiveExpression "-" MultiplicativeExpression -- alt3 + | MultiplicativeExpression -- alt1 + + ShiftExpression = + | ShiftExpression "<<" AdditiveExpression -- alt2 + | ShiftExpression ">>" AdditiveExpression -- alt3 + | ShiftExpression ">>>" AdditiveExpression -- alt4 + | AdditiveExpression -- alt1 + + RelationalExpression = + | RelationalExpression "<" ShiftExpression -- alt2 + | RelationalExpression ">" ShiftExpression -- alt3 + | RelationalExpression "<=" ShiftExpression -- alt4 + | RelationalExpression ">=" ShiftExpression -- alt5 + | RelationalExpression instanceof ShiftExpression -- alt6 + | RelationalExpression guardIn in ShiftExpression -- alt7 + | ShiftExpression -- alt1 + + EqualityExpression = + | EqualityExpression "==" RelationalExpression -- alt2 + | EqualityExpression "!=" RelationalExpression -- alt3 + | EqualityExpression "===" RelationalExpression -- alt4 + | EqualityExpression "!==" RelationalExpression -- alt5 + | RelationalExpression -- alt1 + + BitwiseANDExpression = + | BitwiseANDExpression "&" EqualityExpression -- alt2 + | EqualityExpression -- alt1 + + BitwiseXORExpression = + | BitwiseXORExpression "^" BitwiseANDExpression -- alt2 + | BitwiseANDExpression -- alt1 + + BitwiseORExpression = + | BitwiseORExpression "|" BitwiseXORExpression -- alt2 + | BitwiseXORExpression -- alt1 + + LogicalANDExpression = + | LogicalANDExpression "&&" BitwiseORExpression -- alt2 + | BitwiseORExpression -- alt1 + + LogicalORExpression = + | LogicalORExpression "||" LogicalANDExpression -- alt2 + | LogicalANDExpression -- alt1 + + ConditionalExpression = + | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2 + | LogicalORExpression -- alt1 + + AssignmentExpression = + | AsyncArrowFunction -- alt4 + | ArrowFunction -- alt3 + | LeftHandSideExpression "=" AssignmentExpression -- alt5 + | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6 + | ConditionalExpression -- alt1 + | guardYield YieldExpression -- alt2 + + AssignmentOperator = ">>>=" | "<<=" | ">>=" | "**=" | "*=" | "/=" | "%=" | "+=" | "-=" | "&=" | "^=" | "|=" + + AssignmentPattern = + | ObjectAssignmentPattern + | ArrayAssignmentPattern + + ObjectAssignmentPattern = + | "{" "}" -- alt1 + | "{" AssignmentRestProperty "}" -- alt2 + | "{" AssignmentPropertyList "}" -- alt3 + | "{" AssignmentPropertyList "," AssignmentRestProperty? "}" -- alt4 + + ArrayAssignmentPattern = + | "[" Elision? AssignmentRestElement? "]" -- alt1 + | "[" AssignmentElementList "]" -- alt2 + | "[" AssignmentElementList "," Elision? AssignmentRestElement? "]" -- alt3 + + AssignmentRestProperty = + | "..." DestructuringAssignmentTarget -- alt1 + + AssignmentPropertyList = + | AssignmentPropertyList "," AssignmentProperty -- alt2 + | AssignmentProperty -- alt1 + + AssignmentElementList = + | AssignmentElementList "," AssignmentElisionElement -- alt2 + | AssignmentElisionElement -- alt1 + + AssignmentElisionElement = + | Elision? AssignmentElement -- alt1 + + AssignmentProperty = + | IdentifierReference Initializer? -- alt1 + | PropertyName ":" AssignmentElement -- alt2 + + AssignmentElement = + | DestructuringAssignmentTarget Initializer? -- alt1 + + AssignmentRestElement = + | "..." DestructuringAssignmentTarget -- alt1 + + DestructuringAssignmentTarget = + | LeftHandSideExpression + + Expression = + | Expression "," AssignmentExpression -- alt2 + | AssignmentExpression -- alt1 + + Statement = + | BlockStatement -- alt1 + | VariableStatement -- alt2 + | EmptyStatement -- alt3 + | ExpressionStatement -- alt4 + | IfStatement -- alt5 + | BreakableStatement -- alt6 + | ContinueStatement -- alt7 + | BreakStatement -- alt8 + | guardReturn ReturnStatement -- alt9 + | WithStatement -- alt10 + | LabelledStatement -- alt11 + | ThrowStatement -- alt12 + | TryStatement -- alt13 + | DebuggerStatement -- alt14 + + Declaration = + | HoistableDeclaration + | ClassDeclaration + | LexicalDeclaration + + HoistableDeclaration = + | FunctionDeclaration + | GeneratorDeclaration + | AsyncFunctionDeclaration + | AsyncGeneratorDeclaration + + BreakableStatement = + | IterationStatement + | SwitchStatement + + BlockStatement = + | Block + + Block = + | "{" StatementList? "}" -- alt1 + + StatementList = + | StatementListItem+ + + StatementListItem = + | Statement + | Declaration + + LexicalDeclaration = + | LetOrConst BindingList #sc -- alt1 + + LetOrConst = + | "let" + | const + + BindingList = + | BindingList "," LexicalBinding -- alt2 + | LexicalBinding -- alt1 + + LexicalBinding = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + VariableStatement = + | var VariableDeclarationList #sc -- alt1 + + VariableDeclarationList = + | VariableDeclarationList "," VariableDeclaration -- alt2 + | VariableDeclaration -- alt1 + + VariableDeclaration = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + BindingPattern = + | ObjectBindingPattern + | ArrayBindingPattern + + ObjectBindingPattern = + | "{" "}" -- alt1 + | "{" BindingRestProperty "}" -- alt2 + | "{" BindingPropertyList "}" -- alt3 + | "{" BindingPropertyList "," BindingRestProperty? "}" -- alt4 + + ArrayBindingPattern = + | "[" Elision? BindingRestElement? "]" -- alt1 + | "[" BindingElementList "]" -- alt2 + | "[" BindingElementList "," Elision? BindingRestElement? "]" -- alt3 + + BindingRestProperty = + | "..." BindingIdentifier -- alt1 + + BindingPropertyList = + | BindingPropertyList "," BindingProperty -- alt2 + | BindingProperty -- alt1 + + BindingElementList = + | BindingElementList "," BindingElisionElement -- alt2 + | BindingElisionElement -- alt1 + + BindingElisionElement = + | Elision? BindingElement -- alt1 + + BindingProperty = + | SingleNameBinding -- alt1 + | PropertyName ":" BindingElement -- alt2 + + BindingElement = + | SingleNameBinding -- alt1 + | BindingPattern Initializer? -- alt2 + + SingleNameBinding = + | BindingIdentifier Initializer? -- alt1 + + BindingRestElement = + | "..." BindingIdentifier -- alt1 + | "..." BindingPattern -- alt2 + + EmptyStatement = ";" // note: this semicolon eats newlines + + ExpressionStatement = + | ~("{" | "function" | ("async" ~lineTerminator "function") | "class" | ("let" "[")) Expression #sc -- alt1 + + IfStatement = + | if "(" Expression ")" Statement else Statement -- alt1 + | if "(" Expression ")" Statement -- alt2 + + IterationStatement = + | do Statement while "(" Expression ")" #sc -- alt1 + | while "(" Expression ")" Statement -- alt2 + | for "(" ~(("let" "[")) Expression? #sc Expression? #sc Expression? ")" Statement -- alt3 + | for "(" var VariableDeclarationList #sc Expression? #sc Expression? ")" Statement -- alt4 + | for "(" LexicalDeclaration Expression? #sc Expression? ")" Statement -- alt5 + | for "(" ~(("let" "[")) LeftHandSideExpression in Expression ")" Statement -- alt6 + | for "(" var ForBinding in Expression ")" Statement -- alt7 + | for "(" ForDeclaration in Expression ")" Statement -- alt8 + | for "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt9 + | for "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt10 + | for "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt11 + | guardAwait for await "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt12 + | guardAwait for await "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt13 + | guardAwait for await "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt14 + + ForDeclaration = + | LetOrConst ForBinding -- alt1 + + ForBinding = + | BindingIdentifier + | BindingPattern + + ContinueStatement = + | continue #sc -- alt1 + | continue ~lineTerminator LabelIdentifier #sc -- alt2 + + BreakStatement = + | break #sc -- alt1 + | break ~lineTerminator LabelIdentifier #sc -- alt2 + + ReturnStatement = + | return #sc -- alt1 + | return ~lineTerminator Expression #sc -- alt2 + + WithStatement = + | with "(" Expression ")" Statement -- alt1 + + SwitchStatement = + | switch "(" Expression ")" CaseBlock -- alt1 + + CaseBlock = + | "{" CaseClauses? "}" -- alt1 + | "{" CaseClauses? DefaultClause CaseClauses? "}" -- alt2 + + CaseClauses = + | CaseClauses CaseClause -- alt2 + | CaseClause -- alt1 + + CaseClause = + | case Expression ":" StatementList? -- alt1 + + DefaultClause = + | default ":" StatementList? -- alt1 + + LabelledStatement = + | LabelIdentifier ":" LabelledItem -- alt1 + + LabelledItem = + | Statement + | FunctionDeclaration + + ThrowStatement = + | throw ~lineTerminator Expression #sc -- alt1 + + TryStatement = + | try Block Catch -- alt1 + | try Block Finally -- alt2 + | try Block Catch Finally -- alt3 + + Catch = + | catch "(" CatchParameter ")" Block -- alt1 + + Finally = + | finally Block -- alt1 + + CatchParameter = + | BindingIdentifier + | BindingPattern + + DebuggerStatement = + | debugger #sc -- alt1 + + FunctionDeclaration = + | function BindingIdentifier "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + | guardDefault function "(" FormalParameters ")" "{" FunctionBody "}" -- alt2 + + FunctionExpression = + | function BindingIdentifier? "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + + UniqueFormalParameters = + | FormalParameters + + FormalParameters = + | FunctionRestParameter -- alt2 + | FormalParameterList -- alt3 + | FormalParameterList "," -- alt4 + | FormalParameterList "," FunctionRestParameter -- alt5 + | /* empty */ -- alt1 + + FormalParameterList = + | FormalParameterList "," FormalParameter -- alt2 + | FormalParameter -- alt1 + + FunctionRestParameter = + | BindingRestElement + + FormalParameter = + | BindingElement + + FunctionBody = + | FunctionStatementList + + FunctionStatementList = + | StatementList? + + ArrowFunction = + | ArrowParameters ~lineTerminator "=>" ConciseBody -- alt1 + + ArrowParameters = + | BindingIdentifier -- alt1 + | CoverParenthesizedExpressionAndArrowParameterList -- alt2 + + ConciseBody = + | ~"{" AssignmentExpression -- alt1 + | "{" FunctionBody "}" -- alt2 + + ArrowFormalParameters = + | "(" UniqueFormalParameters ")" -- alt1 + + MethodDefinition = + | PropertyName "(" UniqueFormalParameters ")" "{" FunctionBody "}" -- alt1 + | GeneratorMethod -- alt2 + | AsyncMethod -- alt3 + | AsyncGeneratorMethod -- alt4 + | "get" PropertyName "(" ")" "{" FunctionBody "}" -- alt5 + | "set" PropertyName "(" PropertySetParameterList ")" "{" FunctionBody "}" -- alt6 + + PropertySetParameterList = + | FormalParameter + + GeneratorMethod = + | "*" PropertyName "(" UniqueFormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorDeclaration = + | function "*" BindingIdentifier "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + | guardDefault function "*" "(" FormalParameters ")" "{" GeneratorBody "}" -- alt2 + + GeneratorExpression = + | function "*" BindingIdentifier? "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorBody = + | FunctionBody + + YieldExpression = + | yield -- alt1 + | yield ~lineTerminator AssignmentExpression -- alt2 + | yield ~lineTerminator "*" AssignmentExpression -- alt3 + + AsyncGeneratorMethod = + | "async" ~lineTerminator "*" PropertyName "(" UniqueFormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorDeclaration = + | "async" ~lineTerminator function "*" BindingIdentifier "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "*" "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt2 + + AsyncGeneratorExpression = + | "async" ~lineTerminator function "*" BindingIdentifier? "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorBody = + | FunctionBody + + ClassDeclaration = + | class BindingIdentifier ClassTail -- alt1 + | guardDefault class ClassTail -- alt2 + + ClassExpression = + | class BindingIdentifier? ClassTail -- alt1 + + ClassTail = + | ClassHeritage? "{" ClassBody? "}" -- alt1 + + ClassHeritage = + | extends LeftHandSideExpression -- alt1 + + ClassBody = + | ClassElementList + + ClassElementList = + | ClassElementList ClassElement -- alt2 + | ClassElement -- alt1 + + ClassElement = + | MethodDefinition -- alt1 + | "static" MethodDefinition -- alt2 + | #sc -- alt3 + + AsyncFunctionDeclaration = + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncFunctionExpression = + | "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncMethod = + | "async" ~lineTerminator PropertyName "(" UniqueFormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + + AsyncFunctionBody = + | FunctionBody + + AwaitExpression = + | await UnaryExpression -- alt1 + + AsyncArrowFunction = + | "async" ~lineTerminator AsyncArrowBindingIdentifier ~lineTerminator "=>" AsyncConciseBody -- alt1 + | CoverCallExpressionAndAsyncArrowHead ~lineTerminator "=>" AsyncConciseBody -- alt2 + + AsyncConciseBody = + | ~"{" AssignmentExpression -- alt1 + | "{" AsyncFunctionBody "}" -- alt2 + + AsyncArrowBindingIdentifier = + | BindingIdentifier + + CoverCallExpressionAndAsyncArrowHead = + | MemberExpression Arguments -- alt1 + + AsyncArrowHead = + | "async" ~lineTerminator ArrowFormalParameters -- alt1 + + Script = + | ScriptBody? + + ScriptBody = + | StatementList + + Module = + | ModuleBody? + + ModuleBody = + | ModuleItemList + + ModuleItemList = + | ModuleItem+ + + ModuleItem = + | ImportDeclaration + | ExportDeclaration + | StatementListItem + + ImportDeclaration = + | import ImportClause FromClause #sc -- alt1 + | import ModuleSpecifier #sc -- alt2 + + ImportClause = + | ImportedDefaultBinding -- alt1 + | NameSpaceImport -- alt2 + | NamedImports -- alt3 + | ImportedDefaultBinding "," NameSpaceImport -- alt4 + | ImportedDefaultBinding "," NamedImports -- alt5 + + ImportedDefaultBinding = + | ImportedBinding + + NameSpaceImport = + | "*" "as" ImportedBinding -- alt1 + + NamedImports = + | "{" "}" -- alt1 + | "{" ImportsList "}" -- alt2 + | "{" ImportsList "," "}" -- alt3 + + FromClause = + | "from" ModuleSpecifier -- alt1 + + ImportsList = + | ImportsList "," ImportSpecifier -- alt2 + | ImportSpecifier -- alt1 + + ImportSpecifier = + | ImportedBinding -- alt1 + | identifierName "as" ImportedBinding -- alt2 + + ModuleSpecifier = + | stringLiteral + + ImportedBinding = + | BindingIdentifier + + ExportDeclaration = + | export "*" FromClause #sc -- alt1 + | export ExportClause FromClause #sc -- alt2 + | export ExportClause #sc -- alt3 + | export VariableStatement -- alt4 + | export Declaration -- alt5 + | export default HoistableDeclaration -- alt6 + | export default ClassDeclaration -- alt7 + | export default ~("function" | ("async" ~lineTerminator "function") | "class") AssignmentExpression #sc -- alt8 + + ExportClause = + | "{" "}" -- alt1 + | "{" ExportsList "}" -- alt2 + | "{" ExportsList "," "}" -- alt3 + + ExportsList = + | ExportsList "," ExportSpecifier -- alt2 + | ExportSpecifier -- alt1 + + ExportSpecifier = + | identifierName -- alt1 + | identifierName "as" identifierName -- alt2 + + stringNumericLiteral = + | strWhiteSpace? -- alt1 + | strWhiteSpace? strNumericLiteral strWhiteSpace? -- alt2 + + strWhiteSpace = + | strWhiteSpaceChar strWhiteSpace? -- alt1 + + strWhiteSpaceChar = + | whiteSpace + | lineTerminator + + strNumericLiteral = + | strDecimalLiteral + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + + strDecimalLiteral = + | strUnsignedDecimalLiteral -- alt1 + | "+" strUnsignedDecimalLiteral -- alt2 + | "-" strUnsignedDecimalLiteral -- alt3 + + strUnsignedDecimalLiteral = + | "Infinity" -- alt1 + | decimalDigits "." decimalDigits? exponentPart? -- alt2 + | "." decimalDigits exponentPart? -- alt3 + | decimalDigits exponentPart? -- alt4 + + uri = + | uriCharacters? + + uriCharacters = + | uriCharacter uriCharacters? -- alt1 + + uriCharacter = + | uriReserved + | uriUnescaped + | uriEscaped + + uriReserved = #sc | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," + + uriUnescaped = + | uriAlpha + | decimalDigit + | uriMark + + uriEscaped = + | "%" hexDigit hexDigit -- alt1 + + uriAlpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + uriMark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" + + pattern = + | disjunction + + disjunction = + | alternative -- alt1 + | alternative "|" disjunction -- alt2 + + alternative = + | alternative term -- alt2 + | /* empty */ -- alt1 + + term = + | assertion -- alt1 + | atom -- alt2 + | atom quantifier -- alt3 + + assertion = + | "^" -- alt1 + | "$" -- alt2 + | "\\" "b" -- alt3 + | "\\" "B" -- alt4 + | "(" "?" "=" disjunction ")" -- alt5 + | "(" "?" "!" disjunction ")" -- alt6 + | "(" "?" "<=" disjunction ")" -- alt7 + | "(" "?" " ")" -- alt8 + + quantifier = + | quantifierPrefix -- alt1 + | quantifierPrefix "?" -- alt2 + + quantifierPrefix = + | "*" -- alt1 + | "+" -- alt2 + | "?" -- alt3 + | "{" decimalDigits "}" -- alt4 + | "{" decimalDigits "," "}" -- alt5 + | "{" decimalDigits "," decimalDigits "}" -- alt6 + + atom = + | patternCharacter -- alt1 + | "." -- alt2 + | "\\" atomEscape -- alt3 + | characterClass -- alt4 + | "(" groupSpecifier disjunction ")" -- alt5 + | "(" "?" ":" disjunction ")" -- alt6 + + syntaxCharacter = "\\" | "^" | "$" | "." | "*" | "+" | "?" | "(" | ")" | "[" | "]" | "{" | "}" | "|" + + patternCharacter = + | ~syntaxCharacter sourceCharacter + + atomEscape = + | decimalEscape -- alt1 + | characterClassEscape -- alt2 + | characterEscape -- alt3 + | guardN "k" groupName -- alt4 + + characterEscape = + | controlEscape -- alt1 + | "c" controlLetter -- alt2 + | "0" ~decimalDigit -- alt3 + | hexEscapeSequence -- alt4 + | regExpUnicodeEscapeSequence -- alt5 + | identityEscape -- alt6 + + controlEscape = "f" | "n" | "r" | "t" | "v" + + controlLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + groupSpecifier = + | /* empty */ -- alt1 + | "?" groupName -- alt2 + + groupName = + | "<" regExpIdentifierName ">" -- alt1 + + regExpIdentifierName = + | regExpIdentifierName regExpIdentifierPart -- alt2 + | regExpIdentifierStart -- alt1 + + regExpIdentifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" regExpUnicodeEscapeSequence -- alt4 + + regExpIdentifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "\\" regExpUnicodeEscapeSequence -- alt3 + | "" /* FIXME */ -- alt4 + | "" /* FIXME */ -- alt5 + + regExpUnicodeEscapeSequence = + | guardU "u" leadSurrogate "\\u" trailSurrogate -- alt1 + | guardU "u" leadSurrogate -- alt2 + | guardU "u" trailSurrogate -- alt3 + | guardU "u" nonSurrogate -- alt4 + | guardU "u" hex4Digits -- alt5 + | guardU "u{" codePoint "}" -- alt6 + + leadSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF */ -- alt1 + + trailSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF */ -- alt1 + + nonSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF */ -- alt1 + + identityEscape = + | guardU syntaxCharacter -- alt1 + | guardU "/" -- alt2 + | guardU ~unicodeIDContinue sourceCharacter -- alt3 + + decimalEscape = + | nonZeroDigit decimalDigits? ~decimalDigit -- alt1 + + characterClassEscape = + | "d" -- alt1 + | "D" -- alt2 + | "s" -- alt3 + | "S" -- alt4 + | "w" -- alt5 + | "W" -- alt6 + | guardU "p{" unicodePropertyValueExpression "}" -- alt7 + | guardU "P{" unicodePropertyValueExpression "}" -- alt8 + + unicodePropertyValueExpression = + | unicodePropertyName "=" unicodePropertyValue -- alt1 + | loneUnicodePropertyNameOrValue -- alt2 + + unicodePropertyName = + | unicodePropertyNameCharacters + + unicodePropertyNameCharacters = + | unicodePropertyNameCharacter unicodePropertyNameCharacters? -- alt1 + + unicodePropertyValue = + | unicodePropertyValueCharacters + + loneUnicodePropertyNameOrValue = + | unicodePropertyValueCharacters + + unicodePropertyValueCharacters = + | unicodePropertyValueCharacter unicodePropertyValueCharacters? -- alt1 + + unicodePropertyValueCharacter = + | unicodePropertyNameCharacter + | "0" + | "1" + | "2" + | "3" + | "4" + | "5" + | "6" + | "7" + | "8" + | "9" + + unicodePropertyNameCharacter = + | controlLetter + | "_" + + characterClass = + | "[" ~("^") classRanges "]" -- alt1 + | "[" "^" classRanges "]" -- alt2 + + classRanges = + | /* empty */ -- alt1 + | nonemptyClassRanges -- alt2 + + nonemptyClassRanges = + | classAtom -- alt1 + | classAtom nonemptyClassRangesNoDash -- alt2 + | classAtom "-" classAtom classRanges -- alt3 + + nonemptyClassRangesNoDash = + | classAtom -- alt1 + | classAtomNoDash nonemptyClassRangesNoDash -- alt2 + | classAtomNoDash "-" classAtom classRanges -- alt3 + + classAtom = + | "-" + | classAtomNoDash + + classAtomNoDash = + | ~("\\" | "]" | "-") sourceCharacter -- alt1 + | "\\" classEscape -- alt2 + + classEscape = + | "b" -- alt1 + | guardU "-" -- alt2 + | characterClassEscape -- alt3 + | characterEscape -- alt4 + + withYield = /* fixme */ + + noYield = ~any /* is this right? */ + + withAwait = /* fixme */ + + noAwait = ~any /* is this right? */ + + withIn = /* fixme */ + + noIn = ~any /* is this right? */ + + withTagged = /* fixme */ + + noTagged = ~any /* is this right? */ + + withReturn = /* fixme */ + + noReturn = ~any /* is this right? */ + + withDefault = /* fixme */ + + noDefault = ~any /* is this right? */ + + withU = /* fixme */ + + noU = ~any /* is this right? */ + + withN = /* fixme */ + + noN = ~any /* is this right? */ + + await = "await" ~identifierPart + break = "break" ~identifierPart + case = "case" ~identifierPart + catch = "catch" ~identifierPart + class = "class" ~identifierPart + const = "const" ~identifierPart + continue = "continue" ~identifierPart + debugger = "debugger" ~identifierPart + default = "default" ~identifierPart + delete = "delete" ~identifierPart + do = "do" ~identifierPart + else = "else" ~identifierPart + export = "export" ~identifierPart + extends = "extends" ~identifierPart + finally = "finally" ~identifierPart + for = "for" ~identifierPart + function = "function" ~identifierPart + if = "if" ~identifierPart + import = "import" ~identifierPart + in = "in" ~identifierPart + instanceof = "instanceof" ~identifierPart + new = "new" ~identifierPart + return = "return" ~identifierPart + super = "super" ~identifierPart + switch = "switch" ~identifierPart + this = "this" ~identifierPart + throw = "throw" ~identifierPart + try = "try" ~identifierPart + typeof = "typeof" ~identifierPart + var = "var" ~identifierPart + void = "void" ~identifierPart + while = "while" ~identifierPart + with = "with" ~identifierPart + yield = "yield" ~identifierPart + enum = "enum" ~identifierPart + null = "null" ~identifierPart + true = "true" ~identifierPart + false = "false" ~identifierPart +} diff --git a/examples/ecmascript/gen/es2019.grammar.ohm b/examples/ecmascript/gen/es2019.grammar.ohm new file mode 100644 index 00000000..0c447dd7 --- /dev/null +++ b/examples/ecmascript/gen/es2019.grammar.ohm @@ -0,0 +1,1438 @@ +ES2019 { + + Start = Script + + // Override Ohm's built-in definition of space. + space := whiteSpace | lineTerminator | comment + + unicodeZs = "\xA0" | "\u1680" | "\u2000".."\u200A" | "\u202F" | "\u205F" | "\u3000" + + multiLineCommentNoNL = "/*" (~("*/" | lineTerminator) sourceCharacter)* "*/" + + // does not accept lineTerminators, not even implicit ones in a multiLineComment (cf. section 7.4) + spacesNoNL = (whiteSpace | singleLineComment | multiLineCommentNoNL)* + + // A semicolon is "automatically inserted" if a newline or the end of the input stream is + // reached, or the offending token is "}". + // See https://es5.github.io/#x7.9 for more information. + // NOTE: Applications of this rule *must* appear in a lexical context -- either in the body of a + // lexical rule, or inside '#()'. + sc = space* (";" | end) + | spacesNoNL (lineTerminator | ~multiLineCommentNoNL multiLineComment | &"}") + + sourceCharacter = any + + inputElementDiv = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | rightBracePunctuator + + inputElementRegExp = + | whiteSpace + | lineTerminator + | comment + | commonToken + | rightBracePunctuator + | regularExpressionLiteral + + inputElementRegExpOrTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | regularExpressionLiteral + | templateSubstitutionTail + + inputElementTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | templateSubstitutionTail + + whiteSpace = + | "\t" + | "\x0B" + | "\x0C" + | " " + | "\xA0" + | "\uFEFF" + | unicodeZs + + lineTerminator = + | "\n" + | "\r" + | "\u2028" + | "\u2029" + + lineTerminatorSequence = + | "\n" -- alt1 + | "\r" ~"\n" -- alt2 + | "\u2028" -- alt3 + | "\u2029" -- alt4 + | "\r" "\n" -- alt5 + + comment = + | multiLineComment + | singleLineComment + + multiLineComment = + | "/*" multiLineCommentChars? "*/" -- alt1 + + multiLineCommentChars = + (~"*/" sourceCharacter)* + + postAsteriskCommentChars = + | multiLineNotForwardSlashOrAsteriskChar multiLineCommentChars? -- alt1 + | "*" ~"/" postAsteriskCommentChars? -- alt2 + + multiLineNotAsteriskChar = + | ~"*" sourceCharacter + + multiLineNotForwardSlashOrAsteriskChar = + | ~("/" | "*") sourceCharacter + + singleLineComment = + | "//" singleLineCommentChars? -- alt1 + + singleLineCommentChars = + | singleLineCommentChar+ + + singleLineCommentChar = + | ~lineTerminator sourceCharacter + + commonToken = + | identifierName + | punctuator + | numericLiteral + | stringLiteral + | template + + identifierName = + | identifierName identifierPart -- alt2 + | identifierStart -- alt1 + + identifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" unicodeEscapeSequence -- alt4 + + identifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "\\" unicodeEscapeSequence -- alt3 + | "_" -- alt4 /* FIXME */ + + unicodeIDStart = letter /* fixme */ + + unicodeIDContinue = letter | digit /* fixme */ + + reservedWord = + | keyword + | futureReservedWord + | nullLiteral + | booleanLiteral + + keyword = instanceof | continue | debugger | function | default | extends | finally | delete | export | import | return | switch | typeof | await | break | catch | class | const | super | throw | while | yield | case | else | this | void | with | for | new | try | var | do | if | in + + futureReservedWord = + | enum + + punctuator = ">>>=" | "..." | "===" | "!==" | ">>>" | "**=" | "<<=" | ">>=" | "<=" | ">=" | "==" | "!=" | "**" | "++" | "--" | "<<" | ">>" | "&&" | "||" | "+=" | "-=" | "*=" | "%=" | "&=" | "|=" | "^=" | "=>" | "{" | "(" | ")" | "[" | "]" | "." | #sc | "," | "<" | ">" | "+" | "-" | "*" | "%" | "&" | "|" | "^" | "!" | "~" | "?" | ":" | "=" + + divPunctuator = + | "/" + | "/=" + + rightBracePunctuator = + | "}" + + nullLiteral = + | null + + booleanLiteral = + | true + | false + + numericLiteral = + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + | decimalLiteral + + decimalLiteral = + | decimalIntegerLiteral "." decimalDigits? exponentPart? -- alt1 + | "." decimalDigits exponentPart? -- alt2 + | decimalIntegerLiteral exponentPart? -- alt3 + + decimalIntegerLiteral = + | "0" -- alt1 + | nonZeroDigit decimalDigits? -- alt2 + + decimalDigits = + | decimalDigits decimalDigit -- alt2 + | decimalDigit -- alt1 + + decimalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + nonZeroDigit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + exponentPart = + | exponentIndicator signedInteger -- alt1 + + exponentIndicator = "e" | "E" + + signedInteger = + | decimalDigits -- alt1 + | "+" decimalDigits -- alt2 + | "-" decimalDigits -- alt3 + + binaryIntegerLiteral = + | "0b" binaryDigits -- alt1 + | "0B" binaryDigits -- alt2 + + binaryDigits = + | binaryDigits binaryDigit -- alt2 + | binaryDigit -- alt1 + + binaryDigit = "0" | "1" + + octalIntegerLiteral = + | "0o" octalDigits -- alt1 + | "0O" octalDigits -- alt2 + + octalDigits = + | octalDigits octalDigit -- alt2 + | octalDigit -- alt1 + + octalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" + + hexIntegerLiteral = + | "0x" hexDigits -- alt1 + | "0X" hexDigits -- alt2 + + hexDigits = + | hexDigits hexDigit -- alt2 + | hexDigit -- alt1 + + hexDigit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F" + + stringLiteral = + | "\"" doubleStringCharacters? "\"" -- alt1 + | "'" singleStringCharacters? "'" -- alt2 + + doubleStringCharacters = + | doubleStringCharacter+ + + singleStringCharacters = + | singleStringCharacter+ + + doubleStringCharacter = + | ~("\"" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\u2028" -- alt2 + | "\u2029" -- alt3 + | "\\" escapeSequence -- alt4 + | lineContinuation -- alt5 + + singleStringCharacter = + | ~("'" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\u2028" -- alt2 + | "\u2029" -- alt3 + | "\\" escapeSequence -- alt4 + | lineContinuation -- alt5 + + lineContinuation = + | "\\" lineTerminatorSequence -- alt1 + + escapeSequence = + | characterEscapeSequence -- alt1 + | "0" ~decimalDigit -- alt2 + | hexEscapeSequence -- alt3 + | unicodeEscapeSequence -- alt4 + + characterEscapeSequence = + | singleEscapeCharacter + | nonEscapeCharacter + + singleEscapeCharacter = "\"" | "\\" | "'" | "b" | "f" | "n" | "r" | "t" | "v" + + nonEscapeCharacter = + | ~(escapeCharacter | lineTerminator) sourceCharacter + + escapeCharacter = + | singleEscapeCharacter + | decimalDigit + | "x" + | "u" + + hexEscapeSequence = + | "x" hexDigit hexDigit -- alt1 + + unicodeEscapeSequence = + | "u" hex4Digits -- alt1 + | "u{" codePoint "}" -- alt2 + + hex4Digits = + | hexDigit hexDigit hexDigit hexDigit -- alt1 + + regularExpressionLiteral = + | "/" regularExpressionBody "/" regularExpressionFlags -- alt1 + + regularExpressionBody = + | regularExpressionFirstChar regularExpressionChars -- alt1 + + regularExpressionChars = + | regularExpressionChars regularExpressionChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionFirstChar = + | ~("*" | "\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionChar = + | ~("\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionBackslashSequence = + | "\\" regularExpressionNonTerminator -- alt1 + + regularExpressionNonTerminator = + | ~lineTerminator sourceCharacter + + regularExpressionClass = + | "[" regularExpressionClassChars "]" -- alt1 + + regularExpressionClassChars = + | regularExpressionClassChars regularExpressionClassChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionClassChar = + | ~("]" | "\\") regularExpressionNonTerminator + | regularExpressionBackslashSequence + + regularExpressionFlags = + | regularExpressionFlags identifierPart -- alt2 + | /* empty */ -- alt1 + + template = + | noSubstitutionTemplate + | templateHead + + noSubstitutionTemplate = + | "`" templateCharacters? "`" -- alt1 + + templateHead = + | "`" templateCharacters? "${" -- alt1 + + templateSubstitutionTail = + | templateMiddle + | templateTail + + templateMiddle = + | "}" templateCharacters? "${" -- alt1 + + templateTail = + | "}" templateCharacters? "`" -- alt1 + + templateCharacters = + | templateCharacter+ + + templateCharacter = + | "$" ~"{" -- alt1 + | "\\" escapeSequence -- alt2 + | "\\" notEscapeSequence -- alt3 + | lineContinuation -- alt4 + | lineTerminatorSequence -- alt5 + | ~("`" | "\\" | "$" | lineTerminator) sourceCharacter -- alt6 + + notEscapeSequence = + | "0" decimalDigit -- alt1 + | ~"0" decimalDigit -- alt2 + | "x" ~hexDigit -- alt3 + | "x" hexDigit ~hexDigit -- alt4 + | "u" ~hexDigit ~"{" -- alt5 + | "u" hexDigit ~hexDigit -- alt6 + | "u" hexDigit hexDigit ~hexDigit -- alt7 + | "u" hexDigit hexDigit hexDigit ~hexDigit -- alt8 + | "u" "{" ~hexDigit -- alt9 + | "u" "{" notCodePoint ~hexDigit -- alt10 + | "u" "{" codePoint ~hexDigit ~"}" -- alt11 + + notCodePoint = + | hexDigits /* FIXME Assertion: > but only if MV of |HexDigits| > 0x10FFFF */ -- alt1 + + codePoint = + | hexDigits /* FIXME Assertion: > but only if MV of |HexDigits| ≤ 0x10FFFF */ -- alt1 + + IdentifierReference = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + BindingIdentifier = + | Identifier + | yield + | await + + LabelIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + Identifier = + | ~reservedWord identifierName + + PrimaryExpression = + | this -- alt1 + | IdentifierReference -- alt2 + | Literal -- alt3 + | ArrayLiteral -- alt4 + | ObjectLiteral -- alt5 + | FunctionExpression -- alt6 + | ClassExpression -- alt7 + | GeneratorExpression -- alt8 + | AsyncFunctionExpression -- alt9 + | AsyncGeneratorExpression -- alt10 + | regularExpressionLiteral -- alt11 + | TemplateLiteral -- alt12 + | CoverParenthesizedExpressionAndArrowParameterList -- alt13 + + CoverParenthesizedExpressionAndArrowParameterList = + | "(" Expression ")" -- alt1 + | "(" Expression "," ")" -- alt2 + | "(" ")" -- alt3 + | "(" "..." BindingIdentifier ")" -- alt4 + | "(" "..." BindingPattern ")" -- alt5 + | "(" Expression "," "..." BindingIdentifier ")" -- alt6 + | "(" Expression "," "..." BindingPattern ")" -- alt7 + + ParenthesizedExpression = + | "(" Expression ")" -- alt1 + + Literal = + | nullLiteral + | booleanLiteral + | numericLiteral + | stringLiteral + + ArrayLiteral = + | "[" Elision? "]" -- alt1 + | "[" ElementList "]" -- alt2 + | "[" ElementList "," Elision? "]" -- alt3 + + ElementList = + | ElementList "," Elision? AssignmentExpression -- alt3 + | ElementList "," Elision? SpreadElement -- alt4 + | Elision? AssignmentExpression -- alt1 + | Elision? SpreadElement -- alt2 + + Elision = + | Elision "," -- alt2 + | "," -- alt1 + + SpreadElement = + | "..." AssignmentExpression -- alt1 + + ObjectLiteral = + | "{" "}" -- alt1 + | "{" PropertyDefinitionList "}" -- alt2 + | "{" PropertyDefinitionList "," "}" -- alt3 + + PropertyDefinitionList = + | PropertyDefinitionList "," PropertyDefinition -- alt2 + | PropertyDefinition -- alt1 + + PropertyDefinition = + | MethodDefinition -- alt4 + | PropertyName ":" AssignmentExpression -- alt3 + | IdentifierReference -- alt1 + | CoverInitializedName -- alt2 + | "..." AssignmentExpression -- alt5 + + PropertyName = + | LiteralPropertyName + | ComputedPropertyName + + LiteralPropertyName = + | identifierName + | stringLiteral + | numericLiteral + + ComputedPropertyName = + | "[" AssignmentExpression "]" -- alt1 + + CoverInitializedName = + | IdentifierReference Initializer -- alt1 + + Initializer = + | "=" AssignmentExpression -- alt1 + + TemplateLiteral = + | noSubstitutionTemplate + | SubstitutionTemplate + + SubstitutionTemplate = + | templateHead Expression TemplateSpans -- alt1 + + TemplateSpans = + | templateTail -- alt1 + | TemplateMiddleList templateTail -- alt2 + + TemplateMiddleList = + | TemplateMiddleList templateMiddle Expression -- alt2 + | templateMiddle Expression -- alt1 + + MemberExpression = + | MemberExpression "[" Expression "]" -- alt2 + | MemberExpression "." identifierName -- alt3 + | MemberExpression TemplateLiteral -- alt4 + | new MemberExpression Arguments -- alt7 + | PrimaryExpression -- alt1 + | SuperProperty -- alt5 + | MetaProperty -- alt6 + + SuperProperty = + | super "[" Expression "]" -- alt1 + | super "." identifierName -- alt2 + + MetaProperty = + | NewTarget + + NewTarget = + | new "." "target" -- alt1 + + NewExpression = + | MemberExpression -- alt1 + | new NewExpression -- alt2 + + CallExpression = + | CallExpression Arguments -- alt3 + | CallExpression "[" Expression "]" -- alt4 + | CallExpression "." identifierName -- alt5 + | CallExpression TemplateLiteral -- alt6 + | CoverCallExpressionAndAsyncArrowHead -- alt1 + | SuperCall -- alt2 + + SuperCall = + | super Arguments -- alt1 + + Arguments = + | "(" ")" -- alt1 + | "(" ArgumentList ")" -- alt2 + | "(" ArgumentList "," ")" -- alt3 + + ArgumentList = + | ArgumentList "," AssignmentExpression -- alt3 + | ArgumentList "," "..." AssignmentExpression -- alt4 + | AssignmentExpression -- alt1 + | "..." AssignmentExpression -- alt2 + + LeftHandSideExpression = + | CallExpression + | NewExpression + + CallMemberExpression = + | MemberExpression Arguments -- alt1 + + UpdateExpression = + | LeftHandSideExpression -- alt1 + | LeftHandSideExpression ~lineTerminator "++" -- alt2 + | LeftHandSideExpression ~lineTerminator "--" -- alt3 + | "++" UnaryExpression -- alt4 + | "--" UnaryExpression -- alt5 + + UnaryExpression = + | delete UnaryExpression -- alt2 + | void UnaryExpression -- alt3 + | typeof UnaryExpression -- alt4 + | "+" UnaryExpression -- alt5 + | "-" UnaryExpression -- alt6 + | "~" UnaryExpression -- alt7 + | "!" UnaryExpression -- alt8 + | guardAwait AwaitExpression -- alt9 + | UpdateExpression -- alt1 + + ExponentiationExpression = + | UnaryExpression -- alt1 + | UpdateExpression "**" ExponentiationExpression -- alt2 + + MultiplicativeExpression = + | MultiplicativeExpression MultiplicativeOperator ExponentiationExpression -- alt2 + | ExponentiationExpression -- alt1 + + MultiplicativeOperator = "*" | "/" | "%" + + AdditiveExpression = + | AdditiveExpression "+" MultiplicativeExpression -- alt2 + | AdditiveExpression "-" MultiplicativeExpression -- alt3 + | MultiplicativeExpression -- alt1 + + ShiftExpression = + | ShiftExpression "<<" AdditiveExpression -- alt2 + | ShiftExpression ">>" AdditiveExpression -- alt3 + | ShiftExpression ">>>" AdditiveExpression -- alt4 + | AdditiveExpression -- alt1 + + RelationalExpression = + | RelationalExpression "<" ShiftExpression -- alt2 + | RelationalExpression ">" ShiftExpression -- alt3 + | RelationalExpression "<=" ShiftExpression -- alt4 + | RelationalExpression ">=" ShiftExpression -- alt5 + | RelationalExpression instanceof ShiftExpression -- alt6 + | RelationalExpression guardIn in ShiftExpression -- alt7 + | ShiftExpression -- alt1 + + EqualityExpression = + | EqualityExpression "==" RelationalExpression -- alt2 + | EqualityExpression "!=" RelationalExpression -- alt3 + | EqualityExpression "===" RelationalExpression -- alt4 + | EqualityExpression "!==" RelationalExpression -- alt5 + | RelationalExpression -- alt1 + + BitwiseANDExpression = + | BitwiseANDExpression "&" EqualityExpression -- alt2 + | EqualityExpression -- alt1 + + BitwiseXORExpression = + | BitwiseXORExpression "^" BitwiseANDExpression -- alt2 + | BitwiseANDExpression -- alt1 + + BitwiseORExpression = + | BitwiseORExpression "|" BitwiseXORExpression -- alt2 + | BitwiseXORExpression -- alt1 + + LogicalANDExpression = + | LogicalANDExpression "&&" BitwiseORExpression -- alt2 + | BitwiseORExpression -- alt1 + + LogicalORExpression = + | LogicalORExpression "||" LogicalANDExpression -- alt2 + | LogicalANDExpression -- alt1 + + ConditionalExpression = + | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2 + | LogicalORExpression -- alt1 + + AssignmentExpression = + | AsyncArrowFunction -- alt4 + | ArrowFunction -- alt3 + | LeftHandSideExpression "=" AssignmentExpression -- alt5 + | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6 + | ConditionalExpression -- alt1 + | guardYield YieldExpression -- alt2 + + AssignmentOperator = ">>>=" | "<<=" | ">>=" | "**=" | "*=" | "/=" | "%=" | "+=" | "-=" | "&=" | "^=" | "|=" + + AssignmentPattern = + | ObjectAssignmentPattern + | ArrayAssignmentPattern + + ObjectAssignmentPattern = + | "{" "}" -- alt1 + | "{" AssignmentRestProperty "}" -- alt2 + | "{" AssignmentPropertyList "}" -- alt3 + | "{" AssignmentPropertyList "," AssignmentRestProperty? "}" -- alt4 + + ArrayAssignmentPattern = + | "[" Elision? AssignmentRestElement? "]" -- alt1 + | "[" AssignmentElementList "]" -- alt2 + | "[" AssignmentElementList "," Elision? AssignmentRestElement? "]" -- alt3 + + AssignmentRestProperty = + | "..." DestructuringAssignmentTarget -- alt1 + + AssignmentPropertyList = + | AssignmentPropertyList "," AssignmentProperty -- alt2 + | AssignmentProperty -- alt1 + + AssignmentElementList = + | AssignmentElementList "," AssignmentElisionElement -- alt2 + | AssignmentElisionElement -- alt1 + + AssignmentElisionElement = + | Elision? AssignmentElement -- alt1 + + AssignmentProperty = + | IdentifierReference Initializer? -- alt1 + | PropertyName ":" AssignmentElement -- alt2 + + AssignmentElement = + | DestructuringAssignmentTarget Initializer? -- alt1 + + AssignmentRestElement = + | "..." DestructuringAssignmentTarget -- alt1 + + DestructuringAssignmentTarget = + | LeftHandSideExpression + + Expression = + | Expression "," AssignmentExpression -- alt2 + | AssignmentExpression -- alt1 + + Statement = + | BlockStatement -- alt1 + | VariableStatement -- alt2 + | EmptyStatement -- alt3 + | ExpressionStatement -- alt4 + | IfStatement -- alt5 + | BreakableStatement -- alt6 + | ContinueStatement -- alt7 + | BreakStatement -- alt8 + | guardReturn ReturnStatement -- alt9 + | WithStatement -- alt10 + | LabelledStatement -- alt11 + | ThrowStatement -- alt12 + | TryStatement -- alt13 + | DebuggerStatement -- alt14 + + Declaration = + | HoistableDeclaration + | ClassDeclaration + | LexicalDeclaration + + HoistableDeclaration = + | FunctionDeclaration + | GeneratorDeclaration + | AsyncFunctionDeclaration + | AsyncGeneratorDeclaration + + BreakableStatement = + | IterationStatement + | SwitchStatement + + BlockStatement = + | Block + + Block = + | "{" StatementList? "}" -- alt1 + + StatementList = + | StatementListItem+ + + StatementListItem = + | Statement + | Declaration + + LexicalDeclaration = + | LetOrConst BindingList #sc -- alt1 + + LetOrConst = + | "let" + | const + + BindingList = + | BindingList "," LexicalBinding -- alt2 + | LexicalBinding -- alt1 + + LexicalBinding = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + VariableStatement = + | var VariableDeclarationList #sc -- alt1 + + VariableDeclarationList = + | VariableDeclarationList "," VariableDeclaration -- alt2 + | VariableDeclaration -- alt1 + + VariableDeclaration = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + BindingPattern = + | ObjectBindingPattern + | ArrayBindingPattern + + ObjectBindingPattern = + | "{" "}" -- alt1 + | "{" BindingRestProperty "}" -- alt2 + | "{" BindingPropertyList "}" -- alt3 + | "{" BindingPropertyList "," BindingRestProperty? "}" -- alt4 + + ArrayBindingPattern = + | "[" Elision? BindingRestElement? "]" -- alt1 + | "[" BindingElementList "]" -- alt2 + | "[" BindingElementList "," Elision? BindingRestElement? "]" -- alt3 + + BindingRestProperty = + | "..." BindingIdentifier -- alt1 + + BindingPropertyList = + | BindingPropertyList "," BindingProperty -- alt2 + | BindingProperty -- alt1 + + BindingElementList = + | BindingElementList "," BindingElisionElement -- alt2 + | BindingElisionElement -- alt1 + + BindingElisionElement = + | Elision? BindingElement -- alt1 + + BindingProperty = + | SingleNameBinding -- alt1 + | PropertyName ":" BindingElement -- alt2 + + BindingElement = + | SingleNameBinding -- alt1 + | BindingPattern Initializer? -- alt2 + + SingleNameBinding = + | BindingIdentifier Initializer? -- alt1 + + BindingRestElement = + | "..." BindingIdentifier -- alt1 + | "..." BindingPattern -- alt2 + + EmptyStatement = ";" // note: this semicolon eats newlines + + ExpressionStatement = + | ~("{" | "function" | ("async" ~lineTerminator "function") | "class" | ("let" "[")) Expression #sc -- alt1 + + IfStatement = + | if "(" Expression ")" Statement else Statement -- alt1 + | if "(" Expression ")" Statement -- alt2 + + IterationStatement = + | do Statement while "(" Expression ")" #sc -- alt1 + | while "(" Expression ")" Statement -- alt2 + | for "(" ~(("let" "[")) Expression? #sc Expression? #sc Expression? ")" Statement -- alt3 + | for "(" var VariableDeclarationList #sc Expression? #sc Expression? ")" Statement -- alt4 + | for "(" LexicalDeclaration Expression? #sc Expression? ")" Statement -- alt5 + | for "(" ~(("let" "[")) LeftHandSideExpression in Expression ")" Statement -- alt6 + | for "(" var ForBinding in Expression ")" Statement -- alt7 + | for "(" ForDeclaration in Expression ")" Statement -- alt8 + | for "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt9 + | for "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt10 + | for "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt11 + | guardAwait for await "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt12 + | guardAwait for await "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt13 + | guardAwait for await "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt14 + + ForDeclaration = + | LetOrConst ForBinding -- alt1 + + ForBinding = + | BindingIdentifier + | BindingPattern + + ContinueStatement = + | continue #sc -- alt1 + | continue ~lineTerminator LabelIdentifier #sc -- alt2 + + BreakStatement = + | break #sc -- alt1 + | break ~lineTerminator LabelIdentifier #sc -- alt2 + + ReturnStatement = + | return #sc -- alt1 + | return ~lineTerminator Expression #sc -- alt2 + + WithStatement = + | with "(" Expression ")" Statement -- alt1 + + SwitchStatement = + | switch "(" Expression ")" CaseBlock -- alt1 + + CaseBlock = + | "{" CaseClauses? "}" -- alt1 + | "{" CaseClauses? DefaultClause CaseClauses? "}" -- alt2 + + CaseClauses = + | CaseClauses CaseClause -- alt2 + | CaseClause -- alt1 + + CaseClause = + | case Expression ":" StatementList? -- alt1 + + DefaultClause = + | default ":" StatementList? -- alt1 + + LabelledStatement = + | LabelIdentifier ":" LabelledItem -- alt1 + + LabelledItem = + | Statement + | FunctionDeclaration + + ThrowStatement = + | throw ~lineTerminator Expression #sc -- alt1 + + TryStatement = + | try Block Catch -- alt1 + | try Block Finally -- alt2 + | try Block Catch Finally -- alt3 + + Catch = + | catch "(" CatchParameter ")" Block -- alt1 + | catch Block -- alt2 + + Finally = + | finally Block -- alt1 + + CatchParameter = + | BindingIdentifier + | BindingPattern + + DebuggerStatement = + | debugger #sc -- alt1 + + FunctionDeclaration = + | function BindingIdentifier "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + | guardDefault function "(" FormalParameters ")" "{" FunctionBody "}" -- alt2 + + FunctionExpression = + | function BindingIdentifier? "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + + UniqueFormalParameters = + | FormalParameters + + FormalParameters = + | FunctionRestParameter -- alt2 + | FormalParameterList -- alt3 + | FormalParameterList "," -- alt4 + | FormalParameterList "," FunctionRestParameter -- alt5 + | /* empty */ -- alt1 + + FormalParameterList = + | FormalParameterList "," FormalParameter -- alt2 + | FormalParameter -- alt1 + + FunctionRestParameter = + | BindingRestElement + + FormalParameter = + | BindingElement + + FunctionBody = + | FunctionStatementList + + FunctionStatementList = + | StatementList? + + ArrowFunction = + | ArrowParameters ~lineTerminator "=>" ConciseBody -- alt1 + + ArrowParameters = + | BindingIdentifier -- alt1 + | CoverParenthesizedExpressionAndArrowParameterList -- alt2 + + ConciseBody = + | ~"{" AssignmentExpression -- alt1 + | "{" FunctionBody "}" -- alt2 + + ArrowFormalParameters = + | "(" UniqueFormalParameters ")" -- alt1 + + MethodDefinition = + | PropertyName "(" UniqueFormalParameters ")" "{" FunctionBody "}" -- alt1 + | GeneratorMethod -- alt2 + | AsyncMethod -- alt3 + | AsyncGeneratorMethod -- alt4 + | "get" PropertyName "(" ")" "{" FunctionBody "}" -- alt5 + | "set" PropertyName "(" PropertySetParameterList ")" "{" FunctionBody "}" -- alt6 + + PropertySetParameterList = + | FormalParameter + + GeneratorMethod = + | "*" PropertyName "(" UniqueFormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorDeclaration = + | function "*" BindingIdentifier "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + | guardDefault function "*" "(" FormalParameters ")" "{" GeneratorBody "}" -- alt2 + + GeneratorExpression = + | function "*" BindingIdentifier? "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorBody = + | FunctionBody + + YieldExpression = + | yield -- alt1 + | yield ~lineTerminator AssignmentExpression -- alt2 + | yield ~lineTerminator "*" AssignmentExpression -- alt3 + + AsyncGeneratorMethod = + | "async" ~lineTerminator "*" PropertyName "(" UniqueFormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorDeclaration = + | "async" ~lineTerminator function "*" BindingIdentifier "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "*" "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt2 + + AsyncGeneratorExpression = + | "async" ~lineTerminator function "*" BindingIdentifier? "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorBody = + | FunctionBody + + ClassDeclaration = + | class BindingIdentifier ClassTail -- alt1 + | guardDefault class ClassTail -- alt2 + + ClassExpression = + | class BindingIdentifier? ClassTail -- alt1 + + ClassTail = + | ClassHeritage? "{" ClassBody? "}" -- alt1 + + ClassHeritage = + | extends LeftHandSideExpression -- alt1 + + ClassBody = + | ClassElementList + + ClassElementList = + | ClassElementList ClassElement -- alt2 + | ClassElement -- alt1 + + ClassElement = + | MethodDefinition -- alt1 + | "static" MethodDefinition -- alt2 + | #sc -- alt3 + + AsyncFunctionDeclaration = + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncFunctionExpression = + | "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncMethod = + | "async" ~lineTerminator PropertyName "(" UniqueFormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + + AsyncFunctionBody = + | FunctionBody + + AwaitExpression = + | await UnaryExpression -- alt1 + + AsyncArrowFunction = + | "async" ~lineTerminator AsyncArrowBindingIdentifier ~lineTerminator "=>" AsyncConciseBody -- alt1 + | CoverCallExpressionAndAsyncArrowHead ~lineTerminator "=>" AsyncConciseBody -- alt2 + + AsyncConciseBody = + | ~"{" AssignmentExpression -- alt1 + | "{" AsyncFunctionBody "}" -- alt2 + + AsyncArrowBindingIdentifier = + | BindingIdentifier + + CoverCallExpressionAndAsyncArrowHead = + | MemberExpression Arguments -- alt1 + + AsyncArrowHead = + | "async" ~lineTerminator ArrowFormalParameters -- alt1 + + Script = + | ScriptBody? + + ScriptBody = + | StatementList + + Module = + | ModuleBody? + + ModuleBody = + | ModuleItemList + + ModuleItemList = + | ModuleItem+ + + ModuleItem = + | ImportDeclaration + | ExportDeclaration + | StatementListItem + + ImportDeclaration = + | import ImportClause FromClause #sc -- alt1 + | import ModuleSpecifier #sc -- alt2 + + ImportClause = + | ImportedDefaultBinding -- alt1 + | NameSpaceImport -- alt2 + | NamedImports -- alt3 + | ImportedDefaultBinding "," NameSpaceImport -- alt4 + | ImportedDefaultBinding "," NamedImports -- alt5 + + ImportedDefaultBinding = + | ImportedBinding + + NameSpaceImport = + | "*" "as" ImportedBinding -- alt1 + + NamedImports = + | "{" "}" -- alt1 + | "{" ImportsList "}" -- alt2 + | "{" ImportsList "," "}" -- alt3 + + FromClause = + | "from" ModuleSpecifier -- alt1 + + ImportsList = + | ImportsList "," ImportSpecifier -- alt2 + | ImportSpecifier -- alt1 + + ImportSpecifier = + | ImportedBinding -- alt1 + | identifierName "as" ImportedBinding -- alt2 + + ModuleSpecifier = + | stringLiteral + + ImportedBinding = + | BindingIdentifier + + ExportDeclaration = + | export "*" FromClause #sc -- alt1 + | export ExportClause FromClause #sc -- alt2 + | export ExportClause #sc -- alt3 + | export VariableStatement -- alt4 + | export Declaration -- alt5 + | export default HoistableDeclaration -- alt6 + | export default ClassDeclaration -- alt7 + | export default ~("function" | ("async" ~lineTerminator "function") | "class") AssignmentExpression #sc -- alt8 + + ExportClause = + | "{" "}" -- alt1 + | "{" ExportsList "}" -- alt2 + | "{" ExportsList "," "}" -- alt3 + + ExportsList = + | ExportsList "," ExportSpecifier -- alt2 + | ExportSpecifier -- alt1 + + ExportSpecifier = + | identifierName -- alt1 + | identifierName "as" identifierName -- alt2 + + stringNumericLiteral = + | strWhiteSpace? -- alt1 + | strWhiteSpace? strNumericLiteral strWhiteSpace? -- alt2 + + strWhiteSpace = + | strWhiteSpaceChar strWhiteSpace? -- alt1 + + strWhiteSpaceChar = + | whiteSpace + | lineTerminator + + strNumericLiteral = + | strDecimalLiteral + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + + strDecimalLiteral = + | strUnsignedDecimalLiteral -- alt1 + | "+" strUnsignedDecimalLiteral -- alt2 + | "-" strUnsignedDecimalLiteral -- alt3 + + strUnsignedDecimalLiteral = + | "Infinity" -- alt1 + | decimalDigits "." decimalDigits? exponentPart? -- alt2 + | "." decimalDigits exponentPart? -- alt3 + | decimalDigits exponentPart? -- alt4 + + uri = + | uriCharacters? + + uriCharacters = + | uriCharacter uriCharacters? -- alt1 + + uriCharacter = + | uriReserved + | uriUnescaped + | uriEscaped + + uriReserved = #sc | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," + + uriUnescaped = + | uriAlpha + | decimalDigit + | uriMark + + uriEscaped = + | "%" hexDigit hexDigit -- alt1 + + uriAlpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + uriMark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" + + NativeFunction = + | function PropertyName? "(" FormalParameters ")" "{" "[" "native" "code" "]" "}" -- alt1 + + pattern = + | disjunction + + disjunction = + | alternative -- alt1 + | alternative "|" disjunction -- alt2 + + alternative = + | alternative term -- alt2 + | /* empty */ -- alt1 + + term = + | assertion -- alt1 + | atom -- alt2 + | atom quantifier -- alt3 + + assertion = + | "^" -- alt1 + | "$" -- alt2 + | "\\" "b" -- alt3 + | "\\" "B" -- alt4 + | "(" "?" "=" disjunction ")" -- alt5 + | "(" "?" "!" disjunction ")" -- alt6 + | "(" "?" "<=" disjunction ")" -- alt7 + | "(" "?" " ")" -- alt8 + + quantifier = + | quantifierPrefix -- alt1 + | quantifierPrefix "?" -- alt2 + + quantifierPrefix = + | "*" -- alt1 + | "+" -- alt2 + | "?" -- alt3 + | "{" decimalDigits "}" -- alt4 + | "{" decimalDigits "," "}" -- alt5 + | "{" decimalDigits "," decimalDigits "}" -- alt6 + + atom = + | patternCharacter -- alt1 + | "." -- alt2 + | "\\" atomEscape -- alt3 + | characterClass -- alt4 + | "(" groupSpecifier disjunction ")" -- alt5 + | "(" "?" ":" disjunction ")" -- alt6 + + syntaxCharacter = "\\" | "^" | "$" | "." | "*" | "+" | "?" | "(" | ")" | "[" | "]" | "{" | "}" | "|" + + patternCharacter = + | ~syntaxCharacter sourceCharacter + + atomEscape = + | decimalEscape -- alt1 + | characterClassEscape -- alt2 + | characterEscape -- alt3 + | guardN "k" groupName -- alt4 + + characterEscape = + | controlEscape -- alt1 + | "c" controlLetter -- alt2 + | "0" ~decimalDigit -- alt3 + | hexEscapeSequence -- alt4 + | regExpUnicodeEscapeSequence -- alt5 + | identityEscape -- alt6 + + controlEscape = "f" | "n" | "r" | "t" | "v" + + controlLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + groupSpecifier = + | /* empty */ -- alt1 + | "?" groupName -- alt2 + + groupName = + | "<" regExpIdentifierName ">" -- alt1 + + regExpIdentifierName = + | regExpIdentifierName regExpIdentifierPart -- alt2 + | regExpIdentifierStart -- alt1 + + regExpIdentifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" regExpUnicodeEscapeSequence -- alt4 + + regExpIdentifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "\\" regExpUnicodeEscapeSequence -- alt3 + | "" /* FIXME */ -- alt4 + | "" /* FIXME */ -- alt5 + + regExpUnicodeEscapeSequence = + | guardU "u" leadSurrogate "\\u" trailSurrogate -- alt1 + | guardU "u" leadSurrogate -- alt2 + | guardU "u" trailSurrogate -- alt3 + | guardU "u" nonSurrogate -- alt4 + | guardU "u" hex4Digits -- alt5 + | guardU "u{" codePoint "}" -- alt6 + + leadSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF */ -- alt1 + + trailSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF */ -- alt1 + + nonSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF */ -- alt1 + + identityEscape = + | guardU syntaxCharacter -- alt1 + | guardU "/" -- alt2 + | guardU ~unicodeIDContinue sourceCharacter -- alt3 + + decimalEscape = + | nonZeroDigit decimalDigits? ~decimalDigit -- alt1 + + characterClassEscape = + | "d" -- alt1 + | "D" -- alt2 + | "s" -- alt3 + | "S" -- alt4 + | "w" -- alt5 + | "W" -- alt6 + | guardU "p{" unicodePropertyValueExpression "}" -- alt7 + | guardU "P{" unicodePropertyValueExpression "}" -- alt8 + + unicodePropertyValueExpression = + | unicodePropertyName "=" unicodePropertyValue -- alt1 + | loneUnicodePropertyNameOrValue -- alt2 + + unicodePropertyName = + | unicodePropertyNameCharacters + + unicodePropertyNameCharacters = + | unicodePropertyNameCharacter unicodePropertyNameCharacters? -- alt1 + + unicodePropertyValue = + | unicodePropertyValueCharacters + + loneUnicodePropertyNameOrValue = + | unicodePropertyValueCharacters + + unicodePropertyValueCharacters = + | unicodePropertyValueCharacter unicodePropertyValueCharacters? -- alt1 + + unicodePropertyValueCharacter = + | unicodePropertyNameCharacter + | "0" + | "1" + | "2" + | "3" + | "4" + | "5" + | "6" + | "7" + | "8" + | "9" + + unicodePropertyNameCharacter = + | controlLetter + | "_" + + characterClass = + | "[" ~("^") classRanges "]" -- alt1 + | "[" "^" classRanges "]" -- alt2 + + classRanges = + | /* empty */ -- alt1 + | nonemptyClassRanges -- alt2 + + nonemptyClassRanges = + | classAtom -- alt1 + | classAtom nonemptyClassRangesNoDash -- alt2 + | classAtom "-" classAtom classRanges -- alt3 + + nonemptyClassRangesNoDash = + | classAtom -- alt1 + | classAtomNoDash nonemptyClassRangesNoDash -- alt2 + | classAtomNoDash "-" classAtom classRanges -- alt3 + + classAtom = + | "-" + | classAtomNoDash + + classAtomNoDash = + | ~("\\" | "]" | "-") sourceCharacter -- alt1 + | "\\" classEscape -- alt2 + + classEscape = + | "b" -- alt1 + | guardU "-" -- alt2 + | characterClassEscape -- alt3 + | characterEscape -- alt4 + + withYield = /* fixme */ + + noYield = ~any /* is this right? */ + + withAwait = /* fixme */ + + noAwait = ~any /* is this right? */ + + withIn = /* fixme */ + + noIn = ~any /* is this right? */ + + withTagged = /* fixme */ + + noTagged = ~any /* is this right? */ + + withReturn = /* fixme */ + + noReturn = ~any /* is this right? */ + + withDefault = /* fixme */ + + noDefault = ~any /* is this right? */ + + withU = /* fixme */ + + noU = ~any /* is this right? */ + + withN = /* fixme */ + + noN = ~any /* is this right? */ + + await = "await" ~identifierPart + break = "break" ~identifierPart + case = "case" ~identifierPart + catch = "catch" ~identifierPart + class = "class" ~identifierPart + const = "const" ~identifierPart + continue = "continue" ~identifierPart + debugger = "debugger" ~identifierPart + default = "default" ~identifierPart + delete = "delete" ~identifierPart + do = "do" ~identifierPart + else = "else" ~identifierPart + export = "export" ~identifierPart + extends = "extends" ~identifierPart + finally = "finally" ~identifierPart + for = "for" ~identifierPart + function = "function" ~identifierPart + if = "if" ~identifierPart + import = "import" ~identifierPart + in = "in" ~identifierPart + instanceof = "instanceof" ~identifierPart + new = "new" ~identifierPart + return = "return" ~identifierPart + super = "super" ~identifierPart + switch = "switch" ~identifierPart + this = "this" ~identifierPart + throw = "throw" ~identifierPart + try = "try" ~identifierPart + typeof = "typeof" ~identifierPart + var = "var" ~identifierPart + void = "void" ~identifierPart + while = "while" ~identifierPart + with = "with" ~identifierPart + yield = "yield" ~identifierPart + enum = "enum" ~identifierPart + null = "null" ~identifierPart + true = "true" ~identifierPart + false = "false" ~identifierPart +} diff --git a/examples/ecmascript/gen/es2020.grammar.ohm b/examples/ecmascript/gen/es2020.grammar.ohm new file mode 100644 index 00000000..e7d68996 --- /dev/null +++ b/examples/ecmascript/gen/es2020.grammar.ohm @@ -0,0 +1,1460 @@ +ES2020 { + + Start = Script + + // Override Ohm's built-in definition of space. + space := whiteSpace | lineTerminator | comment + + unicodeZs = "\xA0" | "\u1680" | "\u2000".."\u200A" | "\u202F" | "\u205F" | "\u3000" + + multiLineCommentNoNL = "/*" (~("*/" | lineTerminator) sourceCharacter)* "*/" + + // does not accept lineTerminators, not even implicit ones in a multiLineComment (cf. section 7.4) + spacesNoNL = (whiteSpace | singleLineComment | multiLineCommentNoNL)* + + // A semicolon is "automatically inserted" if a newline or the end of the input stream is + // reached, or the offending token is "}". + // See https://es5.github.io/#x7.9 for more information. + // NOTE: Applications of this rule *must* appear in a lexical context -- either in the body of a + // lexical rule, or inside '#()'. + sc = space* (";" | end) + | spacesNoNL (lineTerminator | ~multiLineCommentNoNL multiLineComment | &"}") + + sourceCharacter = any + + inputElementDiv = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | rightBracePunctuator + + inputElementRegExp = + | whiteSpace + | lineTerminator + | comment + | commonToken + | rightBracePunctuator + | regularExpressionLiteral + + inputElementRegExpOrTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | regularExpressionLiteral + | templateSubstitutionTail + + inputElementTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | templateSubstitutionTail + + whiteSpace = + | "\t" + | "\x0B" + | "\x0C" + | " " + | "\xA0" + | "\uFEFF" + | unicodeZs + + lineTerminator = + | "\n" + | "\r" + | "\u2028" + | "\u2029" + + lineTerminatorSequence = + | "\n" -- alt1 + | "\r" ~"\n" -- alt2 + | "\u2028" -- alt3 + | "\u2029" -- alt4 + | "\r" "\n" -- alt5 + + comment = + | multiLineComment + | singleLineComment + + multiLineComment = + | "/*" multiLineCommentChars? "*/" -- alt1 + + multiLineCommentChars = + (~"*/" sourceCharacter)* + + postAsteriskCommentChars = + | multiLineNotForwardSlashOrAsteriskChar multiLineCommentChars? -- alt1 + | "*" ~"/" postAsteriskCommentChars? -- alt2 + + multiLineNotAsteriskChar = + | ~"*" sourceCharacter + + multiLineNotForwardSlashOrAsteriskChar = + | ~("/" | "*") sourceCharacter + + singleLineComment = + | "//" singleLineCommentChars? -- alt1 + + singleLineCommentChars = + | singleLineCommentChar+ + + singleLineCommentChar = + | ~lineTerminator sourceCharacter + + commonToken = + | identifierName + | punctuator + | numericLiteral + | stringLiteral + | template + + identifierName = + | identifierName identifierPart -- alt2 + | identifierStart -- alt1 + + identifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" unicodeEscapeSequence -- alt4 + + identifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "\\" unicodeEscapeSequence -- alt3 + | "_" -- alt4 /* FIXME */ + + unicodeIDStart = letter /* fixme */ + + unicodeIDContinue = letter | digit /* fixme */ + + reservedWord = instanceof | continue | debugger | function | default | extends | finally | delete | export | import | return | switch | typeof | await | break | catch | class | const | false | super | throw | while | yield | case | else | enum | null | this | true | void | with | for | new | try | var | do | if | in + + punctuator = + | optionalChainingPunctuator + | otherPunctuator + + optionalChainingPunctuator = + | "?." ~decimalDigit -- alt1 + + otherPunctuator = ">>>=" | "..." | "===" | "!==" | ">>>" | "**=" | "<<=" | ">>=" | "<=" | ">=" | "==" | "!=" | "**" | "++" | "--" | "<<" | ">>" | "&&" | "||" | "??" | "+=" | "-=" | "*=" | "%=" | "&=" | "|=" | "^=" | "=>" | "{" | "(" | ")" | "[" | "]" | "." | #sc | "," | "<" | ">" | "+" | "-" | "*" | "%" | "&" | "|" | "^" | "!" | "~" | "?" | ":" | "=" + + divPunctuator = + | "/" + | "/=" + + rightBracePunctuator = + | "}" + + nullLiteral = + | null + + booleanLiteral = + | true + | false + + numericLiteral = + + | decimalBigIntegerLiteral -- alt2 + | nonDecimalIntegerLiteral -- alt3 + | nonDecimalIntegerLiteral bigIntLiteralSuffix -- alt4 + | decimalLiteral -- alt1 + + decimalBigIntegerLiteral = + | "0" bigIntLiteralSuffix -- alt1 + | nonZeroDigit decimalDigits? bigIntLiteralSuffix -- alt2 + + nonDecimalIntegerLiteral = + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + + bigIntLiteralSuffix = + | "n" + + decimalLiteral = + | decimalIntegerLiteral "." decimalDigits? exponentPart? -- alt1 + | "." decimalDigits exponentPart? -- alt2 + | decimalIntegerLiteral exponentPart? -- alt3 + + decimalIntegerLiteral = + | "0" -- alt1 + | nonZeroDigit decimalDigits? -- alt2 + + decimalDigits = + | decimalDigits decimalDigit -- alt2 + | decimalDigit -- alt1 + + decimalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + nonZeroDigit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + exponentPart = + | exponentIndicator signedInteger -- alt1 + + exponentIndicator = "e" | "E" + + signedInteger = + | decimalDigits -- alt1 + | "+" decimalDigits -- alt2 + | "-" decimalDigits -- alt3 + + binaryIntegerLiteral = + | "0b" binaryDigits -- alt1 + | "0B" binaryDigits -- alt2 + + binaryDigits = + | binaryDigits binaryDigit -- alt2 + | binaryDigit -- alt1 + + binaryDigit = "0" | "1" + + octalIntegerLiteral = + | "0o" octalDigits -- alt1 + | "0O" octalDigits -- alt2 + + octalDigits = + | octalDigits octalDigit -- alt2 + | octalDigit -- alt1 + + octalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" + + hexIntegerLiteral = + | "0x" hexDigits -- alt1 + | "0X" hexDigits -- alt2 + + hexDigits = + | hexDigits hexDigit -- alt2 + | hexDigit -- alt1 + + hexDigit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F" + + stringLiteral = + | "\"" doubleStringCharacters? "\"" -- alt1 + | "'" singleStringCharacters? "'" -- alt2 + + doubleStringCharacters = + | doubleStringCharacter+ + + singleStringCharacters = + | singleStringCharacter+ + + doubleStringCharacter = + | ~("\"" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\u2028" -- alt2 + | "\u2029" -- alt3 + | "\\" escapeSequence -- alt4 + | lineContinuation -- alt5 + + singleStringCharacter = + | ~("'" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\u2028" -- alt2 + | "\u2029" -- alt3 + | "\\" escapeSequence -- alt4 + | lineContinuation -- alt5 + + lineContinuation = + | "\\" lineTerminatorSequence -- alt1 + + escapeSequence = + | characterEscapeSequence -- alt1 + | "0" ~decimalDigit -- alt2 + | hexEscapeSequence -- alt3 + | unicodeEscapeSequence -- alt4 + + characterEscapeSequence = + | singleEscapeCharacter + | nonEscapeCharacter + + singleEscapeCharacter = "\"" | "\\" | "'" | "b" | "f" | "n" | "r" | "t" | "v" + + nonEscapeCharacter = + | ~(escapeCharacter | lineTerminator) sourceCharacter + + escapeCharacter = + | singleEscapeCharacter + | decimalDigit + | "x" + | "u" + + hexEscapeSequence = + | "x" hexDigit hexDigit -- alt1 + + unicodeEscapeSequence = + | "u" hex4Digits -- alt1 + | "u{" codePoint "}" -- alt2 + + hex4Digits = + | hexDigit hexDigit hexDigit hexDigit -- alt1 + + regularExpressionLiteral = + | "/" regularExpressionBody "/" regularExpressionFlags -- alt1 + + regularExpressionBody = + | regularExpressionFirstChar regularExpressionChars -- alt1 + + regularExpressionChars = + | regularExpressionChars regularExpressionChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionFirstChar = + | ~("*" | "\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionChar = + | ~("\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionBackslashSequence = + | "\\" regularExpressionNonTerminator -- alt1 + + regularExpressionNonTerminator = + | ~lineTerminator sourceCharacter + + regularExpressionClass = + | "[" regularExpressionClassChars "]" -- alt1 + + regularExpressionClassChars = + | regularExpressionClassChars regularExpressionClassChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionClassChar = + | ~("]" | "\\") regularExpressionNonTerminator + | regularExpressionBackslashSequence + + regularExpressionFlags = + | regularExpressionFlags identifierPart -- alt2 + | /* empty */ -- alt1 + + template = + | noSubstitutionTemplate + | templateHead + + noSubstitutionTemplate = + | "`" templateCharacters? "`" -- alt1 + + templateHead = + | "`" templateCharacters? "${" -- alt1 + + templateSubstitutionTail = + | templateMiddle + | templateTail + + templateMiddle = + | "}" templateCharacters? "${" -- alt1 + + templateTail = + | "}" templateCharacters? "`" -- alt1 + + templateCharacters = + | templateCharacter+ + + templateCharacter = + | "$" ~"{" -- alt1 + | "\\" escapeSequence -- alt2 + | "\\" notEscapeSequence -- alt3 + | lineContinuation -- alt4 + | lineTerminatorSequence -- alt5 + | ~("`" | "\\" | "$" | lineTerminator) sourceCharacter -- alt6 + + notEscapeSequence = + | "0" decimalDigit -- alt1 + | ~"0" decimalDigit -- alt2 + | "x" ~hexDigit -- alt3 + | "x" hexDigit ~hexDigit -- alt4 + | "u" ~hexDigit ~"{" -- alt5 + | "u" hexDigit ~hexDigit -- alt6 + | "u" hexDigit hexDigit ~hexDigit -- alt7 + | "u" hexDigit hexDigit hexDigit ~hexDigit -- alt8 + | "u" "{" ~hexDigit -- alt9 + | "u" "{" notCodePoint ~hexDigit -- alt10 + | "u" "{" codePoint ~hexDigit ~"}" -- alt11 + + notCodePoint = + | hexDigits /* FIXME Assertion: > but only if MV of |HexDigits| > 0x10FFFF */ -- alt1 + + codePoint = + | hexDigits /* FIXME Assertion: > but only if MV of |HexDigits| < 0x10FFFF */ -- alt1 + + IdentifierReference = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + BindingIdentifier = + | Identifier + | yield + | await + + LabelIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + Identifier = + | ~reservedWord identifierName + + PrimaryExpression = + | this -- alt1 + | IdentifierReference -- alt2 + | Literal -- alt3 + | ArrayLiteral -- alt4 + | ObjectLiteral -- alt5 + | FunctionExpression -- alt6 + | ClassExpression -- alt7 + | GeneratorExpression -- alt8 + | AsyncFunctionExpression -- alt9 + | AsyncGeneratorExpression -- alt10 + | regularExpressionLiteral -- alt11 + | TemplateLiteral -- alt12 + | CoverParenthesizedExpressionAndArrowParameterList -- alt13 + + CoverParenthesizedExpressionAndArrowParameterList = + | "(" Expression ")" -- alt1 + | "(" Expression "," ")" -- alt2 + | "(" ")" -- alt3 + | "(" "..." BindingIdentifier ")" -- alt4 + | "(" "..." BindingPattern ")" -- alt5 + | "(" Expression "," "..." BindingIdentifier ")" -- alt6 + | "(" Expression "," "..." BindingPattern ")" -- alt7 + + ParenthesizedExpression = + | "(" Expression ")" -- alt1 + + Literal = + | nullLiteral + | booleanLiteral + | numericLiteral + | stringLiteral + + ArrayLiteral = + | "[" Elision? "]" -- alt1 + | "[" ElementList "]" -- alt2 + | "[" ElementList "," Elision? "]" -- alt3 + + ElementList = + | ElementList "," Elision? AssignmentExpression -- alt3 + | ElementList "," Elision? SpreadElement -- alt4 + | Elision? AssignmentExpression -- alt1 + | Elision? SpreadElement -- alt2 + + Elision = + | Elision "," -- alt2 + | "," -- alt1 + + SpreadElement = + | "..." AssignmentExpression -- alt1 + + ObjectLiteral = + | "{" "}" -- alt1 + | "{" PropertyDefinitionList "}" -- alt2 + | "{" PropertyDefinitionList "," "}" -- alt3 + + PropertyDefinitionList = + | PropertyDefinitionList "," PropertyDefinition -- alt2 + | PropertyDefinition -- alt1 + + PropertyDefinition = + | "..." AssignmentExpression -- alt5 + | MethodDefinition -- alt4 + | PropertyName ":" AssignmentExpression -- alt3 + | IdentifierReference -- alt1 + | CoverInitializedName -- alt2 + + PropertyName = + | LiteralPropertyName + | ComputedPropertyName + + LiteralPropertyName = + | identifierName + | stringLiteral + | numericLiteral + + ComputedPropertyName = + | "[" AssignmentExpression "]" -- alt1 + + CoverInitializedName = + | IdentifierReference Initializer -- alt1 + + Initializer = + | "=" AssignmentExpression -- alt1 + + TemplateLiteral = + | noSubstitutionTemplate + | SubstitutionTemplate + + SubstitutionTemplate = + | templateHead Expression TemplateSpans -- alt1 + + TemplateSpans = + | templateTail -- alt1 + | TemplateMiddleList templateTail -- alt2 + + TemplateMiddleList = + | TemplateMiddleList templateMiddle Expression -- alt2 + | templateMiddle Expression -- alt1 + + MemberExpression = + | MemberExpression "[" Expression "]" -- alt2 + | MemberExpression "." identifierName -- alt3 + | MemberExpression TemplateLiteral -- alt4 + | new MemberExpression Arguments -- alt7 + | PrimaryExpression -- alt1 + | SuperProperty -- alt5 + | MetaProperty -- alt6 + + SuperProperty = + | super "[" Expression "]" -- alt1 + | super "." identifierName -- alt2 + + MetaProperty = + | NewTarget + | ImportMeta + + NewTarget = + | new "." "target" -- alt1 + + ImportMeta = + | import "." "meta" -- alt1 + + NewExpression = + | MemberExpression -- alt1 + | new NewExpression -- alt2 + + CallExpression = + | CallExpression Arguments -- alt4 + | CallExpression "[" Expression "]" -- alt5 + | CallExpression "." identifierName -- alt6 + | CallExpression TemplateLiteral -- alt7 + | CoverCallExpressionAndAsyncArrowHead -- alt1 + | SuperCall -- alt2 + | ImportCall -- alt3 + + SuperCall = + | super Arguments -- alt1 + + ImportCall = + | import "(" AssignmentExpression ")" -- alt1 + + Arguments = + | "(" ")" -- alt1 + | "(" ArgumentList ")" -- alt2 + | "(" ArgumentList "," ")" -- alt3 + + ArgumentList = + | ArgumentList "," AssignmentExpression -- alt3 + | ArgumentList "," "..." AssignmentExpression -- alt4 + | AssignmentExpression -- alt1 + | "..." AssignmentExpression -- alt2 + + OptionalExpression = + | OptionalExpression OptionalChain -- alt3 + | MemberExpression OptionalChain -- alt1 + | CallExpression OptionalChain -- alt2 + + OptionalChain = + | OptionalChain Arguments -- alt5 + | OptionalChain "[" Expression "]" -- alt6 + | OptionalChain "." identifierName -- alt7 + | OptionalChain TemplateLiteral -- alt8 + | "?." Arguments -- alt1 + | "?." "[" Expression "]" -- alt2 + | "?." identifierName -- alt3 + | "?." TemplateLiteral -- alt4 + + LeftHandSideExpression = + | CallExpression + | NewExpression + | OptionalExpression + + CallMemberExpression = + | MemberExpression Arguments -- alt1 + + UpdateExpression = + | LeftHandSideExpression -- alt1 + | LeftHandSideExpression ~lineTerminator "++" -- alt2 + | LeftHandSideExpression ~lineTerminator "--" -- alt3 + | "++" UnaryExpression -- alt4 + | "--" UnaryExpression -- alt5 + + UnaryExpression = + | delete UnaryExpression -- alt2 + | void UnaryExpression -- alt3 + | typeof UnaryExpression -- alt4 + | "+" UnaryExpression -- alt5 + | "-" UnaryExpression -- alt6 + | "~" UnaryExpression -- alt7 + | "!" UnaryExpression -- alt8 + | guardAwait AwaitExpression -- alt9 + | UpdateExpression -- alt1 + + ExponentiationExpression = + | UnaryExpression -- alt1 + | UpdateExpression "**" ExponentiationExpression -- alt2 + + MultiplicativeExpression = + | MultiplicativeExpression MultiplicativeOperator ExponentiationExpression -- alt2 + | ExponentiationExpression -- alt1 + + MultiplicativeOperator = "*" | "/" | "%" + + AdditiveExpression = + | AdditiveExpression "+" MultiplicativeExpression -- alt2 + | AdditiveExpression "-" MultiplicativeExpression -- alt3 + | MultiplicativeExpression -- alt1 + + ShiftExpression = + | ShiftExpression "<" AdditiveExpression -- alt2 + | ShiftExpression ">" AdditiveExpression -- alt3 + | ShiftExpression ">" AdditiveExpression -- alt4 + | AdditiveExpression -- alt1 + + RelationalExpression = + | RelationalExpression "<" ShiftExpression -- alt2 + | RelationalExpression ">" ShiftExpression -- alt3 + | RelationalExpression "<=" ShiftExpression -- alt4 + | RelationalExpression ">=" ShiftExpression -- alt5 + | RelationalExpression instanceof ShiftExpression -- alt6 + | RelationalExpression guardIn in ShiftExpression -- alt7 + | ShiftExpression -- alt1 + + EqualityExpression = + | EqualityExpression "==" RelationalExpression -- alt2 + | EqualityExpression "!=" RelationalExpression -- alt3 + | EqualityExpression "===" RelationalExpression -- alt4 + | EqualityExpression "!==" RelationalExpression -- alt5 + | RelationalExpression -- alt1 + + BitwiseANDExpression = + | BitwiseANDExpression "&" EqualityExpression -- alt2 + | EqualityExpression -- alt1 + + BitwiseXORExpression = + | BitwiseXORExpression "^" BitwiseANDExpression -- alt2 + | BitwiseANDExpression -- alt1 + + BitwiseORExpression = + | BitwiseORExpression "|" BitwiseXORExpression -- alt2 + | BitwiseXORExpression -- alt1 + + LogicalANDExpression = + | LogicalANDExpression "&" BitwiseORExpression -- alt2 + | BitwiseORExpression -- alt1 + + LogicalORExpression = + | LogicalORExpression "||" LogicalANDExpression -- alt2 + | LogicalANDExpression -- alt1 + + CoalesceExpression = + | CoalesceExpressionHead "??" BitwiseORExpression -- alt1 + + CoalesceExpressionHead = + | CoalesceExpression + | BitwiseORExpression + + ShortCircuitExpression = + | LogicalORExpression + | CoalesceExpression + + ConditionalExpression = + | ShortCircuitExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2 + | ShortCircuitExpression -- alt1 + + AssignmentExpression = + | AsyncArrowFunction -- alt4 + | ArrowFunction -- alt3 + | LeftHandSideExpression "=" AssignmentExpression -- alt5 + | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6 + | ConditionalExpression -- alt1 + | guardYield YieldExpression -- alt2 + + AssignmentOperator = ">>>=" | "<<=" | ">>=" | "**=" | "*=" | "/=" | "%=" | "+=" | "-=" | "&=" | "^=" | "|=" + + AssignmentPattern = + | ObjectAssignmentPattern + | ArrayAssignmentPattern + + ObjectAssignmentPattern = + | "{" "}" -- alt1 + | "{" AssignmentRestProperty "}" -- alt2 + | "{" AssignmentPropertyList "}" -- alt3 + | "{" AssignmentPropertyList "," AssignmentRestProperty? "}" -- alt4 + + ArrayAssignmentPattern = + | "[" Elision? AssignmentRestElement? "]" -- alt1 + | "[" AssignmentElementList "]" -- alt2 + | "[" AssignmentElementList "," Elision? AssignmentRestElement? "]" -- alt3 + + AssignmentRestProperty = + | "..." DestructuringAssignmentTarget -- alt1 + + AssignmentPropertyList = + | AssignmentPropertyList "," AssignmentProperty -- alt2 + | AssignmentProperty -- alt1 + + AssignmentElementList = + | AssignmentElementList "," AssignmentElisionElement -- alt2 + | AssignmentElisionElement -- alt1 + + AssignmentElisionElement = + | Elision? AssignmentElement -- alt1 + + AssignmentProperty = + | IdentifierReference Initializer? -- alt1 + | PropertyName ":" AssignmentElement -- alt2 + + AssignmentElement = + | DestructuringAssignmentTarget Initializer? -- alt1 + + AssignmentRestElement = + | "..." DestructuringAssignmentTarget -- alt1 + + DestructuringAssignmentTarget = + | LeftHandSideExpression + + Expression = + | Expression "," AssignmentExpression -- alt2 + | AssignmentExpression -- alt1 + + Statement = + | BlockStatement -- alt1 + | VariableStatement -- alt2 + | EmptyStatement -- alt3 + | ExpressionStatement -- alt4 + | IfStatement -- alt5 + | BreakableStatement -- alt6 + | ContinueStatement -- alt7 + | BreakStatement -- alt8 + | guardReturn ReturnStatement -- alt9 + | WithStatement -- alt10 + | LabelledStatement -- alt11 + | ThrowStatement -- alt12 + | TryStatement -- alt13 + | DebuggerStatement -- alt14 + + Declaration = + | HoistableDeclaration + | ClassDeclaration + | LexicalDeclaration + + HoistableDeclaration = + | FunctionDeclaration + | GeneratorDeclaration + | AsyncFunctionDeclaration + | AsyncGeneratorDeclaration + + BreakableStatement = + | IterationStatement + | SwitchStatement + + BlockStatement = + | Block + + Block = + | "{" StatementList? "}" -- alt1 + + StatementList = + | StatementListItem+ + + StatementListItem = + | Statement + | Declaration + + LexicalDeclaration = + | LetOrConst BindingList #sc -- alt1 + + LetOrConst = + | "let" + | const + + BindingList = + | BindingList "," LexicalBinding -- alt2 + | LexicalBinding -- alt1 + + LexicalBinding = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + VariableStatement = + | var VariableDeclarationList #sc -- alt1 + + VariableDeclarationList = + | VariableDeclarationList "," VariableDeclaration -- alt2 + | VariableDeclaration -- alt1 + + VariableDeclaration = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + BindingPattern = + | ObjectBindingPattern + | ArrayBindingPattern + + ObjectBindingPattern = + | "{" "}" -- alt1 + | "{" BindingRestProperty "}" -- alt2 + | "{" BindingPropertyList "}" -- alt3 + | "{" BindingPropertyList "," BindingRestProperty? "}" -- alt4 + + ArrayBindingPattern = + | "[" Elision? BindingRestElement? "]" -- alt1 + | "[" BindingElementList "]" -- alt2 + | "[" BindingElementList "," Elision? BindingRestElement? "]" -- alt3 + + BindingRestProperty = + | "..." BindingIdentifier -- alt1 + + BindingPropertyList = + | BindingPropertyList "," BindingProperty -- alt2 + | BindingProperty -- alt1 + + BindingElementList = + | BindingElementList "," BindingElisionElement -- alt2 + | BindingElisionElement -- alt1 + + BindingElisionElement = + | Elision? BindingElement -- alt1 + + BindingProperty = + | SingleNameBinding -- alt1 + | PropertyName ":" BindingElement -- alt2 + + BindingElement = + | SingleNameBinding -- alt1 + | BindingPattern Initializer? -- alt2 + + SingleNameBinding = + | BindingIdentifier Initializer? -- alt1 + + BindingRestElement = + | "..." BindingIdentifier -- alt1 + | "..." BindingPattern -- alt2 + + EmptyStatement = ";" // note: this semicolon eats newlines + + ExpressionStatement = + | ~("{" | "function" | ("async" ~lineTerminator "function") | "class" | ("let" "[")) Expression #sc -- alt1 + + IfStatement = + | if "(" Expression ")" Statement else Statement -- alt1 + | if "(" Expression ")" Statement -- alt2 + + IterationStatement = + | do Statement while "(" Expression ")" #sc -- alt1 + | while "(" Expression ")" Statement -- alt2 + | for "(" ~("let"|"[") Expression? #sc Expression? #sc Expression? ")" Statement -- alt3 + | for "(" var VariableDeclarationList #sc Expression? #sc Expression? ")" Statement -- alt4 + | for "(" LexicalDeclaration Expression? #sc Expression? ")" Statement -- alt5 + | for "(" ~("let"|"[") LeftHandSideExpression in Expression ")" Statement -- alt6 + | for "(" var ForBinding in Expression ")" Statement -- alt7 + | for "(" ForDeclaration in Expression ")" Statement -- alt8 + | for "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt9 + | for "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt10 + | for "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt11 + | guardAwait for await "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt12 + | guardAwait for await "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt13 + | guardAwait for await "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt14 + + ForDeclaration = + | LetOrConst ForBinding -- alt1 + + ForBinding = + | BindingIdentifier + | BindingPattern + + ContinueStatement = + | continue #sc -- alt1 + | continue ~lineTerminator LabelIdentifier #sc -- alt2 + + BreakStatement = + | break #sc -- alt1 + | break ~lineTerminator LabelIdentifier #sc -- alt2 + + ReturnStatement = + | return #sc -- alt1 + | return ~lineTerminator Expression #sc -- alt2 + + WithStatement = + | with "(" Expression ")" Statement -- alt1 + + SwitchStatement = + | switch "(" Expression ")" CaseBlock -- alt1 + + CaseBlock = + | "{" CaseClauses? "}" -- alt1 + | "{" CaseClauses? DefaultClause CaseClauses? "}" -- alt2 + + CaseClauses = + | CaseClauses CaseClause -- alt2 + | CaseClause -- alt1 + + CaseClause = + | case Expression ":" StatementList? -- alt1 + + DefaultClause = + | default ":" StatementList? -- alt1 + + LabelledStatement = + | LabelIdentifier ":" LabelledItem -- alt1 + + LabelledItem = + | Statement + | FunctionDeclaration + + ThrowStatement = + | throw ~lineTerminator Expression #sc -- alt1 + + TryStatement = + | try Block Catch -- alt1 + | try Block Finally -- alt2 + | try Block Catch Finally -- alt3 + + Catch = + | catch "(" CatchParameter ")" Block -- alt1 + | catch Block -- alt2 + + Finally = + | finally Block -- alt1 + + CatchParameter = + | BindingIdentifier + | BindingPattern + + DebuggerStatement = + | debugger #sc -- alt1 + + FunctionDeclaration = + | function BindingIdentifier "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + | guardDefault function "(" FormalParameters ")" "{" FunctionBody "}" -- alt2 + + FunctionExpression = + | function BindingIdentifier? "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + + UniqueFormalParameters = + | FormalParameters + + FormalParameters = + | FunctionRestParameter -- alt2 + | FormalParameterList -- alt3 + | FormalParameterList "," -- alt4 + | FormalParameterList "," FunctionRestParameter -- alt5 + | /* empty */ -- alt1 + + FormalParameterList = + | FormalParameterList "," FormalParameter -- alt2 + | FormalParameter -- alt1 + + FunctionRestParameter = + | BindingRestElement + + FormalParameter = + | BindingElement + + FunctionBody = + | FunctionStatementList + + FunctionStatementList = + | StatementList? + + ArrowFunction = + | ArrowParameters ~lineTerminator "=>" ConciseBody -- alt1 + + ArrowParameters = + | BindingIdentifier -- alt1 + | CoverParenthesizedExpressionAndArrowParameterList -- alt2 + + ConciseBody = + | ~"{" ExpressionBody -- alt1 + | "{" FunctionBody "}" -- alt2 + + ExpressionBody = + | AssignmentExpression + + ArrowFormalParameters = + | "(" UniqueFormalParameters ")" -- alt1 + + MethodDefinition = + | PropertyName "(" UniqueFormalParameters ")" "{" FunctionBody "}" -- alt1 + | GeneratorMethod -- alt2 + | AsyncMethod -- alt3 + | AsyncGeneratorMethod -- alt4 + | "get" PropertyName "(" ")" "{" FunctionBody "}" -- alt5 + | "set" PropertyName "(" PropertySetParameterList ")" "{" FunctionBody "}" -- alt6 + + PropertySetParameterList = + | FormalParameter + + GeneratorMethod = + | "*" PropertyName "(" UniqueFormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorDeclaration = + | function "*" BindingIdentifier "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + | guardDefault function "*" "(" FormalParameters ")" "{" GeneratorBody "}" -- alt2 + + GeneratorExpression = + | function "*" BindingIdentifier? "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorBody = + | FunctionBody + + YieldExpression = + | yield -- alt1 + | yield ~lineTerminator AssignmentExpression -- alt2 + | yield ~lineTerminator "*" AssignmentExpression -- alt3 + + AsyncGeneratorMethod = + | "async" ~lineTerminator "*" PropertyName "(" UniqueFormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorDeclaration = + | "async" ~lineTerminator function "*" BindingIdentifier "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "*" "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt2 + + AsyncGeneratorExpression = + | "async" ~lineTerminator function "*" BindingIdentifier? "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorBody = + | FunctionBody + + ClassDeclaration = + | class BindingIdentifier ClassTail -- alt1 + | guardDefault class ClassTail -- alt2 + + ClassExpression = + | class BindingIdentifier? ClassTail -- alt1 + + ClassTail = + | ClassHeritage? "{" ClassBody? "}" -- alt1 + + ClassHeritage = + | extends LeftHandSideExpression -- alt1 + + ClassBody = + | ClassElementList + + ClassElementList = + | ClassElementList ClassElement -- alt2 + | ClassElement -- alt1 + + ClassElement = + | MethodDefinition -- alt1 + | "static" MethodDefinition -- alt2 + | #sc -- alt3 + + AsyncFunctionDeclaration = + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncFunctionExpression = + | "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncMethod = + | "async" ~lineTerminator PropertyName "(" UniqueFormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + + AsyncFunctionBody = + | FunctionBody + + AwaitExpression = + | await UnaryExpression -- alt1 + + AsyncArrowFunction = + | "async" ~lineTerminator AsyncArrowBindingIdentifier ~lineTerminator "=>" AsyncConciseBody -- alt1 + | CoverCallExpressionAndAsyncArrowHead ~lineTerminator "=>" AsyncConciseBody -- alt2 + + AsyncConciseBody = + | ~"{" ExpressionBody -- alt1 + | "{" AsyncFunctionBody "}" -- alt2 + + AsyncArrowBindingIdentifier = + | BindingIdentifier + + CoverCallExpressionAndAsyncArrowHead = + | MemberExpression Arguments -- alt1 + + AsyncArrowHead = + | "async" ~lineTerminator ArrowFormalParameters -- alt1 + + Script = + | ScriptBody? + + ScriptBody = + | StatementList + + Module = + | ModuleBody? + + ModuleBody = + | ModuleItemList + + ModuleItemList = + | ModuleItem+ + + ModuleItem = + | ImportDeclaration + | ExportDeclaration + | StatementListItem + + ImportDeclaration = + | import ImportClause FromClause #sc -- alt1 + | import ModuleSpecifier #sc -- alt2 + + ImportClause = + | ImportedDefaultBinding -- alt1 + | NameSpaceImport -- alt2 + | NamedImports -- alt3 + | ImportedDefaultBinding "," NameSpaceImport -- alt4 + | ImportedDefaultBinding "," NamedImports -- alt5 + + ImportedDefaultBinding = + | ImportedBinding + + NameSpaceImport = + | "*" "as" ImportedBinding -- alt1 + + NamedImports = + | "{" "}" -- alt1 + | "{" ImportsList "}" -- alt2 + | "{" ImportsList "," "}" -- alt3 + + FromClause = + | "from" ModuleSpecifier -- alt1 + + ImportsList = + | ImportsList "," ImportSpecifier -- alt2 + | ImportSpecifier -- alt1 + + ImportSpecifier = + | ImportedBinding -- alt1 + | identifierName "as" ImportedBinding -- alt2 + + ModuleSpecifier = + | stringLiteral + + ImportedBinding = + | BindingIdentifier + + ExportDeclaration = + | export ExportFromClause FromClause #sc -- alt1 + | export NamedExports #sc -- alt2 + | export VariableStatement -- alt3 + | export Declaration -- alt4 + | export default HoistableDeclaration -- alt5 + | export default ClassDeclaration -- alt6 + | export default ~("function" | ("async" ~lineTerminator "function") | "class") AssignmentExpression #sc -- alt7 + + ExportFromClause = + | "*" -- alt1 + | "*" "as" identifierName -- alt2 + | NamedExports -- alt3 + + NamedExports = + | "{" "}" -- alt1 + | "{" ExportsList "}" -- alt2 + | "{" ExportsList "," "}" -- alt3 + + ExportsList = + | ExportsList "," ExportSpecifier -- alt2 + | ExportSpecifier -- alt1 + + ExportSpecifier = + | identifierName -- alt1 + | identifierName "as" identifierName -- alt2 + + uri = + | uriCharacters? + + uriCharacters = + | uriCharacter uriCharacters? -- alt1 + + uriCharacter = + | uriReserved + | uriUnescaped + | uriEscaped + + uriReserved = #sc | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," + + uriUnescaped = + | uriAlpha + | decimalDigit + | uriMark + + uriEscaped = + | "%" hexDigit hexDigit -- alt1 + + uriAlpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + uriMark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" + + NativeFunction = + | function PropertyName? "(" FormalParameters ")" "{" "[" "native" "code" "]" "}" -- alt1 + + pattern = + | disjunction + + disjunction = + | alternative -- alt1 + | alternative "|" disjunction -- alt2 + + alternative = + | alternative term -- alt2 + | /* empty */ -- alt1 + + term = + | assertion -- alt1 + | atom -- alt2 + | atom quantifier -- alt3 + + assertion = + | "^" -- alt1 + | "$" -- alt2 + | "\\" "b" -- alt3 + | "\\" "B" -- alt4 + | "(" "?" "=" disjunction ")" -- alt5 + | "(" "?" "!" disjunction ")" -- alt6 + | "(" "?" "<=" disjunction ")" -- alt7 + | "(" "?" " ")" -- alt8 + + quantifier = + | quantifierPrefix -- alt1 + | quantifierPrefix "?" -- alt2 + + quantifierPrefix = + | "*" -- alt1 + | "+" -- alt2 + | "?" -- alt3 + | "{" decimalDigits "}" -- alt4 + | "{" decimalDigits "," "}" -- alt5 + | "{" decimalDigits "," decimalDigits "}" -- alt6 + + atom = + | patternCharacter -- alt1 + | "." -- alt2 + | "\\" atomEscape -- alt3 + | characterClass -- alt4 + | "(" groupSpecifier disjunction ")" -- alt5 + | "(" "?" ":" disjunction ")" -- alt6 + + syntaxCharacter = "\\" | "^" | "$" | "." | "*" | "+" | "?" | "(" | ")" | "[" | "]" | "{" | "}" | "|" + + patternCharacter = + | ~syntaxCharacter sourceCharacter + + atomEscape = + | decimalEscape -- alt1 + | characterClassEscape -- alt2 + | characterEscape -- alt3 + | guardN "k" groupName -- alt4 + + characterEscape = + | controlEscape -- alt1 + | "c" controlLetter -- alt2 + | "0" ~decimalDigit -- alt3 + | hexEscapeSequence -- alt4 + | regExpUnicodeEscapeSequence -- alt5 + | identityEscape -- alt6 + + controlEscape = "f" | "n" | "r" | "t" | "v" + + controlLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + groupSpecifier = + | /* empty */ -- alt1 + | "?" groupName -- alt2 + + groupName = + | "<" regExpIdentifierName ">" -- alt1 + + regExpIdentifierName = + | regExpIdentifierName regExpIdentifierPart -- alt2 + | regExpIdentifierStart -- alt1 + + regExpIdentifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" regExpUnicodeEscapeSequence -- alt4 + | guardU unicodeLeadSurrogate unicodeTrailSurrogate -- alt5 + + regExpIdentifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "\\" regExpUnicodeEscapeSequence -- alt3 + | guardU unicodeLeadSurrogate unicodeTrailSurrogate -- alt4 + | "" /* FIXME */ -- alt5 + | "" /* FIXME */ -- alt6 + + regExpUnicodeEscapeSequence = + | guardU "u" leadSurrogate "\\u" trailSurrogate -- alt1 + | guardU "u" leadSurrogate -- alt2 + | guardU "u" trailSurrogate -- alt3 + | guardU "u" nonSurrogate -- alt4 + | guardU "u" hex4Digits -- alt5 + | guardU "u{" codePoint "}" -- alt6 + + unicodeLeadSurrogate = /* any Unicode code point in the inclusive range 0xD800 to 0xDBFF */ + + unicodeTrailSurrogate = /* any Unicode code point in the inclusive range 0xDC00 to 0xDFFF */ + + leadSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF */ -- alt1 + + trailSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF */ -- alt1 + + nonSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF */ -- alt1 + + identityEscape = + | guardU syntaxCharacter -- alt1 + | guardU "/" -- alt2 + | guardU ~unicodeIDContinue sourceCharacter -- alt3 + + decimalEscape = + | nonZeroDigit decimalDigits? ~decimalDigit -- alt1 + + characterClassEscape = + | "d" -- alt1 + | "D" -- alt2 + | "s" -- alt3 + | "S" -- alt4 + | "w" -- alt5 + | "W" -- alt6 + | guardU "p{" unicodePropertyValueExpression "}" -- alt7 + | guardU "P{" unicodePropertyValueExpression "}" -- alt8 + + unicodePropertyValueExpression = + | unicodePropertyName "=" unicodePropertyValue -- alt1 + | loneUnicodePropertyNameOrValue -- alt2 + + unicodePropertyName = + | unicodePropertyNameCharacters + + unicodePropertyNameCharacters = + | unicodePropertyNameCharacter unicodePropertyNameCharacters? -- alt1 + + unicodePropertyValue = + | unicodePropertyValueCharacters + + loneUnicodePropertyNameOrValue = + | unicodePropertyValueCharacters + + unicodePropertyValueCharacters = + | unicodePropertyValueCharacter unicodePropertyValueCharacters? -- alt1 + + unicodePropertyValueCharacter = + | unicodePropertyNameCharacter + | decimalDigit + + unicodePropertyNameCharacter = + | controlLetter + | "_" + + characterClass = + | "[" ~"^" classRanges "]" -- alt1 + | "[" "^" classRanges "]" -- alt2 + + classRanges = + | /* empty */ -- alt1 + | nonemptyClassRanges -- alt2 + + nonemptyClassRanges = + | classAtom -- alt1 + | classAtom nonemptyClassRangesNoDash -- alt2 + | classAtom "-" classAtom classRanges -- alt3 + + nonemptyClassRangesNoDash = + | classAtom -- alt1 + | classAtomNoDash nonemptyClassRangesNoDash -- alt2 + | classAtomNoDash "-" classAtom classRanges -- alt3 + + classAtom = + | "-" + | classAtomNoDash + + classAtomNoDash = + | ~("\\" | "]" | "-") sourceCharacter -- alt1 + | "\\" classEscape -- alt2 + + classEscape = + | "b" -- alt1 + | guardU "-" -- alt2 + | characterClassEscape -- alt3 + | characterEscape -- alt4 + + withYield = /* fixme */ + + noYield = ~any /* is this right? */ + + withAwait = /* fixme */ + + noAwait = ~any /* is this right? */ + + withIn = /* fixme */ + + noIn = ~any /* is this right? */ + + withTagged = /* fixme */ + + noTagged = ~any /* is this right? */ + + withReturn = /* fixme */ + + noReturn = ~any /* is this right? */ + + withDefault = /* fixme */ + + noDefault = ~any /* is this right? */ + + withU = /* fixme */ + + noU = ~any /* is this right? */ + + withN = /* fixme */ + + noN = ~any /* is this right? */ + + await = "await" ~identifierPart + break = "break" ~identifierPart + case = "case" ~identifierPart + catch = "catch" ~identifierPart + class = "class" ~identifierPart + const = "const" ~identifierPart + continue = "continue" ~identifierPart + debugger = "debugger" ~identifierPart + default = "default" ~identifierPart + delete = "delete" ~identifierPart + do = "do" ~identifierPart + else = "else" ~identifierPart + enum = "enum" ~identifierPart + export = "export" ~identifierPart + extends = "extends" ~identifierPart + false = "false" ~identifierPart + finally = "finally" ~identifierPart + for = "for" ~identifierPart + function = "function" ~identifierPart + if = "if" ~identifierPart + import = "import" ~identifierPart + in = "in" ~identifierPart + instanceof = "instanceof" ~identifierPart + new = "new" ~identifierPart + null = "null" ~identifierPart + return = "return" ~identifierPart + super = "super" ~identifierPart + switch = "switch" ~identifierPart + this = "this" ~identifierPart + throw = "throw" ~identifierPart + true = "true" ~identifierPart + try = "try" ~identifierPart + typeof = "typeof" ~identifierPart + var = "var" ~identifierPart + void = "void" ~identifierPart + while = "while" ~identifierPart + with = "with" ~identifierPart + yield = "yield" ~identifierPart +} diff --git a/examples/ecmascript/gen/es2021.grammar.ohm b/examples/ecmascript/gen/es2021.grammar.ohm new file mode 100644 index 00000000..16059eba --- /dev/null +++ b/examples/ecmascript/gen/es2021.grammar.ohm @@ -0,0 +1,1517 @@ +ES2021 { + + Start = Script + + // Override Ohm's built-in definition of space. + space := whiteSpace | lineTerminator | comment + + unicodeZs = "\xA0" | "\u1680" | "\u2000".."\u200A" | "\u202F" | "\u205F" | "\u3000" + + multiLineCommentNoNL = "/*" (~("*/" | lineTerminator) sourceCharacter)* "*/" + + // does not accept lineTerminators, not even implicit ones in a multiLineComment (cf. section 7.4) + spacesNoNL = (whiteSpace | singleLineComment | multiLineCommentNoNL)* + + // A semicolon is "automatically inserted" if a newline or the end of the input stream is + // reached, or the offending token is "}". + // See https://es5.github.io/#x7.9 for more information. + // NOTE: Applications of this rule *must* appear in a lexical context -- either in the body of a + // lexical rule, or inside '#()'. + sc = space* (";" | end) + | spacesNoNL (lineTerminator | ~multiLineCommentNoNL multiLineComment | &"}") + + sourceCharacter = any + + inputElementDiv = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | rightBracePunctuator + + inputElementRegExp = + | whiteSpace + | lineTerminator + | comment + | commonToken + | rightBracePunctuator + | regularExpressionLiteral + + inputElementRegExpOrTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | regularExpressionLiteral + | templateSubstitutionTail + + inputElementTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | templateSubstitutionTail + + whiteSpace = + | "\t" + | "\x0B" + | "\x0C" + | " " + | "\xA0" + | "\uFEFF" + | unicodeZs + + lineTerminator = + | "\n" + | "\r" + | "\u2028" + | "\u2029" + + lineTerminatorSequence = + | "\n" -- alt1 + | "\r" ~"\n" -- alt2 + | "\u2028" -- alt3 + | "\u2029" -- alt4 + | "\r" "\n" -- alt5 + + comment = + | multiLineComment + | singleLineComment + + multiLineComment = + | "/*" multiLineCommentChars? "*/" -- alt1 + + multiLineCommentChars = + (~"*/" sourceCharacter)* + + postAsteriskCommentChars = + | multiLineNotForwardSlashOrAsteriskChar multiLineCommentChars? -- alt1 + | "*" ~"/" postAsteriskCommentChars? -- alt2 + + multiLineNotAsteriskChar = + | ~"*" sourceCharacter + + multiLineNotForwardSlashOrAsteriskChar = + | ~("/" | "*") sourceCharacter + + singleLineComment = + | "//" singleLineCommentChars? -- alt1 + + singleLineCommentChars = + | singleLineCommentChar+ + + singleLineCommentChar = + | ~lineTerminator sourceCharacter + + commonToken = + | identifierName + | punctuator + | numericLiteral + | stringLiteral + | template + + identifierName = + | identifierName identifierPart -- alt2 + | identifierStart -- alt1 + + identifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" unicodeEscapeSequence -- alt4 + + identifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "\\" unicodeEscapeSequence -- alt3 + | "_" -- alt4 /* FIXME */ + + unicodeIDStart = letter /* fixme */ + + unicodeIDContinue = letter | digit /* fixme */ + + reservedWord = instanceof | continue | debugger | function | default | extends | finally | delete | export | import | return | switch | typeof | await | break | catch | class | const | false | super | throw | while | yield | case | else | enum | null | this | true | void | with | for | new | try | var | do | if | in + + punctuator = + | optionalChainingPunctuator + | otherPunctuator + + optionalChainingPunctuator = + | "?." ~decimalDigit -- alt1 + + otherPunctuator = ">>>=" | "..." | "===" | "!==" | ">>>" | "**=" | "<<=" | ">>=" | "&&=" | "||=" | "??=" | "<=" | ">=" | "==" | "!=" | "**" | "++" | "--" | "<<" | ">>" | "&&" | "||" | "??" | "+=" | "-=" | "*=" | "%=" | "&=" | "|=" | "^=" | "=>" | "{" | "(" | ")" | "[" | "]" | "." | #sc | "," | "<" | ">" | "+" | "-" | "*" | "%" | "&" | "|" | "^" | "!" | "~" | "?" | ":" | "=" + + divPunctuator = + | "/" + | "/=" + + rightBracePunctuator = + | "}" + + nullLiteral = + | null + + booleanLiteral = + | true + | false + + numericLiteralSeparator = + | "_" + + numericLiteral = + + | decimalBigIntegerLiteral -- alt2 + | nonDecimalIntegerLiteral -- alt3 + | nonDecimalIntegerLiteral bigIntLiteralSuffix -- alt4 + | decimalLiteral -- alt1 + + decimalBigIntegerLiteral = + | "0" bigIntLiteralSuffix -- alt1 + | nonZeroDigit decimalDigits? bigIntLiteralSuffix -- alt2 + | nonZeroDigit numericLiteralSeparator decimalDigits bigIntLiteralSuffix -- alt3 + + nonDecimalIntegerLiteral = + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + + bigIntLiteralSuffix = + | "n" + + decimalLiteral = + | decimalIntegerLiteral "." decimalDigits? exponentPart? -- alt1 + | "." decimalDigits exponentPart? -- alt2 + | decimalIntegerLiteral exponentPart? -- alt3 + + decimalIntegerLiteral = + | "0" -- alt1 + | nonZeroDigit -- alt2 + | nonZeroDigit numericLiteralSeparator? decimalDigits -- alt3 + + decimalDigits = + | decimalDigits decimalDigit -- alt2 + | decimalDigit -- alt1 + | guardSep decimalDigits numericLiteralSeparator decimalDigit -- alt3 + + decimalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + nonZeroDigit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + exponentPart = + | exponentIndicator signedInteger -- alt1 + + exponentIndicator = "e" | "E" + + signedInteger = + | decimalDigits -- alt1 + | "+" decimalDigits -- alt2 + | "-" decimalDigits -- alt3 + + binaryIntegerLiteral = + | "0b" binaryDigits -- alt1 + | "0B" binaryDigits -- alt2 + + binaryDigits = + | binaryDigits binaryDigit -- alt2 + | binaryDigit -- alt1 + | guardSep binaryDigits numericLiteralSeparator binaryDigit -- alt3 + + binaryDigit = "0" | "1" + + octalIntegerLiteral = + | "0o" octalDigits -- alt1 + | "0O" octalDigits -- alt2 + + octalDigits = + | octalDigits octalDigit -- alt2 + | octalDigit -- alt1 + | guardSep octalDigits numericLiteralSeparator octalDigit -- alt3 + + octalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" + + hexIntegerLiteral = + | "0x" hexDigits -- alt1 + | "0X" hexDigits -- alt2 + + hexDigits = + | hexDigits hexDigit -- alt2 + | hexDigit -- alt1 + | guardSep hexDigits numericLiteralSeparator hexDigit -- alt3 + + hexDigit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F" + + stringLiteral = + | "\"" doubleStringCharacters? "\"" -- alt1 + | "'" singleStringCharacters? "'" -- alt2 + + doubleStringCharacters = + | doubleStringCharacter+ + + singleStringCharacters = + | singleStringCharacter+ + + doubleStringCharacter = + | ~("\"" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\u2028" -- alt2 + | "\u2029" -- alt3 + | "\\" escapeSequence -- alt4 + | lineContinuation -- alt5 + + singleStringCharacter = + | ~("'" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\u2028" -- alt2 + | "\u2029" -- alt3 + | "\\" escapeSequence -- alt4 + | lineContinuation -- alt5 + + lineContinuation = + | "\\" lineTerminatorSequence -- alt1 + + escapeSequence = + | characterEscapeSequence -- alt1 + | "0" ~decimalDigit -- alt2 + | hexEscapeSequence -- alt3 + | unicodeEscapeSequence -- alt4 + + characterEscapeSequence = + | singleEscapeCharacter + | nonEscapeCharacter + + singleEscapeCharacter = "\"" | "\\" | "'" | "b" | "f" | "n" | "r" | "t" | "v" + + nonEscapeCharacter = + | ~(escapeCharacter | lineTerminator) sourceCharacter + + escapeCharacter = + | singleEscapeCharacter + | decimalDigit + | "x" + | "u" + + hexEscapeSequence = + | "x" hexDigit hexDigit -- alt1 + + unicodeEscapeSequence = + | "u" hex4Digits -- alt1 + | "u{" codePoint "}" -- alt2 + + hex4Digits = + | hexDigit hexDigit hexDigit hexDigit -- alt1 + + regularExpressionLiteral = + | "/" regularExpressionBody "/" regularExpressionFlags -- alt1 + + regularExpressionBody = + | regularExpressionFirstChar regularExpressionChars -- alt1 + + regularExpressionChars = + | regularExpressionChars regularExpressionChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionFirstChar = + | ~("*" | "\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionChar = + | ~("\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionBackslashSequence = + | "\\" regularExpressionNonTerminator -- alt1 + + regularExpressionNonTerminator = + | ~lineTerminator sourceCharacter + + regularExpressionClass = + | "[" regularExpressionClassChars "]" -- alt1 + + regularExpressionClassChars = + | regularExpressionClassChars regularExpressionClassChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionClassChar = + | ~("]" | "\\") regularExpressionNonTerminator + | regularExpressionBackslashSequence + + regularExpressionFlags = + | regularExpressionFlags identifierPart -- alt2 + | /* empty */ -- alt1 + + template = + | noSubstitutionTemplate + | templateHead + + noSubstitutionTemplate = + | "`" templateCharacters? "`" -- alt1 + + templateHead = + | "`" templateCharacters? "${" -- alt1 + + templateSubstitutionTail = + | templateMiddle + | templateTail + + templateMiddle = + | "}" templateCharacters? "${" -- alt1 + + templateTail = + | "}" templateCharacters? "`" -- alt1 + + templateCharacters = + | templateCharacter+ + + templateCharacter = + | "$" ~"{" -- alt1 + | "\\" escapeSequence -- alt2 + | "\\" notEscapeSequence -- alt3 + | lineContinuation -- alt4 + | lineTerminatorSequence -- alt5 + | ~("`" | "\\" | "$" | lineTerminator) sourceCharacter -- alt6 + + notEscapeSequence = + | "0" decimalDigit -- alt1 + | ~"0" decimalDigit -- alt2 + | "x" ~hexDigit -- alt3 + | "x" hexDigit ~hexDigit -- alt4 + | "u" ~hexDigit ~"{" -- alt5 + | "u" hexDigit ~hexDigit -- alt6 + | "u" hexDigit hexDigit ~hexDigit -- alt7 + | "u" hexDigit hexDigit hexDigit ~hexDigit -- alt8 + | "u" "{" ~hexDigit -- alt9 + | "u" "{" notCodePoint ~hexDigit -- alt10 + | "u" "{" codePoint ~hexDigit ~"}" -- alt11 + + notCodePoint = + | hexDigits /* FIXME Assertion: > but only if MV of |HexDigits| > 0x10FFFF */ -- alt1 + + codePoint = + | hexDigits /* FIXME Assertion: > but only if MV of |HexDigits| ≤ 0x10FFFF */ -- alt1 + + IdentifierReference = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + BindingIdentifier = + | Identifier + | yield + | await + + LabelIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + Identifier = + | ~reservedWord identifierName + + PrimaryExpression = + | this -- alt1 + | IdentifierReference -- alt2 + | Literal -- alt3 + | ArrayLiteral -- alt4 + | ObjectLiteral -- alt5 + | FunctionExpression -- alt6 + | ClassExpression -- alt7 + | GeneratorExpression -- alt8 + | AsyncFunctionExpression -- alt9 + | AsyncGeneratorExpression -- alt10 + | regularExpressionLiteral -- alt11 + | TemplateLiteral -- alt12 + | CoverParenthesizedExpressionAndArrowParameterList -- alt13 + + CoverParenthesizedExpressionAndArrowParameterList = + | "(" Expression ")" -- alt1 + | "(" Expression "," ")" -- alt2 + | "(" ")" -- alt3 + | "(" "..." BindingIdentifier ")" -- alt4 + | "(" "..." BindingPattern ")" -- alt5 + | "(" Expression "," "..." BindingIdentifier ")" -- alt6 + | "(" Expression "," "..." BindingPattern ")" -- alt7 + + ParenthesizedExpression = + | "(" Expression ")" -- alt1 + + Literal = + | nullLiteral + | booleanLiteral + | numericLiteral + | stringLiteral + + ArrayLiteral = + | "[" Elision? "]" -- alt1 + | "[" ElementList "]" -- alt2 + | "[" ElementList "," Elision? "]" -- alt3 + + ElementList = + | ElementList "," Elision? AssignmentExpression -- alt3 + | ElementList "," Elision? SpreadElement -- alt4 + | Elision? AssignmentExpression -- alt1 + | Elision? SpreadElement -- alt2 + + Elision = + | Elision "," -- alt2 + | "," -- alt1 + + SpreadElement = + | "..." AssignmentExpression -- alt1 + + ObjectLiteral = + | "{" "}" -- alt1 + | "{" PropertyDefinitionList "}" -- alt2 + | "{" PropertyDefinitionList "," "}" -- alt3 + + PropertyDefinitionList = + | PropertyDefinitionList "," PropertyDefinition -- alt2 + | PropertyDefinition -- alt1 + + PropertyDefinition = + | "..." AssignmentExpression -- alt5 + | MethodDefinition -- alt4 + | PropertyName ":" AssignmentExpression -- alt3 + | IdentifierReference -- alt1 + | CoverInitializedName -- alt2 + + PropertyName = + | LiteralPropertyName + | ComputedPropertyName + + LiteralPropertyName = + | identifierName + | stringLiteral + | numericLiteral + + ComputedPropertyName = + | "[" AssignmentExpression "]" -- alt1 + + CoverInitializedName = + | IdentifierReference Initializer -- alt1 + + Initializer = + | "=" AssignmentExpression -- alt1 + + TemplateLiteral = + | noSubstitutionTemplate + | SubstitutionTemplate + + SubstitutionTemplate = + | templateHead Expression TemplateSpans -- alt1 + + TemplateSpans = + | templateTail -- alt1 + | TemplateMiddleList templateTail -- alt2 + + TemplateMiddleList = + | TemplateMiddleList templateMiddle Expression -- alt2 + | templateMiddle Expression -- alt1 + + MemberExpression = + | MemberExpression "[" Expression "]" -- alt2 + | MemberExpression "." identifierName -- alt3 + | MemberExpression TemplateLiteral -- alt4 + | new MemberExpression Arguments -- alt7 + | PrimaryExpression -- alt1 + | SuperProperty -- alt5 + | MetaProperty -- alt6 + + SuperProperty = + | super "[" Expression "]" -- alt1 + | super "." identifierName -- alt2 + + MetaProperty = + | NewTarget + | ImportMeta + + NewTarget = + | new "." "target" -- alt1 + + ImportMeta = + | import "." "meta" -- alt1 + + NewExpression = + | MemberExpression -- alt1 + | new NewExpression -- alt2 + + CallExpression = + | CallExpression Arguments -- alt4 + | CallExpression "[" Expression "]" -- alt5 + | CallExpression "." identifierName -- alt6 + | CallExpression TemplateLiteral -- alt7 + | CoverCallExpressionAndAsyncArrowHead -- alt1 + | SuperCall -- alt2 + | ImportCall -- alt3 + + SuperCall = + | super Arguments -- alt1 + + ImportCall = + | import "(" AssignmentExpression ")" -- alt1 + + Arguments = + | "(" ")" -- alt1 + | "(" ArgumentList ")" -- alt2 + | "(" ArgumentList "," ")" -- alt3 + + ArgumentList = + | ArgumentList "," AssignmentExpression -- alt3 + | ArgumentList "," "..." AssignmentExpression -- alt4 + | AssignmentExpression -- alt1 + | "..." AssignmentExpression -- alt2 + + OptionalExpression = + | OptionalExpression OptionalChain -- alt3 + | MemberExpression OptionalChain -- alt1 + | CallExpression OptionalChain -- alt2 + + OptionalChain = + | OptionalChain Arguments -- alt5 + | OptionalChain "[" Expression "]" -- alt6 + | OptionalChain "." identifierName -- alt7 + | OptionalChain TemplateLiteral -- alt8 + | "?." Arguments -- alt1 + | "?." "[" Expression "]" -- alt2 + | "?." identifierName -- alt3 + | "?." TemplateLiteral -- alt4 + + LeftHandSideExpression = + | CallExpression + | NewExpression + | OptionalExpression + + CallMemberExpression = + | MemberExpression Arguments -- alt1 + + UpdateExpression = + | LeftHandSideExpression -- alt1 + | LeftHandSideExpression ~lineTerminator "++" -- alt2 + | LeftHandSideExpression ~lineTerminator "--" -- alt3 + | "++" UnaryExpression -- alt4 + | "--" UnaryExpression -- alt5 + + UnaryExpression = + | delete UnaryExpression -- alt2 + | void UnaryExpression -- alt3 + | typeof UnaryExpression -- alt4 + | "+" UnaryExpression -- alt5 + | "-" UnaryExpression -- alt6 + | "~" UnaryExpression -- alt7 + | "!" UnaryExpression -- alt8 + | guardAwait AwaitExpression -- alt9 + | UpdateExpression -- alt1 + + ExponentiationExpression = + | UnaryExpression -- alt1 + | UpdateExpression "**" ExponentiationExpression -- alt2 + + MultiplicativeExpression = + | MultiplicativeExpression MultiplicativeOperator ExponentiationExpression -- alt2 + | ExponentiationExpression -- alt1 + + MultiplicativeOperator = "*" | "/" | "%" + + AdditiveExpression = + | AdditiveExpression "+" MultiplicativeExpression -- alt2 + | AdditiveExpression "-" MultiplicativeExpression -- alt3 + | MultiplicativeExpression -- alt1 + + ShiftExpression = + | ShiftExpression "<<" AdditiveExpression -- alt2 + | ShiftExpression ">>" AdditiveExpression -- alt3 + | ShiftExpression ">>>" AdditiveExpression -- alt4 + | AdditiveExpression -- alt1 + + RelationalExpression = + | RelationalExpression "<" ShiftExpression -- alt2 + | RelationalExpression ">" ShiftExpression -- alt3 + | RelationalExpression "<=" ShiftExpression -- alt4 + | RelationalExpression ">=" ShiftExpression -- alt5 + | RelationalExpression instanceof ShiftExpression -- alt6 + | RelationalExpression guardIn in ShiftExpression -- alt7 + | ShiftExpression -- alt1 + + EqualityExpression = + | EqualityExpression "==" RelationalExpression -- alt2 + | EqualityExpression "!=" RelationalExpression -- alt3 + | EqualityExpression "===" RelationalExpression -- alt4 + | EqualityExpression "!==" RelationalExpression -- alt5 + | RelationalExpression -- alt1 + + BitwiseANDExpression = + | BitwiseANDExpression "&" EqualityExpression -- alt2 + | EqualityExpression -- alt1 + + BitwiseXORExpression = + | BitwiseXORExpression "^" BitwiseANDExpression -- alt2 + | BitwiseANDExpression -- alt1 + + BitwiseORExpression = + | BitwiseORExpression "|" BitwiseXORExpression -- alt2 + | BitwiseXORExpression -- alt1 + + LogicalANDExpression = + | LogicalANDExpression "&&" BitwiseORExpression -- alt2 + | BitwiseORExpression -- alt1 + + LogicalORExpression = + | LogicalORExpression "||" LogicalANDExpression -- alt2 + | LogicalANDExpression -- alt1 + + CoalesceExpression = + | CoalesceExpressionHead "??" BitwiseORExpression -- alt1 + + CoalesceExpressionHead = + | CoalesceExpression + | BitwiseORExpression + + ShortCircuitExpression = + | LogicalORExpression + | CoalesceExpression + + ConditionalExpression = + | ShortCircuitExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2 + | ShortCircuitExpression -- alt1 + + AssignmentExpression = + | AsyncArrowFunction -- alt4 + | ArrowFunction -- alt3 + | LeftHandSideExpression "=" AssignmentExpression -- alt5 + | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6 + | ConditionalExpression -- alt1 + | guardYield YieldExpression -- alt2 + | LeftHandSideExpression "&&=" AssignmentExpression -- alt7 + | LeftHandSideExpression "||=" AssignmentExpression -- alt8 + | LeftHandSideExpression "??=" AssignmentExpression -- alt9 + + AssignmentOperator = ">>>=" | "<<=" | ">>=" | "**=" | "*=" | "/=" | "%=" | "+=" | "-=" | "&=" | "^=" | "|=" + + AssignmentPattern = + | ObjectAssignmentPattern + | ArrayAssignmentPattern + + ObjectAssignmentPattern = + | "{" "}" -- alt1 + | "{" AssignmentRestProperty "}" -- alt2 + | "{" AssignmentPropertyList "}" -- alt3 + | "{" AssignmentPropertyList "," AssignmentRestProperty? "}" -- alt4 + + ArrayAssignmentPattern = + | "[" Elision? AssignmentRestElement? "]" -- alt1 + | "[" AssignmentElementList "]" -- alt2 + | "[" AssignmentElementList "," Elision? AssignmentRestElement? "]" -- alt3 + + AssignmentRestProperty = + | "..." DestructuringAssignmentTarget -- alt1 + + AssignmentPropertyList = + | AssignmentPropertyList "," AssignmentProperty -- alt2 + | AssignmentProperty -- alt1 + + AssignmentElementList = + | AssignmentElementList "," AssignmentElisionElement -- alt2 + | AssignmentElisionElement -- alt1 + + AssignmentElisionElement = + | Elision? AssignmentElement -- alt1 + + AssignmentProperty = + | IdentifierReference Initializer? -- alt1 + | PropertyName ":" AssignmentElement -- alt2 + + AssignmentElement = + | DestructuringAssignmentTarget Initializer? -- alt1 + + AssignmentRestElement = + | "..." DestructuringAssignmentTarget -- alt1 + + DestructuringAssignmentTarget = + | LeftHandSideExpression + + Expression = + | Expression "," AssignmentExpression -- alt2 + | AssignmentExpression -- alt1 + + Statement = + | BlockStatement -- alt1 + | VariableStatement -- alt2 + | EmptyStatement -- alt3 + | ExpressionStatement -- alt4 + | IfStatement -- alt5 + | BreakableStatement -- alt6 + | ContinueStatement -- alt7 + | BreakStatement -- alt8 + | guardReturn ReturnStatement -- alt9 + | WithStatement -- alt10 + | LabelledStatement -- alt11 + | ThrowStatement -- alt12 + | TryStatement -- alt13 + | DebuggerStatement -- alt14 + + Declaration = + | HoistableDeclaration + | ClassDeclaration + | LexicalDeclaration + + HoistableDeclaration = + | FunctionDeclaration + | GeneratorDeclaration + | AsyncFunctionDeclaration + | AsyncGeneratorDeclaration + + BreakableStatement = + | IterationStatement + | SwitchStatement + + BlockStatement = + | Block + + Block = + | "{" StatementList? "}" -- alt1 + + StatementList = + | StatementListItem+ + + StatementListItem = + | Statement + | Declaration + + LexicalDeclaration = + | LetOrConst BindingList #sc -- alt1 + + LetOrConst = + | "let" + | const + + BindingList = + | BindingList "," LexicalBinding -- alt2 + | LexicalBinding -- alt1 + + LexicalBinding = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + VariableStatement = + | var VariableDeclarationList #sc -- alt1 + + VariableDeclarationList = + | VariableDeclarationList "," VariableDeclaration -- alt2 + | VariableDeclaration -- alt1 + + VariableDeclaration = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + BindingPattern = + | ObjectBindingPattern + | ArrayBindingPattern + + ObjectBindingPattern = + | "{" "}" -- alt1 + | "{" BindingRestProperty "}" -- alt2 + | "{" BindingPropertyList "}" -- alt3 + | "{" BindingPropertyList "," BindingRestProperty? "}" -- alt4 + + ArrayBindingPattern = + | "[" Elision? BindingRestElement? "]" -- alt1 + | "[" BindingElementList "]" -- alt2 + | "[" BindingElementList "," Elision? BindingRestElement? "]" -- alt3 + + BindingRestProperty = + | "..." BindingIdentifier -- alt1 + + BindingPropertyList = + | BindingPropertyList "," BindingProperty -- alt2 + | BindingProperty -- alt1 + + BindingElementList = + | BindingElementList "," BindingElisionElement -- alt2 + | BindingElisionElement -- alt1 + + BindingElisionElement = + | Elision? BindingElement -- alt1 + + BindingProperty = + | SingleNameBinding -- alt1 + | PropertyName ":" BindingElement -- alt2 + + BindingElement = + | SingleNameBinding -- alt1 + | BindingPattern Initializer? -- alt2 + + SingleNameBinding = + | BindingIdentifier Initializer? -- alt1 + + BindingRestElement = + | "..." BindingIdentifier -- alt1 + | "..." BindingPattern -- alt2 + + EmptyStatement = ";" // note: this semicolon eats newlines + + ExpressionStatement = + | ~("{" | "function" | ("async" ~lineTerminator "function") | "class" | ("let" "[")) Expression #sc -- alt1 + + IfStatement = + | if "(" Expression ")" Statement else Statement -- alt1 + | if "(" Expression ")" Statement ~"else" -- alt2 + + IterationStatement = + | DoWhileStatement + | WhileStatement + | ForStatement + | ForInOfStatement + + DoWhileStatement = + | do Statement while "(" Expression ")" #sc -- alt1 + + WhileStatement = + | while "(" Expression ")" Statement -- alt1 + + ForStatement = + | for "(" ~("let"|"[") Expression? #sc Expression? #sc Expression? ")" Statement -- alt1 + | for "(" var VariableDeclarationList #sc Expression? #sc Expression? ")" Statement -- alt2 + | for "(" LexicalDeclaration Expression? #sc Expression? ")" Statement -- alt3 + + ForInOfStatement = + | for "(" ~("let"|"[") LeftHandSideExpression in Expression ")" Statement -- alt1 + | for "(" var ForBinding in Expression ")" Statement -- alt2 + | for "(" ForDeclaration in Expression ")" Statement -- alt3 + | for "(" ~("let" | ("async" "of")) LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt4 + | for "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt5 + | for "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt6 + | guardAwait for await "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt7 + | guardAwait for await "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt8 + | guardAwait for await "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt9 + + ForDeclaration = + | LetOrConst ForBinding -- alt1 + + ForBinding = + | BindingIdentifier + | BindingPattern + + ContinueStatement = + | continue #sc -- alt1 + | continue ~lineTerminator LabelIdentifier #sc -- alt2 + + BreakStatement = + | break #sc -- alt1 + | break ~lineTerminator LabelIdentifier #sc -- alt2 + + ReturnStatement = + | return #sc -- alt1 + | return ~lineTerminator Expression #sc -- alt2 + + WithStatement = + | with "(" Expression ")" Statement -- alt1 + + SwitchStatement = + | switch "(" Expression ")" CaseBlock -- alt1 + + CaseBlock = + | "{" CaseClauses? "}" -- alt1 + | "{" CaseClauses? DefaultClause CaseClauses? "}" -- alt2 + + CaseClauses = + | CaseClauses CaseClause -- alt2 + | CaseClause -- alt1 + + CaseClause = + | case Expression ":" StatementList? -- alt1 + + DefaultClause = + | default ":" StatementList? -- alt1 + + LabelledStatement = + | LabelIdentifier ":" LabelledItem -- alt1 + + LabelledItem = + | Statement + | FunctionDeclaration + + ThrowStatement = + | throw ~lineTerminator Expression #sc -- alt1 + + TryStatement = + | try Block Catch -- alt1 + | try Block Finally -- alt2 + | try Block Catch Finally -- alt3 + + Catch = + | catch "(" CatchParameter ")" Block -- alt1 + | catch Block -- alt2 + + Finally = + | finally Block -- alt1 + + CatchParameter = + | BindingIdentifier + | BindingPattern + + DebuggerStatement = + | debugger #sc -- alt1 + + UniqueFormalParameters = + | FormalParameters + + FormalParameters = + | FunctionRestParameter -- alt2 + | FormalParameterList -- alt3 + | FormalParameterList "," -- alt4 + | FormalParameterList "," FunctionRestParameter -- alt5 + | /* empty */ -- alt1 + + FormalParameterList = + | FormalParameterList "," FormalParameter -- alt2 + | FormalParameter -- alt1 + + FunctionRestParameter = + | BindingRestElement + + FormalParameter = + | BindingElement + + FunctionDeclaration = + | function BindingIdentifier "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + | guardDefault function "(" FormalParameters ")" "{" FunctionBody "}" -- alt2 + + FunctionExpression = + | function BindingIdentifier? "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + + FunctionBody = + | FunctionStatementList + + FunctionStatementList = + | StatementList? + + ArrowFunction = + | ArrowParameters ~lineTerminator "=>" ConciseBody -- alt1 + + ArrowParameters = + | BindingIdentifier -- alt1 + | CoverParenthesizedExpressionAndArrowParameterList -- alt2 + + ConciseBody = + | ~"{" ExpressionBody -- alt1 + | "{" FunctionBody "}" -- alt2 + + ExpressionBody = + | AssignmentExpression + + ArrowFormalParameters = + | "(" UniqueFormalParameters ")" -- alt1 + + MethodDefinition = + | PropertyName "(" UniqueFormalParameters ")" "{" FunctionBody "}" -- alt1 + | GeneratorMethod -- alt2 + | AsyncMethod -- alt3 + | AsyncGeneratorMethod -- alt4 + | "get" PropertyName "(" ")" "{" FunctionBody "}" -- alt5 + | "set" PropertyName "(" PropertySetParameterList ")" "{" FunctionBody "}" -- alt6 + + PropertySetParameterList = + | FormalParameter + + GeneratorMethod = + | "*" PropertyName "(" UniqueFormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorDeclaration = + | function "*" BindingIdentifier "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + | guardDefault function "*" "(" FormalParameters ")" "{" GeneratorBody "}" -- alt2 + + GeneratorExpression = + | function "*" BindingIdentifier? "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorBody = + | FunctionBody + + YieldExpression = + | yield -- alt1 + | yield ~lineTerminator AssignmentExpression -- alt2 + | yield ~lineTerminator "*" AssignmentExpression -- alt3 + + AsyncGeneratorMethod = + | "async" ~lineTerminator "*" PropertyName "(" UniqueFormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorDeclaration = + | "async" ~lineTerminator function "*" BindingIdentifier "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "*" "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt2 + + AsyncGeneratorExpression = + | "async" ~lineTerminator function "*" BindingIdentifier? "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorBody = + | FunctionBody + + ClassDeclaration = + | class BindingIdentifier ClassTail -- alt1 + | guardDefault class ClassTail -- alt2 + + ClassExpression = + | class BindingIdentifier? ClassTail -- alt1 + + ClassTail = + | ClassHeritage? "{" ClassBody? "}" -- alt1 + + ClassHeritage = + | extends LeftHandSideExpression -- alt1 + + ClassBody = + | ClassElementList + + ClassElementList = + | ClassElementList ClassElement -- alt2 + | ClassElement -- alt1 + + ClassElement = + | MethodDefinition -- alt1 + | "static" MethodDefinition -- alt2 + | #sc -- alt3 + + AsyncFunctionDeclaration = + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncFunctionExpression = + | "async" ~lineTerminator function BindingIdentifier? "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + + AsyncMethod = + | "async" ~lineTerminator PropertyName "(" UniqueFormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + + AsyncFunctionBody = + | FunctionBody + + AwaitExpression = + | await UnaryExpression -- alt1 + + AsyncArrowFunction = + | "async" ~lineTerminator AsyncArrowBindingIdentifier ~lineTerminator "=>" AsyncConciseBody -- alt1 + | CoverCallExpressionAndAsyncArrowHead ~lineTerminator "=>" AsyncConciseBody -- alt2 + + AsyncConciseBody = + | ~"{" ExpressionBody -- alt1 + | "{" AsyncFunctionBody "}" -- alt2 + + AsyncArrowBindingIdentifier = + | BindingIdentifier + + CoverCallExpressionAndAsyncArrowHead = + | MemberExpression Arguments -- alt1 + + AsyncArrowHead = + | "async" ~lineTerminator ArrowFormalParameters -- alt1 + + Script = + | ScriptBody? + + ScriptBody = + | StatementList + + Module = + | ModuleBody? + + ModuleBody = + | ModuleItemList + + ModuleItemList = + | ModuleItem+ + + ModuleItem = + | ImportDeclaration + | ExportDeclaration + | StatementListItem + + ImportDeclaration = + | import ImportClause FromClause #sc -- alt1 + | import ModuleSpecifier #sc -- alt2 + + ImportClause = + | ImportedDefaultBinding -- alt1 + | NameSpaceImport -- alt2 + | NamedImports -- alt3 + | ImportedDefaultBinding "," NameSpaceImport -- alt4 + | ImportedDefaultBinding "," NamedImports -- alt5 + + ImportedDefaultBinding = + | ImportedBinding + + NameSpaceImport = + | "*" "as" ImportedBinding -- alt1 + + NamedImports = + | "{" "}" -- alt1 + | "{" ImportsList "}" -- alt2 + | "{" ImportsList "," "}" -- alt3 + + FromClause = + | "from" ModuleSpecifier -- alt1 + + ImportsList = + | ImportsList "," ImportSpecifier -- alt2 + | ImportSpecifier -- alt1 + + ImportSpecifier = + | ImportedBinding -- alt1 + | identifierName "as" ImportedBinding -- alt2 + + ModuleSpecifier = + | stringLiteral + + ImportedBinding = + | BindingIdentifier + + ExportDeclaration = + | export ExportFromClause FromClause #sc -- alt1 + | export NamedExports #sc -- alt2 + | export VariableStatement -- alt3 + | export Declaration -- alt4 + | export default HoistableDeclaration -- alt5 + | export default ClassDeclaration -- alt6 + | export default ~("function" | ("async" ~lineTerminator "function") | "class") AssignmentExpression #sc -- alt7 + + ExportFromClause = + | "*" -- alt1 + | "*" "as" identifierName -- alt2 + | NamedExports -- alt3 + + NamedExports = + | "{" "}" -- alt1 + | "{" ExportsList "}" -- alt2 + | "{" ExportsList "," "}" -- alt3 + + ExportsList = + | ExportsList "," ExportSpecifier -- alt2 + | ExportSpecifier -- alt1 + + ExportSpecifier = + | identifierName -- alt1 + | identifierName "as" identifierName -- alt2 + + stringNumericLiteral = + | strWhiteSpace? -- alt1 + | strWhiteSpace? strNumericLiteral strWhiteSpace? -- alt2 + + strWhiteSpace = + | strWhiteSpaceChar strWhiteSpace? -- alt1 + + strWhiteSpaceChar = + | whiteSpace + | lineTerminator + + strNumericLiteral = + | strDecimalLiteral + | nonDecimalIntegerLiteral + + strDecimalLiteral = + | strUnsignedDecimalLiteral -- alt1 + | "+" strUnsignedDecimalLiteral -- alt2 + | "-" strUnsignedDecimalLiteral -- alt3 + + strUnsignedDecimalLiteral = + | "Infinity" -- alt1 + | decimalDigits "." decimalDigits? exponentPart? -- alt2 + | "." decimalDigits exponentPart? -- alt3 + | decimalDigits exponentPart? -- alt4 + + uri = + | uriCharacters? + + uriCharacters = + | uriCharacter uriCharacters? -- alt1 + + uriCharacter = + | uriReserved + | uriUnescaped + | uriEscaped + + uriReserved = #sc | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," + + uriUnescaped = + | uriAlpha + | decimalDigit + | uriMark + + uriEscaped = + | "%" hexDigit hexDigit -- alt1 + + uriAlpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + uriMark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" + + NativeFunction = + | function NativeFunctionAccessor? PropertyName? "(" FormalParameters ")" "{" "[" "native" "code" "]" "}" -- alt1 + + NativeFunctionAccessor = + | "get" + | "set" + + pattern = + | disjunction + + disjunction = + | alternative -- alt1 + | alternative "|" disjunction -- alt2 + + alternative = + | alternative term -- alt2 + | /* empty */ -- alt1 + + term = + | assertion -- alt1 + | atom -- alt2 + | atom quantifier -- alt3 + + assertion = + | "^" -- alt1 + | "$" -- alt2 + | "\\" "b" -- alt3 + | "\\" "B" -- alt4 + | "(" "?" "=" disjunction ")" -- alt5 + | "(" "?" "!" disjunction ")" -- alt6 + | "(" "?" "<=" disjunction ")" -- alt7 + | "(" "?" " ")" -- alt8 + + quantifier = + | quantifierPrefix -- alt1 + | quantifierPrefix "?" -- alt2 + + quantifierPrefix = + | "*" -- alt1 + | "+" -- alt2 + | "?" -- alt3 + | "{" decimalDigits "}" -- alt4 + | "{" decimalDigits "," "}" -- alt5 + | "{" decimalDigits "," decimalDigits "}" -- alt6 + + atom = + | patternCharacter -- alt1 + | "." -- alt2 + | "\\" atomEscape -- alt3 + | characterClass -- alt4 + | "(" groupSpecifier disjunction ")" -- alt5 + | "(" "?" ":" disjunction ")" -- alt6 + + syntaxCharacter = "\\" | "^" | "$" | "." | "*" | "+" | "?" | "(" | ")" | "[" | "]" | "{" | "}" | "|" + + patternCharacter = + | ~syntaxCharacter sourceCharacter + + atomEscape = + | decimalEscape -- alt1 + | characterClassEscape -- alt2 + | characterEscape -- alt3 + | guardN "k" groupName -- alt4 + + characterEscape = + | controlEscape -- alt1 + | "c" controlLetter -- alt2 + | "0" ~decimalDigit -- alt3 + | hexEscapeSequence -- alt4 + | regExpUnicodeEscapeSequence -- alt5 + | identityEscape -- alt6 + + controlEscape = "f" | "n" | "r" | "t" | "v" + + controlLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + groupSpecifier = + | /* empty */ -- alt1 + | "?" groupName -- alt2 + + groupName = + | "<" regExpIdentifierName ">" -- alt1 + + regExpIdentifierName = + | regExpIdentifierName regExpIdentifierPart -- alt2 + | regExpIdentifierStart -- alt1 + + regExpIdentifierStart = + | unicodeIDStart -- alt1 + | "$" -- alt2 + | "_" -- alt3 + | "\\" regExpUnicodeEscapeSequence -- alt4 + | guardU unicodeLeadSurrogate unicodeTrailSurrogate -- alt5 + + regExpIdentifierPart = + | unicodeIDContinue -- alt1 + | "$" -- alt2 + | "\\" regExpUnicodeEscapeSequence -- alt3 + | guardU unicodeLeadSurrogate unicodeTrailSurrogate -- alt4 + | "" /* FIXME */ -- alt5 + | "" /* FIXME */ -- alt6 + + regExpUnicodeEscapeSequence = + | guardU "u" hexLeadSurrogate "\\u" hexTrailSurrogate -- alt1 + | guardU "u" hexLeadSurrogate -- alt2 + | guardU "u" hexTrailSurrogate -- alt3 + | guardU "u" hexNonSurrogate -- alt4 + | guardU "u" hex4Digits -- alt5 + | guardU "u{" codePoint "}" -- alt6 + + unicodeLeadSurrogate = /* any Unicode code point in the inclusive range 0xD800 to 0xDBFF */ + + unicodeTrailSurrogate = /* any Unicode code point in the inclusive range 0xDC00 to 0xDFFF */ + + hexLeadSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the MV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF */ -- alt1 + + hexTrailSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the MV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF */ -- alt1 + + hexNonSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the MV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF */ -- alt1 + + identityEscape = + | guardU syntaxCharacter -- alt1 + | guardU "/" -- alt2 + | guardU ~unicodeIDContinue sourceCharacter -- alt3 + + decimalEscape = + | nonZeroDigit decimalDigits? ~decimalDigit -- alt1 + + characterClassEscape = + | "d" -- alt1 + | "D" -- alt2 + | "s" -- alt3 + | "S" -- alt4 + | "w" -- alt5 + | "W" -- alt6 + | guardU "p{" unicodePropertyValueExpression "}" -- alt7 + | guardU "P{" unicodePropertyValueExpression "}" -- alt8 + + unicodePropertyValueExpression = + | unicodePropertyName "=" unicodePropertyValue -- alt1 + | loneUnicodePropertyNameOrValue -- alt2 + + unicodePropertyName = + | unicodePropertyNameCharacters + + unicodePropertyNameCharacters = + | unicodePropertyNameCharacter unicodePropertyNameCharacters? -- alt1 + + unicodePropertyValue = + | unicodePropertyValueCharacters + + loneUnicodePropertyNameOrValue = + | unicodePropertyValueCharacters + + unicodePropertyValueCharacters = + | unicodePropertyValueCharacter unicodePropertyValueCharacters? -- alt1 + + unicodePropertyValueCharacter = + | unicodePropertyNameCharacter + | decimalDigit + + unicodePropertyNameCharacter = + | controlLetter + | "_" + + characterClass = + | "[" ~"^" classRanges "]" -- alt1 + | "[" "^" classRanges "]" -- alt2 + + classRanges = + | /* empty */ -- alt1 + | nonemptyClassRanges -- alt2 + + nonemptyClassRanges = + | classAtom -- alt1 + | classAtom nonemptyClassRangesNoDash -- alt2 + | classAtom "-" classAtom classRanges -- alt3 + + nonemptyClassRangesNoDash = + | classAtom -- alt1 + | classAtomNoDash nonemptyClassRangesNoDash -- alt2 + | classAtomNoDash "-" classAtom classRanges -- alt3 + + classAtom = + | "-" + | classAtomNoDash + + classAtomNoDash = + | ~("\\" | "]" | "-") sourceCharacter -- alt1 + | "\\" classEscape -- alt2 + + classEscape = + | "b" -- alt1 + | guardU "-" -- alt2 + | characterClassEscape -- alt3 + | characterEscape -- alt4 + + withSep = /* fixme */ + + noSep = ~any /* is this right? */ + + withYield = /* fixme */ + + noYield = ~any /* is this right? */ + + withAwait = /* fixme */ + + noAwait = ~any /* is this right? */ + + withIn = /* fixme */ + + noIn = ~any /* is this right? */ + + withTagged = /* fixme */ + + noTagged = ~any /* is this right? */ + + withReturn = /* fixme */ + + noReturn = ~any /* is this right? */ + + withDefault = /* fixme */ + + noDefault = ~any /* is this right? */ + + withU = /* fixme */ + + noU = ~any /* is this right? */ + + withN = /* fixme */ + + noN = ~any /* is this right? */ + + await = "await" ~identifierPart + break = "break" ~identifierPart + case = "case" ~identifierPart + catch = "catch" ~identifierPart + class = "class" ~identifierPart + const = "const" ~identifierPart + continue = "continue" ~identifierPart + debugger = "debugger" ~identifierPart + default = "default" ~identifierPart + delete = "delete" ~identifierPart + do = "do" ~identifierPart + else = "else" ~identifierPart + enum = "enum" ~identifierPart + export = "export" ~identifierPart + extends = "extends" ~identifierPart + false = "false" ~identifierPart + finally = "finally" ~identifierPart + for = "for" ~identifierPart + function = "function" ~identifierPart + if = "if" ~identifierPart + import = "import" ~identifierPart + in = "in" ~identifierPart + instanceof = "instanceof" ~identifierPart + new = "new" ~identifierPart + null = "null" ~identifierPart + return = "return" ~identifierPart + super = "super" ~identifierPart + switch = "switch" ~identifierPart + this = "this" ~identifierPart + throw = "throw" ~identifierPart + true = "true" ~identifierPart + try = "try" ~identifierPart + typeof = "typeof" ~identifierPart + var = "var" ~identifierPart + void = "void" ~identifierPart + while = "while" ~identifierPart + with = "with" ~identifierPart + yield = "yield" ~identifierPart +} diff --git a/examples/ecmascript/gen/es2022.grammar.ohm b/examples/ecmascript/gen/es2022.grammar.ohm new file mode 100644 index 00000000..c62b41db --- /dev/null +++ b/examples/ecmascript/gen/es2022.grammar.ohm @@ -0,0 +1,1590 @@ +ES2022 { + + Start = Script + + // Override Ohm's built-in definition of space. + space := whiteSpace | lineTerminator | comment + + unicodeZs = "\xA0" | "\u1680" | "\u2000".."\u200A" | "\u202F" | "\u205F" | "\u3000" + + multiLineCommentNoNL = "/*" (~("*/" | lineTerminator) sourceCharacter)* "*/" + + // does not accept lineTerminators, not even implicit ones in a multiLineComment (cf. section 7.4) + spacesNoNL = (whiteSpace | singleLineComment | multiLineCommentNoNL)* + + // A semicolon is "automatically inserted" if a newline or the end of the input stream is + // reached, or the offending token is "}". + // See https://es5.github.io/#x7.9 for more information. + // NOTE: Applications of this rule *must* appear in a lexical context -- either in the body of a + // lexical rule, or inside '#()'. + sc = space* (";" | end) + | spacesNoNL (lineTerminator | ~multiLineCommentNoNL multiLineComment | &"}") + + sourceCharacter = any + + inputElementDiv = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | rightBracePunctuator + + inputElementRegExp = + | whiteSpace + | lineTerminator + | comment + | commonToken + | rightBracePunctuator + | regularExpressionLiteral + + inputElementRegExpOrTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | regularExpressionLiteral + | templateSubstitutionTail + + inputElementTemplateTail = + | whiteSpace + | lineTerminator + | comment + | commonToken + | divPunctuator + | templateSubstitutionTail + + whiteSpace = + | "\t" + | "\x0B" + | "\x0C" + | "\uFEFF" + | unicodeZs + + lineTerminator = + | "\n" + | "\r" + | "\u2028" + | "\u2029" + + lineTerminatorSequence = + | "\n" -- alt1 + | "\r" ~"\n" -- alt2 + | "\u2028" -- alt3 + | "\u2029" -- alt4 + | "\r" "\n" -- alt5 + + comment = + | multiLineComment + | singleLineComment + + multiLineComment = + | "/*" multiLineCommentChars? "*/" -- alt1 + + multiLineCommentChars = + (~"*/" sourceCharacter)* + + postAsteriskCommentChars = + | multiLineNotForwardSlashOrAsteriskChar multiLineCommentChars? -- alt1 + | "*" ~"/" postAsteriskCommentChars? -- alt2 + + multiLineNotAsteriskChar = + | ~"*" sourceCharacter + + multiLineNotForwardSlashOrAsteriskChar = + | ~("/" | "*") sourceCharacter + + singleLineComment = + | "//" singleLineCommentChars? -- alt1 + + singleLineCommentChars = + | singleLineCommentChar+ + + singleLineCommentChar = + | ~lineTerminator sourceCharacter + + commonToken = + | identifierName + | privateIdentifier + | punctuator + | numericLiteral + | stringLiteral + | template + + privateIdentifier = + | "#" identifierName -- alt1 + + identifierName = + | identifierName identifierPart -- alt2 + | identifierStart -- alt1 + + identifierStart = + | identifierStartChar -- alt1 + | "\\" unicodeEscapeSequence -- alt2 + + identifierPart = + | "\\" unicodeEscapeSequence -- alt2 + | identifierPartChar -- alt1 + + identifierStartChar = + | unicodeIDStart + | "$" + | "_" + + identifierPartChar = + | unicodeIDContinue + | "$" + | "" /* FIXME */ + | "" /* FIXME */ + + unicodeIDStart = letter /* fixme */ + + unicodeIDContinue = letter | digit /* fixme */ + + reservedWord = instanceof | continue | debugger | function | default | extends | finally | delete | export | import | return | switch | typeof | await | break | catch | class | const | false | super | throw | while | yield | case | else | enum | null | this | true | void | with | for | new | try | var | do | if | in + + punctuator = + | optionalChainingPunctuator + | otherPunctuator + + optionalChainingPunctuator = + | "?." ~decimalDigit -- alt1 + + otherPunctuator = ">>>=" | "..." | "===" | "!==" | ">>>" | "**=" | "<<=" | ">>=" | "&&=" | "||=" | "??=" | "<=" | ">=" | "==" | "!=" | "**" | "++" | "--" | "<<" | ">>" | "&&" | "||" | "??" | "+=" | "-=" | "*=" | "%=" | "&=" | "|=" | "^=" | "=>" | "{" | "(" | ")" | "[" | "]" | "." | #sc | "," | "<" | ">" | "+" | "-" | "*" | "%" | "&" | "|" | "^" | "!" | "~" | "?" | ":" | "=" + + divPunctuator = + | "/" + | "/=" + + rightBracePunctuator = + | "}" + + nullLiteral = + | null + + booleanLiteral = + | true + | false + + numericLiteralSeparator = + | "_" + + numericLiteral = + + | decimalBigIntegerLiteral -- alt2 + | nonDecimalIntegerLiteral -- alt3 + | nonDecimalIntegerLiteral bigIntLiteralSuffix -- alt4 + | legacyOctalIntegerLiteral -- alt5 + | decimalLiteral -- alt1 + + decimalBigIntegerLiteral = + | "0" bigIntLiteralSuffix -- alt1 + | nonZeroDigit decimalDigits? bigIntLiteralSuffix -- alt2 + | nonZeroDigit numericLiteralSeparator decimalDigits bigIntLiteralSuffix -- alt3 + + nonDecimalIntegerLiteral = + | binaryIntegerLiteral + | octalIntegerLiteral + | hexIntegerLiteral + + bigIntLiteralSuffix = + | "n" + + decimalLiteral = + | decimalIntegerLiteral "." decimalDigits? exponentPart? -- alt1 + | "." decimalDigits exponentPart? -- alt2 + | decimalIntegerLiteral exponentPart? -- alt3 + + decimalIntegerLiteral = + | "0" -- alt1 + | nonZeroDigit -- alt2 + | nonZeroDigit numericLiteralSeparator? decimalDigits -- alt3 + | nonOctalDecimalIntegerLiteral -- alt4 + + decimalDigits = + | decimalDigits decimalDigit -- alt2 + | decimalDigit -- alt1 + | guardSep decimalDigits numericLiteralSeparator decimalDigit -- alt3 + + decimalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + nonZeroDigit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" + + exponentPart = + | exponentIndicator signedInteger -- alt1 + + exponentIndicator = "e" | "E" + + signedInteger = + | decimalDigits -- alt1 + | "+" decimalDigits -- alt2 + | "-" decimalDigits -- alt3 + + binaryIntegerLiteral = + | "0b" binaryDigits -- alt1 + | "0B" binaryDigits -- alt2 + + binaryDigits = + | binaryDigits binaryDigit -- alt2 + | binaryDigit -- alt1 + | guardSep binaryDigits numericLiteralSeparator binaryDigit -- alt3 + + binaryDigit = "0" | "1" + + octalIntegerLiteral = + | "0o" octalDigits -- alt1 + | "0O" octalDigits -- alt2 + + octalDigits = + | octalDigits octalDigit -- alt2 + | octalDigit -- alt1 + | guardSep octalDigits numericLiteralSeparator octalDigit -- alt3 + + legacyOctalIntegerLiteral = + | legacyOctalIntegerLiteral octalDigit -- alt2 + | "0" octalDigit -- alt1 + + nonOctalDecimalIntegerLiteral = + | nonOctalDecimalIntegerLiteral decimalDigit -- alt3 + | "0" nonOctalDigit -- alt1 + | legacyOctalLikeDecimalIntegerLiteral nonOctalDigit -- alt2 + + legacyOctalLikeDecimalIntegerLiteral = + | legacyOctalLikeDecimalIntegerLiteral octalDigit -- alt2 + | "0" octalDigit -- alt1 + + octalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" + + nonOctalDigit = "8" | "9" + + hexIntegerLiteral = + | "0x" hexDigits -- alt1 + | "0X" hexDigits -- alt2 + + hexDigits = + | hexDigits hexDigit -- alt2 + | hexDigit -- alt1 + | guardSep hexDigits numericLiteralSeparator hexDigit -- alt3 + + hexDigit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F" + + stringLiteral = + | "\"" doubleStringCharacters? "\"" -- alt1 + | "'" singleStringCharacters? "'" -- alt2 + + doubleStringCharacters = + | doubleStringCharacter+ + + singleStringCharacters = + | singleStringCharacter+ + + doubleStringCharacter = + | ~("\"" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\u2028" -- alt2 + | "\u2029" -- alt3 + | "\\" escapeSequence -- alt4 + | lineContinuation -- alt5 + + singleStringCharacter = + | ~("'" | "\\" | lineTerminator) sourceCharacter -- alt1 + | "\u2028" -- alt2 + | "\u2029" -- alt3 + | "\\" escapeSequence -- alt4 + | lineContinuation -- alt5 + + lineContinuation = + | "\\" lineTerminatorSequence -- alt1 + + escapeSequence = + | characterEscapeSequence -- alt1 + | "0" ~decimalDigit -- alt2 + | legacyOctalEscapeSequence -- alt3 + | nonOctalDecimalEscapeSequence -- alt4 + | hexEscapeSequence -- alt5 + | unicodeEscapeSequence -- alt6 + + characterEscapeSequence = + | singleEscapeCharacter + | nonEscapeCharacter + + singleEscapeCharacter = "\"" | "\\" | "'" | "b" | "f" | "n" | "r" | "t" | "v" + + nonEscapeCharacter = + | ~(escapeCharacter | lineTerminator) sourceCharacter + + escapeCharacter = + | singleEscapeCharacter + | decimalDigit + | "x" + | "u" + + legacyOctalEscapeSequence = + | "0" &("8" | "9") -- alt1 + | nonZeroOctalDigit ~octalDigit -- alt2 + | zeroToThree octalDigit ~octalDigit -- alt3 + | fourToSeven octalDigit -- alt4 + | zeroToThree octalDigit octalDigit -- alt5 + + nonZeroOctalDigit = + | ~"0" octalDigit + + zeroToThree = "0" | "1" | "2" | "3" + + fourToSeven = "4" | "5" | "6" | "7" + + nonOctalDecimalEscapeSequence = "8" | "9" + + hexEscapeSequence = + | "x" hexDigit hexDigit -- alt1 + + unicodeEscapeSequence = + | "u" hex4Digits -- alt1 + | "u{" codePoint "}" -- alt2 + + hex4Digits = + | hexDigit hexDigit hexDigit hexDigit -- alt1 + + regularExpressionLiteral = + | "/" regularExpressionBody "/" regularExpressionFlags -- alt1 + + regularExpressionBody = + | regularExpressionFirstChar regularExpressionChars -- alt1 + + regularExpressionChars = + | regularExpressionChars regularExpressionChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionFirstChar = + | ~("*" | "\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionChar = + | ~("\\" | "/" | "[") regularExpressionNonTerminator + | regularExpressionBackslashSequence + | regularExpressionClass + + regularExpressionBackslashSequence = + | "\\" regularExpressionNonTerminator -- alt1 + + regularExpressionNonTerminator = + | ~lineTerminator sourceCharacter + + regularExpressionClass = + | "[" regularExpressionClassChars "]" -- alt1 + + regularExpressionClassChars = + | regularExpressionClassChars regularExpressionClassChar -- alt2 + | /* empty */ -- alt1 + + regularExpressionClassChar = + | ~("]" | "\\") regularExpressionNonTerminator + | regularExpressionBackslashSequence + + regularExpressionFlags = + | regularExpressionFlags identifierPartChar -- alt2 + | /* empty */ -- alt1 + + template = + | noSubstitutionTemplate + | templateHead + + noSubstitutionTemplate = + | "`" templateCharacters? "`" -- alt1 + + templateHead = + | "`" templateCharacters? "${" -- alt1 + + templateSubstitutionTail = + | templateMiddle + | templateTail + + templateMiddle = + | "}" templateCharacters? "${" -- alt1 + + templateTail = + | "}" templateCharacters? "`" -- alt1 + + templateCharacters = + | templateCharacter+ + + templateCharacter = + | "$" ~"{" -- alt1 + | "\\" templateEscapeSequence -- alt2 + | "\\" notEscapeSequence -- alt3 + | lineContinuation -- alt4 + | lineTerminatorSequence -- alt5 + | ~("`" | "\\" | "$" | lineTerminator) sourceCharacter -- alt6 + + templateEscapeSequence = + | characterEscapeSequence -- alt1 + | "0" ~decimalDigit -- alt2 + | hexEscapeSequence -- alt3 + | unicodeEscapeSequence -- alt4 + + notEscapeSequence = + | "0" decimalDigit -- alt1 + | ~"0" decimalDigit -- alt2 + | "x" ~hexDigit -- alt3 + | "x" hexDigit ~hexDigit -- alt4 + | "u" ~hexDigit ~"{" -- alt5 + | "u" hexDigit ~hexDigit -- alt6 + | "u" hexDigit hexDigit ~hexDigit -- alt7 + | "u" hexDigit hexDigit hexDigit ~hexDigit -- alt8 + | "u" "{" ~hexDigit -- alt9 + | "u" "{" notCodePoint ~hexDigit -- alt10 + | "u" "{" codePoint ~hexDigit ~"}" -- alt11 + + notCodePoint = + | hexDigits /* FIXME Assertion: > but only if MV of |HexDigits| > 0x10FFFF */ -- alt1 + + codePoint = + | hexDigits /* FIXME Assertion: > but only if MV of |HexDigits| ≤ 0x10FFFF */ -- alt1 + + IdentifierReference = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + BindingIdentifier = + | Identifier + | yield + | await + + LabelIdentifier = + | Identifier -- alt1 + | guardYield yield -- alt2 + | guardAwait await -- alt3 + + Identifier = + | ~reservedWord identifierName + + PrimaryExpression = + | this -- alt1 + | IdentifierReference -- alt2 + | Literal -- alt3 + | ArrayLiteral -- alt4 + | ObjectLiteral -- alt5 + | FunctionExpression -- alt6 + | ClassExpression -- alt7 + | GeneratorExpression -- alt8 + | AsyncFunctionExpression -- alt9 + | AsyncGeneratorExpression -- alt10 + | regularExpressionLiteral -- alt11 + | TemplateLiteral -- alt12 + | CoverParenthesizedExpressionAndArrowParameterList -- alt13 + + CoverParenthesizedExpressionAndArrowParameterList = + | "(" Expression ")" -- alt1 + | "(" Expression "," ")" -- alt2 + | "(" ")" -- alt3 + | "(" "..." BindingIdentifier ")" -- alt4 + | "(" "..." BindingPattern ")" -- alt5 + | "(" Expression "," "..." BindingIdentifier ")" -- alt6 + | "(" Expression "," "..." BindingPattern ")" -- alt7 + + ParenthesizedExpression = + | "(" Expression ")" -- alt1 + + Literal = + | nullLiteral + | booleanLiteral + | numericLiteral + | stringLiteral + + ArrayLiteral = + | "[" Elision? "]" -- alt1 + | "[" ElementList "]" -- alt2 + | "[" ElementList "," Elision? "]" -- alt3 + + ElementList = + | ElementList "," Elision? AssignmentExpression -- alt3 + | ElementList "," Elision? SpreadElement -- alt4 + | Elision? AssignmentExpression -- alt1 + | Elision? SpreadElement -- alt2 + + Elision = + | Elision "," -- alt2 + | "," -- alt1 + + SpreadElement = + | "..." AssignmentExpression -- alt1 + + ObjectLiteral = + | "{" "}" -- alt1 + | "{" PropertyDefinitionList "}" -- alt2 + | "{" PropertyDefinitionList "," "}" -- alt3 + + PropertyDefinitionList = + | PropertyDefinitionList "," PropertyDefinition -- alt2 + | PropertyDefinition -- alt1 + + PropertyDefinition = + | "..." AssignmentExpression -- alt5 + | MethodDefinition -- alt4 + | PropertyName ":" AssignmentExpression -- alt3 + | IdentifierReference -- alt1 + | CoverInitializedName -- alt2 + + PropertyName = + | LiteralPropertyName + | ComputedPropertyName + + LiteralPropertyName = + | identifierName + | stringLiteral + | numericLiteral + + ComputedPropertyName = + | "[" AssignmentExpression "]" -- alt1 + + CoverInitializedName = + | IdentifierReference Initializer -- alt1 + + Initializer = + | "=" AssignmentExpression -- alt1 + + TemplateLiteral = + | noSubstitutionTemplate + | SubstitutionTemplate + + SubstitutionTemplate = + | templateHead Expression TemplateSpans -- alt1 + + TemplateSpans = + | templateTail -- alt1 + | TemplateMiddleList templateTail -- alt2 + + TemplateMiddleList = + | TemplateMiddleList templateMiddle Expression -- alt2 + | templateMiddle Expression -- alt1 + + MemberExpression = + | MemberExpression "[" Expression "]" -- alt2 + | MemberExpression "." identifierName -- alt3 + | MemberExpression TemplateLiteral -- alt4 + | MemberExpression "." privateIdentifier -- alt8 + | new MemberExpression Arguments -- alt7 + | PrimaryExpression -- alt1 + | SuperProperty -- alt5 + | MetaProperty -- alt6 + + SuperProperty = + | super "[" Expression "]" -- alt1 + | super "." identifierName -- alt2 + + MetaProperty = + | NewTarget + | ImportMeta + + NewTarget = + | new "." "target" -- alt1 + + ImportMeta = + | import "." "meta" -- alt1 + + NewExpression = + | MemberExpression -- alt1 + | new NewExpression -- alt2 + + CallExpression = + | CallExpression Arguments -- alt4 + | CallExpression "[" Expression "]" -- alt5 + | CallExpression "." identifierName -- alt6 + | CallExpression TemplateLiteral -- alt7 + | CallExpression "." privateIdentifier -- alt8 + | CoverCallExpressionAndAsyncArrowHead -- alt1 + | SuperCall -- alt2 + | ImportCall -- alt3 + + SuperCall = + | super Arguments -- alt1 + + ImportCall = + | import "(" AssignmentExpression ")" -- alt1 + + Arguments = + | "(" ")" -- alt1 + | "(" ArgumentList ")" -- alt2 + | "(" ArgumentList "," ")" -- alt3 + + ArgumentList = + | ArgumentList "," AssignmentExpression -- alt3 + | ArgumentList "," "..." AssignmentExpression -- alt4 + | AssignmentExpression -- alt1 + | "..." AssignmentExpression -- alt2 + + OptionalExpression = + | OptionalExpression OptionalChain -- alt3 + | MemberExpression OptionalChain -- alt1 + | CallExpression OptionalChain -- alt2 + + OptionalChain = + | OptionalChain Arguments -- alt6 + | OptionalChain "[" Expression "]" -- alt7 + | OptionalChain "." identifierName -- alt8 + | OptionalChain TemplateLiteral -- alt9 + | OptionalChain "." privateIdentifier -- alt10 + | "?." Arguments -- alt1 + | "?." "[" Expression "]" -- alt2 + | "?." identifierName -- alt3 + | "?." TemplateLiteral -- alt4 + | "?." privateIdentifier -- alt5 + + LeftHandSideExpression = + | CallExpression + | NewExpression + | OptionalExpression + + CallMemberExpression = + | MemberExpression Arguments -- alt1 + + UpdateExpression = + | LeftHandSideExpression -- alt1 + | LeftHandSideExpression ~lineTerminator "++" -- alt2 + | LeftHandSideExpression ~lineTerminator "--" -- alt3 + | "++" UnaryExpression -- alt4 + | "--" UnaryExpression -- alt5 + + UnaryExpression = + | delete UnaryExpression -- alt2 + | void UnaryExpression -- alt3 + | typeof UnaryExpression -- alt4 + | "+" UnaryExpression -- alt5 + | "-" UnaryExpression -- alt6 + | "~" UnaryExpression -- alt7 + | "!" UnaryExpression -- alt8 + | guardAwait AwaitExpression -- alt9 + | UpdateExpression -- alt1 + + ExponentiationExpression = + | UnaryExpression -- alt1 + | UpdateExpression "**" ExponentiationExpression -- alt2 + + MultiplicativeExpression = + | MultiplicativeExpression MultiplicativeOperator ExponentiationExpression -- alt2 + | ExponentiationExpression -- alt1 + + MultiplicativeOperator = "*" | "/" | "%" + + AdditiveExpression = + | AdditiveExpression "+" MultiplicativeExpression -- alt2 + | AdditiveExpression "-" MultiplicativeExpression -- alt3 + | MultiplicativeExpression -- alt1 + + ShiftExpression = + | ShiftExpression "<<" AdditiveExpression -- alt2 + | ShiftExpression ">>" AdditiveExpression -- alt3 + | ShiftExpression ">>>" AdditiveExpression -- alt4 + | AdditiveExpression -- alt1 + + RelationalExpression = + | RelationalExpression "<" ShiftExpression -- alt2 + | RelationalExpression ">" ShiftExpression -- alt3 + | RelationalExpression "<=" ShiftExpression -- alt4 + | RelationalExpression ">=" ShiftExpression -- alt5 + | RelationalExpression instanceof ShiftExpression -- alt6 + | RelationalExpression guardIn in ShiftExpression -- alt7 + | ShiftExpression -- alt1 + | guardIn privateIdentifier in ShiftExpression -- alt8 + + EqualityExpression = + | EqualityExpression "==" RelationalExpression -- alt2 + | EqualityExpression "!=" RelationalExpression -- alt3 + | EqualityExpression "===" RelationalExpression -- alt4 + | EqualityExpression "!==" RelationalExpression -- alt5 + | RelationalExpression -- alt1 + + BitwiseANDExpression = + | BitwiseANDExpression "&" EqualityExpression -- alt2 + | EqualityExpression -- alt1 + + BitwiseXORExpression = + | BitwiseXORExpression "^" BitwiseANDExpression -- alt2 + | BitwiseANDExpression -- alt1 + + BitwiseORExpression = + | BitwiseORExpression "|" BitwiseXORExpression -- alt2 + | BitwiseXORExpression -- alt1 + + LogicalANDExpression = + | LogicalANDExpression "&&" BitwiseORExpression -- alt2 + | BitwiseORExpression -- alt1 + + LogicalORExpression = + | LogicalORExpression "||" LogicalANDExpression -- alt2 + | LogicalANDExpression -- alt1 + + CoalesceExpression = + | CoalesceExpressionHead "??" BitwiseORExpression -- alt1 + + CoalesceExpressionHead = + | CoalesceExpression + | BitwiseORExpression + + ShortCircuitExpression = + | LogicalORExpression + | CoalesceExpression + + ConditionalExpression = + | ShortCircuitExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2 + | ShortCircuitExpression -- alt1 + + AssignmentExpression = + | AsyncArrowFunction -- alt4 + | ArrowFunction -- alt3 + | LeftHandSideExpression "=" AssignmentExpression -- alt5 + | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6 + | ConditionalExpression -- alt1 + | guardYield YieldExpression -- alt2 + | LeftHandSideExpression "&&=" AssignmentExpression -- alt7 + | LeftHandSideExpression "||=" AssignmentExpression -- alt8 + | LeftHandSideExpression "??=" AssignmentExpression -- alt9 + + AssignmentOperator = ">>>=" | "<<=" | ">>=" | "**=" | "*=" | "/=" | "%=" | "+=" | "-=" | "&=" | "^=" | "|=" + + AssignmentPattern = + | ObjectAssignmentPattern + | ArrayAssignmentPattern + + ObjectAssignmentPattern = + | "{" "}" -- alt1 + | "{" AssignmentRestProperty "}" -- alt2 + | "{" AssignmentPropertyList "}" -- alt3 + | "{" AssignmentPropertyList "," AssignmentRestProperty? "}" -- alt4 + + ArrayAssignmentPattern = + | "[" Elision? AssignmentRestElement? "]" -- alt1 + | "[" AssignmentElementList "]" -- alt2 + | "[" AssignmentElementList "," Elision? AssignmentRestElement? "]" -- alt3 + + AssignmentRestProperty = + | "..." DestructuringAssignmentTarget -- alt1 + + AssignmentPropertyList = + | AssignmentPropertyList "," AssignmentProperty -- alt2 + | AssignmentProperty -- alt1 + + AssignmentElementList = + | AssignmentElementList "," AssignmentElisionElement -- alt2 + | AssignmentElisionElement -- alt1 + + AssignmentElisionElement = + | Elision? AssignmentElement -- alt1 + + AssignmentProperty = + | IdentifierReference Initializer? -- alt1 + | PropertyName ":" AssignmentElement -- alt2 + + AssignmentElement = + | DestructuringAssignmentTarget Initializer? -- alt1 + + AssignmentRestElement = + | "..." DestructuringAssignmentTarget -- alt1 + + DestructuringAssignmentTarget = + | LeftHandSideExpression + + Expression = + | Expression "," AssignmentExpression -- alt2 + | AssignmentExpression -- alt1 + + Statement = + | BlockStatement -- alt1 + | VariableStatement -- alt2 + | EmptyStatement -- alt3 + | ExpressionStatement -- alt4 + | IfStatement -- alt5 + | BreakableStatement -- alt6 + | ContinueStatement -- alt7 + | BreakStatement -- alt8 + | guardReturn ReturnStatement -- alt9 + | WithStatement -- alt10 + | LabelledStatement -- alt11 + | ThrowStatement -- alt12 + | TryStatement -- alt13 + | DebuggerStatement -- alt14 + + Declaration = + | HoistableDeclaration + | ClassDeclaration + | LexicalDeclaration + + HoistableDeclaration = + | FunctionDeclaration + | GeneratorDeclaration + | AsyncFunctionDeclaration + | AsyncGeneratorDeclaration + + BreakableStatement = + | IterationStatement + | SwitchStatement + + BlockStatement = + | Block + + Block = + | "{" StatementList? "}" -- alt1 + + StatementList = + | StatementListItem+ + + StatementListItem = + | Statement + | Declaration + + LexicalDeclaration = + | LetOrConst BindingList #sc -- alt1 + + LetOrConst = + | "let" + | const + + BindingList = + | BindingList "," LexicalBinding -- alt2 + | LexicalBinding -- alt1 + + LexicalBinding = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + VariableStatement = + | var VariableDeclarationList #sc -- alt1 + + VariableDeclarationList = + | VariableDeclarationList "," VariableDeclaration -- alt2 + | VariableDeclaration -- alt1 + + VariableDeclaration = + | BindingIdentifier Initializer? -- alt1 + | BindingPattern Initializer -- alt2 + + BindingPattern = + | ObjectBindingPattern + | ArrayBindingPattern + + ObjectBindingPattern = + | "{" "}" -- alt1 + | "{" BindingRestProperty "}" -- alt2 + | "{" BindingPropertyList "}" -- alt3 + | "{" BindingPropertyList "," BindingRestProperty? "}" -- alt4 + + ArrayBindingPattern = + | "[" Elision? BindingRestElement? "]" -- alt1 + | "[" BindingElementList "]" -- alt2 + | "[" BindingElementList "," Elision? BindingRestElement? "]" -- alt3 + + BindingRestProperty = + | "..." BindingIdentifier -- alt1 + + BindingPropertyList = + | BindingPropertyList "," BindingProperty -- alt2 + | BindingProperty -- alt1 + + BindingElementList = + | BindingElementList "," BindingElisionElement -- alt2 + | BindingElisionElement -- alt1 + + BindingElisionElement = + | Elision? BindingElement -- alt1 + + BindingProperty = + | SingleNameBinding -- alt1 + | PropertyName ":" BindingElement -- alt2 + + BindingElement = + | SingleNameBinding -- alt1 + | BindingPattern Initializer? -- alt2 + + SingleNameBinding = + | BindingIdentifier Initializer? -- alt1 + + BindingRestElement = + | "..." BindingIdentifier -- alt1 + | "..." BindingPattern -- alt2 + + EmptyStatement = ";" // note: this semicolon eats newlines + + ExpressionStatement = + | ~("{" | "function" | ("async" ~lineTerminator "function") | "class" | ("let" "[")) Expression #sc -- alt1 + + IfStatement = + | if "(" Expression ")" Statement else Statement -- alt1 + | if "(" Expression ")" Statement ~"else" -- alt2 + + IterationStatement = + | DoWhileStatement + | WhileStatement + | ForStatement + | ForInOfStatement + + DoWhileStatement = + | do Statement while "(" Expression ")" #sc -- alt1 + + WhileStatement = + | while "(" Expression ")" Statement -- alt1 + + ForStatement = + | for "(" ~("let"|"[") Expression? #sc Expression? #sc Expression? ")" Statement -- alt1 + | for "(" var VariableDeclarationList #sc Expression? #sc Expression? ")" Statement -- alt2 + | for "(" LexicalDeclaration Expression? #sc Expression? ")" Statement -- alt3 + + ForInOfStatement = + | for "(" ~("let"|"[") LeftHandSideExpression in Expression ")" Statement -- alt1 + | for "(" var ForBinding in Expression ")" Statement -- alt2 + | for "(" ForDeclaration in Expression ")" Statement -- alt3 + | for "(" ~("let" | ("async" "of")) LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt4 + | for "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt5 + | for "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt6 + | guardAwait for await "(" ~"let" LeftHandSideExpression "of" AssignmentExpression ")" Statement -- alt7 + | guardAwait for await "(" var ForBinding "of" AssignmentExpression ")" Statement -- alt8 + | guardAwait for await "(" ForDeclaration "of" AssignmentExpression ")" Statement -- alt9 + + ForDeclaration = + | LetOrConst ForBinding -- alt1 + + ForBinding = + | BindingIdentifier + | BindingPattern + + ContinueStatement = + | continue #sc -- alt1 + | continue ~lineTerminator LabelIdentifier #sc -- alt2 + + BreakStatement = + | break #sc -- alt1 + | break ~lineTerminator LabelIdentifier #sc -- alt2 + + ReturnStatement = + | return #sc -- alt1 + | return ~lineTerminator Expression #sc -- alt2 + + WithStatement = + | with "(" Expression ")" Statement -- alt1 + + SwitchStatement = + | switch "(" Expression ")" CaseBlock -- alt1 + + CaseBlock = + | "{" CaseClauses? "}" -- alt1 + | "{" CaseClauses? DefaultClause CaseClauses? "}" -- alt2 + + CaseClauses = + | CaseClauses CaseClause -- alt2 + | CaseClause -- alt1 + + CaseClause = + | case Expression ":" StatementList? -- alt1 + + DefaultClause = + | default ":" StatementList? -- alt1 + + LabelledStatement = + | LabelIdentifier ":" LabelledItem -- alt1 + + LabelledItem = + | Statement + | FunctionDeclaration + + ThrowStatement = + | throw ~lineTerminator Expression #sc -- alt1 + + TryStatement = + | try Block Catch -- alt1 + | try Block Finally -- alt2 + | try Block Catch Finally -- alt3 + + Catch = + | catch "(" CatchParameter ")" Block -- alt1 + | catch Block -- alt2 + + Finally = + | finally Block -- alt1 + + CatchParameter = + | BindingIdentifier + | BindingPattern + + DebuggerStatement = + | debugger #sc -- alt1 + + UniqueFormalParameters = + | FormalParameters + + FormalParameters = + | FunctionRestParameter -- alt2 + | FormalParameterList -- alt3 + | FormalParameterList "," -- alt4 + | FormalParameterList "," FunctionRestParameter -- alt5 + | /* empty */ -- alt1 + + FormalParameterList = + | FormalParameterList "," FormalParameter -- alt2 + | FormalParameter -- alt1 + + FunctionRestParameter = + | BindingRestElement + + FormalParameter = + | BindingElement + + FunctionDeclaration = + | function BindingIdentifier "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + | guardDefault function "(" FormalParameters ")" "{" FunctionBody "}" -- alt2 + + FunctionExpression = + | function BindingIdentifier? "(" FormalParameters ")" "{" FunctionBody "}" -- alt1 + + FunctionBody = + | FunctionStatementList + + FunctionStatementList = + | StatementList? + + ArrowFunction = + | ArrowParameters ~lineTerminator "=>" ConciseBody -- alt1 + + ArrowParameters = + | BindingIdentifier -- alt1 + | CoverParenthesizedExpressionAndArrowParameterList -- alt2 + + ConciseBody = + | ~"{" ExpressionBody -- alt1 + | "{" FunctionBody "}" -- alt2 + + ExpressionBody = + | AssignmentExpression + + ArrowFormalParameters = + | "(" UniqueFormalParameters ")" -- alt1 + + MethodDefinition = + | ClassElementName "(" UniqueFormalParameters ")" "{" FunctionBody "}" -- alt1 + | GeneratorMethod -- alt2 + | AsyncMethod -- alt3 + | AsyncGeneratorMethod -- alt4 + | "get" ClassElementName "(" ")" "{" FunctionBody "}" -- alt5 + | "set" ClassElementName "(" PropertySetParameterList ")" "{" FunctionBody "}" -- alt6 + + PropertySetParameterList = + | FormalParameter + + GeneratorDeclaration = + | function "*" BindingIdentifier "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + | guardDefault function "*" "(" FormalParameters ")" "{" GeneratorBody "}" -- alt2 + + GeneratorExpression = + | function "*" BindingIdentifier? "(" FormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorMethod = + | "*" ClassElementName "(" UniqueFormalParameters ")" "{" GeneratorBody "}" -- alt1 + + GeneratorBody = + | FunctionBody + + YieldExpression = + | yield -- alt1 + | yield ~lineTerminator AssignmentExpression -- alt2 + | yield ~lineTerminator "*" AssignmentExpression -- alt3 + + AsyncGeneratorDeclaration = + | "async" ~lineTerminator function "*" BindingIdentifier "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "*" "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt2 + + AsyncGeneratorExpression = + | "async" ~lineTerminator function "*" BindingIdentifier? "(" FormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorMethod = + | "async" ~lineTerminator "*" ClassElementName "(" UniqueFormalParameters ")" "{" AsyncGeneratorBody "}" -- alt1 + + AsyncGeneratorBody = + | FunctionBody + + ClassDeclaration = + | class BindingIdentifier ClassTail -- alt1 + | guardDefault class ClassTail -- alt2 + + ClassExpression = + | class BindingIdentifier? ClassTail -- alt1 + + ClassTail = + | ClassHeritage? "{" ClassBody? "}" -- alt1 + + ClassHeritage = + | extends LeftHandSideExpression -- alt1 + + ClassBody = + | ClassElementList + + ClassElementList = + | ClassElementList ClassElement -- alt2 + | ClassElement -- alt1 + + ClassElement = + | MethodDefinition -- alt1 + | "static" MethodDefinition -- alt2 + | FieldDefinition #sc -- alt3 + | "static" FieldDefinition #sc -- alt4 + | ClassStaticBlock -- alt5 + | #sc -- alt6 + + FieldDefinition = + | ClassElementName Initializer? -- alt1 + + ClassElementName = + | PropertyName + | privateIdentifier + + ClassStaticBlock = + | "static" "{" ClassStaticBlockBody "}" -- alt1 + + ClassStaticBlockBody = + | ClassStaticBlockStatementList + + ClassStaticBlockStatementList = + | StatementList? + + AsyncFunctionDeclaration = + | "async" ~lineTerminator function BindingIdentifier "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + | guardDefault "async" ~lineTerminator function "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt2 + + AsyncFunctionExpression = + | "async" ~lineTerminator function BindingIdentifier? "(" FormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + + AsyncMethod = + | "async" ~lineTerminator ClassElementName "(" UniqueFormalParameters ")" "{" AsyncFunctionBody "}" -- alt1 + + AsyncFunctionBody = + | FunctionBody + + AwaitExpression = + | await UnaryExpression -- alt1 + + AsyncArrowFunction = + | "async" ~lineTerminator AsyncArrowBindingIdentifier ~lineTerminator "=>" AsyncConciseBody -- alt1 + | CoverCallExpressionAndAsyncArrowHead ~lineTerminator "=>" AsyncConciseBody -- alt2 + + AsyncConciseBody = + | ~"{" ExpressionBody -- alt1 + | "{" AsyncFunctionBody "}" -- alt2 + + AsyncArrowBindingIdentifier = + | BindingIdentifier + + CoverCallExpressionAndAsyncArrowHead = + | MemberExpression Arguments -- alt1 + + AsyncArrowHead = + | "async" ~lineTerminator ArrowFormalParameters -- alt1 + + Script = + | ScriptBody? + + ScriptBody = + | StatementList + + Module = + | ModuleBody? + + ModuleBody = + | ModuleItemList + + ModuleItemList = + | ModuleItem+ + + ModuleItem = + | ImportDeclaration + | ExportDeclaration + | StatementListItem + + ModuleExportName = + | identifierName + | stringLiteral + + ImportDeclaration = + | import ImportClause FromClause #sc -- alt1 + | import ModuleSpecifier #sc -- alt2 + + ImportClause = + | ImportedDefaultBinding -- alt1 + | NameSpaceImport -- alt2 + | NamedImports -- alt3 + | ImportedDefaultBinding "," NameSpaceImport -- alt4 + | ImportedDefaultBinding "," NamedImports -- alt5 + + ImportedDefaultBinding = + | ImportedBinding + + NameSpaceImport = + | "*" "as" ImportedBinding -- alt1 + + NamedImports = + | "{" "}" -- alt1 + | "{" ImportsList "}" -- alt2 + | "{" ImportsList "," "}" -- alt3 + + FromClause = + | "from" ModuleSpecifier -- alt1 + + ImportsList = + | ImportsList "," ImportSpecifier -- alt2 + | ImportSpecifier -- alt1 + + ImportSpecifier = + | ImportedBinding -- alt1 + | ModuleExportName "as" ImportedBinding -- alt2 + + ModuleSpecifier = + | stringLiteral + + ImportedBinding = + | BindingIdentifier + + ExportDeclaration = + | export ExportFromClause FromClause #sc -- alt1 + | export NamedExports #sc -- alt2 + | export VariableStatement -- alt3 + | export Declaration -- alt4 + | export default HoistableDeclaration -- alt5 + | export default ClassDeclaration -- alt6 + | export default ~("function" | ("async" ~lineTerminator "function") | "class") AssignmentExpression #sc -- alt7 + + ExportFromClause = + | "*" -- alt1 + | "*" "as" ModuleExportName -- alt2 + | NamedExports -- alt3 + + NamedExports = + | "{" "}" -- alt1 + | "{" ExportsList "}" -- alt2 + | "{" ExportsList "," "}" -- alt3 + + ExportsList = + | ExportsList "," ExportSpecifier -- alt2 + | ExportSpecifier -- alt1 + + ExportSpecifier = + | ModuleExportName -- alt1 + | ModuleExportName "as" ModuleExportName -- alt2 + + stringNumericLiteral = + | strWhiteSpace? -- alt1 + | strWhiteSpace? strNumericLiteral strWhiteSpace? -- alt2 + + strWhiteSpace = + | strWhiteSpaceChar strWhiteSpace? -- alt1 + + strWhiteSpaceChar = + | whiteSpace + | lineTerminator + + strNumericLiteral = + | strDecimalLiteral + | nonDecimalIntegerLiteral + + strDecimalLiteral = + | strUnsignedDecimalLiteral -- alt1 + | "+" strUnsignedDecimalLiteral -- alt2 + | "-" strUnsignedDecimalLiteral -- alt3 + + strUnsignedDecimalLiteral = + | "Infinity" -- alt1 + | decimalDigits "." decimalDigits? exponentPart? -- alt2 + | "." decimalDigits exponentPart? -- alt3 + | decimalDigits exponentPart? -- alt4 + + uri = + | uriCharacters? + + uriCharacters = + | uriCharacter uriCharacters? -- alt1 + + uriCharacter = + | uriReserved + | uriUnescaped + | uriEscaped + + uriReserved = #sc | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," + + uriUnescaped = + | uriAlpha + | decimalDigit + | uriMark + + uriEscaped = + | "%" hexDigit hexDigit -- alt1 + + uriAlpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + uriMark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" + + NativeFunction = + | function NativeFunctionAccessor? PropertyName? "(" FormalParameters ")" "{" "[" "native" "code" "]" "}" -- alt1 + + NativeFunctionAccessor = + | "get" + | "set" + + pattern = + | disjunction + + disjunction = + | alternative -- alt1 + | alternative "|" disjunction -- alt2 + + alternative = + | alternative term -- alt2 + | /* empty */ -- alt1 + + term = + | assertion -- alt1 + | atom -- alt2 + | atom quantifier -- alt3 + + assertion = + | "^" -- alt1 + | "$" -- alt2 + | "\\" "b" -- alt3 + | "\\" "B" -- alt4 + | "(" "?" "=" disjunction ")" -- alt5 + | "(" "?" "!" disjunction ")" -- alt6 + | "(" "?" "<=" disjunction ")" -- alt7 + | "(" "?" " ")" -- alt8 + + quantifier = + | quantifierPrefix -- alt1 + | quantifierPrefix "?" -- alt2 + + quantifierPrefix = + | "*" -- alt1 + | "+" -- alt2 + | "?" -- alt3 + | "{" decimalDigits "}" -- alt4 + | "{" decimalDigits "," "}" -- alt5 + | "{" decimalDigits "," decimalDigits "}" -- alt6 + + atom = + | patternCharacter -- alt1 + | "." -- alt2 + | "\\" atomEscape -- alt3 + | characterClass -- alt4 + | "(" groupSpecifier disjunction ")" -- alt5 + | "(" "?" ":" disjunction ")" -- alt6 + + syntaxCharacter = "\\" | "^" | "$" | "." | "*" | "+" | "?" | "(" | ")" | "[" | "]" | "{" | "}" | "|" + + patternCharacter = + | ~syntaxCharacter sourceCharacter + + atomEscape = + | decimalEscape -- alt1 + | characterClassEscape -- alt2 + | characterEscape -- alt3 + | guardN "k" groupName -- alt4 + + characterEscape = + | controlEscape -- alt1 + | "c" controlLetter -- alt2 + | "0" ~decimalDigit -- alt3 + | hexEscapeSequence -- alt4 + | regExpUnicodeEscapeSequence -- alt5 + | identityEscape -- alt6 + + controlEscape = "f" | "n" | "r" | "t" | "v" + + controlLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" + + groupSpecifier = + | /* empty */ -- alt1 + | "?" groupName -- alt2 + + groupName = + | "<" regExpIdentifierName ">" -- alt1 + + regExpIdentifierName = + | regExpIdentifierName regExpIdentifierPart -- alt2 + | regExpIdentifierStart -- alt1 + + regExpIdentifierStart = + | identifierStartChar -- alt1 + | "\\" regExpUnicodeEscapeSequence -- alt2 + | guardUnicodeMode unicodeLeadSurrogate unicodeTrailSurrogate -- alt3 + + regExpIdentifierPart = + | identifierPartChar -- alt1 + | "\\" regExpUnicodeEscapeSequence -- alt2 + | guardUnicodeMode unicodeLeadSurrogate unicodeTrailSurrogate -- alt3 + + regExpUnicodeEscapeSequence = + | guardUnicodeMode "u" hexLeadSurrogate "\\u" hexTrailSurrogate -- alt1 + | guardUnicodeMode "u" hexLeadSurrogate -- alt2 + | guardUnicodeMode "u" hexTrailSurrogate -- alt3 + | guardUnicodeMode "u" hexNonSurrogate -- alt4 + | guardUnicodeMode "u" hex4Digits -- alt5 + | guardUnicodeMode "u{" codePoint "}" -- alt6 + + unicodeLeadSurrogate = /* any Unicode code point in the inclusive range 0xD800 to 0xDBFF */ + + unicodeTrailSurrogate = /* any Unicode code point in the inclusive range 0xDC00 to 0xDFFF */ + + hexLeadSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the MV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF */ -- alt1 + + hexTrailSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the MV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF */ -- alt1 + + hexNonSurrogate = + | hex4Digits /* FIXME Assertion: > but only if the MV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF */ -- alt1 + + identityEscape = + | guardUnicodeMode syntaxCharacter -- alt1 + | guardUnicodeMode "/" -- alt2 + | guardUnicodeMode ~unicodeIDContinue sourceCharacter -- alt3 + + decimalEscape = + | nonZeroDigit decimalDigits? ~decimalDigit -- alt1 + + characterClassEscape = + | "d" -- alt1 + | "D" -- alt2 + | "s" -- alt3 + | "S" -- alt4 + | "w" -- alt5 + | "W" -- alt6 + | guardUnicodeMode "p{" unicodePropertyValueExpression "}" -- alt7 + | guardUnicodeMode "P{" unicodePropertyValueExpression "}" -- alt8 + + unicodePropertyValueExpression = + | unicodePropertyName "=" unicodePropertyValue -- alt1 + | loneUnicodePropertyNameOrValue -- alt2 + + unicodePropertyName = + | unicodePropertyNameCharacters + + unicodePropertyNameCharacters = + | unicodePropertyNameCharacter unicodePropertyNameCharacters? -- alt1 + + unicodePropertyValue = + | unicodePropertyValueCharacters + + loneUnicodePropertyNameOrValue = + | unicodePropertyValueCharacters + + unicodePropertyValueCharacters = + | unicodePropertyValueCharacter unicodePropertyValueCharacters? -- alt1 + + unicodePropertyValueCharacter = + | unicodePropertyNameCharacter + | decimalDigit + + unicodePropertyNameCharacter = + | controlLetter + | "_" + + characterClass = + | "[" ~"^" classRanges "]" -- alt1 + | "[" "^" classRanges "]" -- alt2 + + classRanges = + | /* empty */ -- alt1 + | nonemptyClassRanges -- alt2 + + nonemptyClassRanges = + | classAtom -- alt1 + | classAtom nonemptyClassRangesNoDash -- alt2 + | classAtom "-" classAtom classRanges -- alt3 + + nonemptyClassRangesNoDash = + | classAtom -- alt1 + | classAtomNoDash nonemptyClassRangesNoDash -- alt2 + | classAtomNoDash "-" classAtom classRanges -- alt3 + + classAtom = + | "-" + | classAtomNoDash + + classAtomNoDash = + | ~("\\" | "]" | "-") sourceCharacter -- alt1 + | "\\" classEscape -- alt2 + + classEscape = + | "b" -- alt1 + | guardUnicodeMode "-" -- alt2 + | characterClassEscape -- alt3 + | characterEscape -- alt4 + + withSep = /* fixme */ + + noSep = ~any /* is this right? */ + + withYield = /* fixme */ + + noYield = ~any /* is this right? */ + + withAwait = /* fixme */ + + noAwait = ~any /* is this right? */ + + withIn = /* fixme */ + + noIn = ~any /* is this right? */ + + withTagged = /* fixme */ + + noTagged = ~any /* is this right? */ + + withReturn = /* fixme */ + + noReturn = ~any /* is this right? */ + + withDefault = /* fixme */ + + noDefault = ~any /* is this right? */ + + withUnicodeMode = /* fixme */ + + noUnicodeMode = ~any /* is this right? */ + + withN = /* fixme */ + + noN = ~any /* is this right? */ + + await = "await" ~identifierPart + break = "break" ~identifierPart + case = "case" ~identifierPart + catch = "catch" ~identifierPart + class = "class" ~identifierPart + const = "const" ~identifierPart + continue = "continue" ~identifierPart + debugger = "debugger" ~identifierPart + default = "default" ~identifierPart + delete = "delete" ~identifierPart + do = "do" ~identifierPart + else = "else" ~identifierPart + enum = "enum" ~identifierPart + export = "export" ~identifierPart + extends = "extends" ~identifierPart + false = "false" ~identifierPart + finally = "finally" ~identifierPart + for = "for" ~identifierPart + function = "function" ~identifierPart + if = "if" ~identifierPart + import = "import" ~identifierPart + in = "in" ~identifierPart + instanceof = "instanceof" ~identifierPart + new = "new" ~identifierPart + null = "null" ~identifierPart + return = "return" ~identifierPart + super = "super" ~identifierPart + switch = "switch" ~identifierPart + this = "this" ~identifierPart + throw = "throw" ~identifierPart + true = "true" ~identifierPart + try = "try" ~identifierPart + typeof = "typeof" ~identifierPart + var = "var" ~identifierPart + void = "void" ~identifierPart + while = "while" ~identifierPart + with = "with" ~identifierPart + yield = "yield" ~identifierPart +} diff --git a/examples/ecmascript/package.json b/examples/ecmascript/package.json index 2edaa2a8..3405cefd 100644 --- a/examples/ecmascript/package.json +++ b/examples/ecmascript/package.json @@ -40,5 +40,9 @@ "src", "!**/*.test.*", "!**/testdata/**" - ] + ], + "dependencies": { + "@pkgjs/parseargs": "^0.11.0", + "jsdom": "^21.1.1" + } } diff --git a/examples/ecmascript/scripts/dedent.py b/examples/ecmascript/scripts/dedent.py new file mode 100644 index 00000000..49483e34 --- /dev/null +++ b/examples/ecmascript/scripts/dedent.py @@ -0,0 +1,46 @@ +import argparse +import textwrap + +def dedent_grammar(grammar_text: str): + grammar_lines = grammar_text.split('\n') + + block_start = 0 + blocks = [] + + for i, line in enumerate(grammar_lines): + if i > block_start and line.startswith('@line'): + blocks.append({ + "line": grammar_lines[block_start], + "start": block_start + 1, + "end": i, + }) + block_start = i + blocks.append({ + "line": grammar_lines[block_start], + "start": block_start + 1, + "end": len(grammar_lines) - 1 + }) + + dedented_blocks = [] + + for block in blocks: + line = block['line'] + start = block['start'] + end = block['end'] + block_text = '\n'.join(grammar_lines[start:end]) + dedented_block = textwrap.dedent(block_text) + dedented_blocks.append(line + '\n' + dedented_block) + + dedented_grammar_text = '\n'.join(dedented_blocks) + + return dedented_grammar_text + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('grammar_file', help='grammarkdown file') + args = parser.parse_args() + + with open(args.grammar_file, 'r') as f: + grammar_text = f.read() + print(dedent_grammar(grammar_text)) diff --git a/examples/ecmascript/scripts/extract-grammarkdown.mjs b/examples/ecmascript/scripts/extract-grammarkdown.mjs new file mode 100644 index 00000000..bffb5280 --- /dev/null +++ b/examples/ecmascript/scripts/extract-grammarkdown.mjs @@ -0,0 +1,63 @@ +import { parseArgs } from 'util' +import jsdom from 'jsdom' +import fs from 'fs' +const { JSDOM } = jsdom + +const USAGE = +`Usage: extract-markdown.mjs + +Options: + -h --help Print this message. +` + +const extractProductions = (specText) => { + + const dom = new JSDOM(specText, { + includeNodeLocations: true, + }) + + const emuNodes = dom.window.document.querySelectorAll('emu-grammar[type=definition]') + + // Older versions of the grammars prior to ES2018 didn't use the + // `type="definition"` attribute on elements, so we use + // the less specific selector & manually remove extraneous productions + if (emuNodes.length === 0) { + emuNodes = dom.window.document.querySelectorAll('emu-grammar') + } + + const grammarkdownText = Array.from(emuNodes, (e) => { + return [`@line ${dom.nodeLocation(e).startLine}`, e.textContent].join('\n') + }).join('\n') + + return grammarkdownText +} + +const main = () => { + const parseConfig = { + allowPositionals: true, + options: { + help: { + short: 'h', + type: 'boolean', + } + } + } + + const args = parseArgs(parseConfig) + + if (args.values.help || args.positionals.length < 1) { + console.error(USAGE) + process.exit(!args.values.help) + } + + const spec = fs.readFileSync(args.positionals[0], {encoding: 'utf-8'}) + const grammarText = extractProductions(spec) + console.log(grammarText) +} + +main() + + + + + diff --git a/examples/ecmascript/scripts/generate-ecmascript-grammar.mjs b/examples/ecmascript/scripts/generate-ecmascript-grammar.mjs index 66fb0f0f..75b04506 100755 --- a/examples/ecmascript/scripts/generate-ecmascript-grammar.mjs +++ b/examples/ecmascript/scripts/generate-ecmascript-grammar.mjs @@ -27,6 +27,13 @@ function safelyReplace(str, pattern, replacement) { return str.replace(pattern, replacement); } +const lexicalRuleName = str => str[0].toLowerCase() + str.slice(1); +const syntacticRuleName = str => { + assert(str[0] === str[0].toUpperCase()); + return str; +}; + +let ruleOverrides = {}; /* Allows particular rule bodies to be overridden, by specifying either: @@ -34,204 +41,37 @@ function safelyReplace(str, pattern, replacement) { 2. a function (rhs: Node, defaultBody: string) => string, where the function result will be used as the rule body. */ -const ruleOverrides = { - unicodeIDStart: 'letter /* fixme */', - unicodeIDContinue: 'letter | digit /* fixme */', - sourceCharacter: 'any', - postAsteriskCommentChars(rhs, defaultBody) { - return safelyReplace( - defaultBody, - '| "*" postAsteriskCommentChars?', - '| "*" ~"/" postAsteriskCommentChars?' - ); - }, - LeftHandSideExpression(rhs, defaultBody) { - return safelyReplace( - defaultBody, - '| NewExpression\n | CallExpression', - '| CallExpression\n | NewExpression' - ); - }, - PropertyDefinition(rhs, defaultBody) { - // MethodDefinition must come before IdentifierReference. - return safelyReplace( - defaultBody, - '| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName ":" AssignmentExpression -- alt3\n | MethodDefinition -- alt4', - '| MethodDefinition -- alt4\n | PropertyName ":" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2' - ); - }, - EmptyStatement(rhs, defaultBody) { - // Need this rather than `#sc` so that EmptyStatement is not nullable. - return `";" // note: this semicolon eats newlines`; - }, - AssignmentExpression(rhs, defaultBody) { - // ArrowFunction must come before ConditionalExpression, because the arrow function parameters - // will parse as a parenthesized expression. - // Both LeftHandSideExpression alternatives must also come before ConditionalExpression. - return safelyReplace( - defaultBody, - '| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | LeftHandSideExpression "=" AssignmentExpression -- alt4\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt5', - '| ArrowFunction -- alt3\n | LeftHandSideExpression "=" AssignmentExpression -- alt4\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt5\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2' - ); - }, - FormalParameters(rhs, defaultBody) { - return safelyReplace( - defaultBody, - '| /* empty */ -- alt1\n | FormalParameterList -- alt2', - '| FormalParameterList -- alt2\n | /* empty */ -- alt1' - ); - }, - MemberExpression(rhs, defaultBody) { - // The recursive MemberExpression application must come before PrimaryExpression. - return safelyReplace( - defaultBody, - '| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7', - '| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6' - ); - }, - UnaryExpression(rhs, defaultBody) { - // Move PostfixExpression to the very end. - return ( - safelyReplace(defaultBody, ' | PostfixExpression -- alt1\n', '') + - '\n | PostfixExpression -- alt1' - ); - }, - ConditionalExpression(rhs, defaultBody) { - // The first alternative is a subset of the second one, so flip the order. - return safelyReplace( - defaultBody, - '| LogicalORExpression -- alt1\n | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2', - '| LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression -- alt2\n | LogicalORExpression -- alt1' - ); - }, - RelationalExpression(rhs, defaultBody) { - // First, put move the left recursive application above the ShiftExpression. (It's not - // properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` - // to be right before the `"in"` terminal. - return safelyReplace( - defaultBody, - '| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7', - '| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1' - ); - }, - identifierPart(rhs, defaultBody) { - // FIXME: Make sure these produce something useful. - return safelyReplace( - defaultBody, - '| "" /* FIXME */ -- alt5\n | "" /* FIXME */ -- alt6', - '' - ); - }, - numericLiteral(rhs, defaultBody) { - // Move decimalLiteral to the very end. - return safelyReplace(defaultBody, ' | decimalLiteral\n', '') + '\n | decimalLiteral'; - }, - FormalParameterList(rhs, defaultBody) { - // alt2 is strictly a subset of alt3, so swap the order. - return safelyReplace( - defaultBody, - '| FormalsList -- alt2\n | FormalsList "," FunctionRestParameter -- alt3', - '| FormalsList "," FunctionRestParameter -- alt3\n | FormalsList -- alt2' - ); - }, - PostfixExpression(rhs, defaultBody) { - // alt1 is strictly a subset of the following two alternatives, so put it at the end. - return safelyReplace( - defaultBody, - '| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator "++" -- alt2\n | LeftHandSideExpression ~lineTerminator "--" -- alt3', - '| LeftHandSideExpression ~lineTerminator "++" -- alt2\n | LeftHandSideExpression ~lineTerminator "--" -- alt3\n | LeftHandSideExpression -- alt1' - ); - }, - StatementList(rhs, defaultBody) { - // Change from recursive to iterative. - return safelyReplace( - defaultBody, - '| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1', - '| StatementListItem+' - ); - }, - StatementList(rhs, defaultBody) { - // Change from recursive to iterative. - return safelyReplace( - defaultBody, - '| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1', - '| StatementListItem+' - ); - }, - ModuleItemList(rhs, defaultBody) { - // Change from recursive to iterative. - return safelyReplace( - defaultBody, - '| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1', - '| ModuleItem+' - ); - }, - singleLineCommentChars(rhs, defaultBody) { - // Change from recursive to iterative. - return safelyReplace( - defaultBody, - '| singleLineCommentChar singleLineCommentChars? -- alt1', - '| singleLineCommentChar+' - ); - }, - doubleStringCharacters(rhs, defaultBody) { - // Change from recursive to iterative. - return safelyReplace( - defaultBody, - '| doubleStringCharacter doubleStringCharacters? -- alt1', - '| doubleStringCharacter+' - ); - }, - singleStringCharacters(rhs, defaultBody) { - // Change from recursive to iterative. - return safelyReplace( - defaultBody, - '| singleStringCharacter singleStringCharacters? -- alt1', - '| singleStringCharacter+' - ); - }, - templateCharacters(rhs, defaultBody) { - // Change from recursive to iterative. - return safelyReplace( - defaultBody, - '| templateCharacter templateCharacters? -- alt1', - '| templateCharacter+' - ); - }, - multiLineCommentChars(rhs, defaultBody) { - // Change from recursive to iterative. - return safelyReplace( - defaultBody, - '| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | "*" postAsteriskCommentChars? -- alt2', - '(~"*/" sourceCharacter)*' - ); +function mkRuleOverrides(substitutions) { + const overrides = {}; + for (const substitution of substitutions) { + const keys = Object.keys(substitution) + if (keys.includes('override')) { + overrides[substitution.name] = substitution.override; + continue; + } + if (keys.includes('pattern') && keys.includes('replacement')) { + let postlude = ''; + if (keys.includes('postlude')) { + postlude = substitution.postlude + } + overrides[substitution.name] = (rhs, defaultBody) => (safelyReplace(defaultBody, substitution.pattern, substitution.replacement) + postlude) + } } -}; - -const lexicalRuleName = str => str[0].toLowerCase() + str.slice(1); -const syntacticRuleName = str => { - assert(str[0] === str[0].toUpperCase()); - return str; -}; + return overrides +} +let reservedWordProductions = []; // All productions (using the source grammar naming scheme) that are define lists of // reserved words. We modify these to ensure that they don't match against valid identifiers // that happen to have a keyword as a prefix — e.g., `class` matching `classification`. -const reservedWordProductions = [ - 'Keyword', - 'FutureReservedWord', - 'NullLiteral', - 'BooleanLiteral' -]; +function mkReservedWordProductions(productions) { + return productions; +} // Converts all terminals in the rule body to rule applications. // E.g., `"blah" | "blarg"` => `blah | blarg`. const terminalsToRules = ohmString => ohmString.replace(/"/g, ''); -// Add a rule override for each of the reserved word productions. -for (const prod of reservedWordProductions) { - ruleOverrides[lexicalRuleName(prod)] = (rhs, defaultBody) => terminalsToRules(defaultBody); -} const PRELUDE = raw` Start = Script @@ -275,11 +115,13 @@ let grammarName; // Initialized in main(), below. semantics.addOperation( 'toOhm()', (() => { - function handleProduction(nonterminal, rhs, parameterListOpt = undefined) { - const isLexical = parameterListOpt === undefined; + function handleProduction(nonterminal, rhs, parameterListOpt = undefined, kind = 'LEXICAL') { + // const isLexical = parameterListOpt === undefined; + const isLexical = kind === 'LEXICAL' + const strippedNonTerminal = nonterminal.sourceString.replaceAll('|', '') const ruleName = isLexical - ? lexicalRuleName(nonterminal.sourceString) - : syntacticRuleName(nonterminal.sourceString); + ? lexicalRuleName(strippedNonTerminal) + : syntacticRuleName(strippedNonTerminal); const parameterList = parameterListOpt && parameterListOpt.child(0); const params = parameterList ? parameterList.toOhm() : ''; const body = overrideRuleBodyOrElse(ruleName, rhs, rhs.toOhm()); @@ -287,25 +129,42 @@ semantics.addOperation( return `${ruleName}${params} ${op} ${body}`; } - const handlePositiveLookahead = (_, _op, expr) => `&${expr.toOhm()}`; - const handleNegativeLookahead = (_, _op, expr) => `~${expr.toOhm()}`; + const handlePositiveLookahead = (_, _op, exprList) => { + const parsedExprList = exprList.isIteration() + ? exprList.children.map(c => c.toOhm()) + : [ exprList.toOhm() ] + + if (parsedExprList.length > 1) { + return `&(${parsedExprList.join('|')})`; + } + return `&${parsedExprList}`; + } + const handleNegativeLookahead = (_, _op, exprList) => { + const parsedExprList = exprList.isIteration() + ? exprList.children.map(c => c.toOhm()) + : [ exprList.toOhm() ] + if (parsedExprList.length > 1) { + return `~(${parsedExprList.join('|')})`; + } + return `~${parsedExprList}`; + } return { Productions(productionIter) { const rules = productionIter.children.map(c => c.toOhm()); for (const param of new Set(this.allParameters)) { - rules.push(...[`with${param} = /* fixme */`, `no${param} = /* fixme */`]); + rules.push(...[`with${param} = /* fixme */`, `no${param} = ~any /* is this right? */`]); } const prettyRules = [...rules].join('\n\n '); const indentedAdditionalRules = this.getAdditionalRules().map(str => ` ${str}`); const additionalRules = ['', ...indentedAdditionalRules, ''].join('\n'); return `${grammarName} {\n${PRELUDE}\n ${prettyRules}\n${additionalRules}}`; }, - Production_lexical(nonterminal, _, rhs) { - return handleProduction(nonterminal, rhs); + Production_lexical(nonterminal, parameterListOpt, _, rhs) { + return handleProduction(nonterminal, rhs, parameterListOpt); }, Production_syntactic(nonterminal, parameterListOpt, _, rhs) { - return handleProduction(nonterminal, rhs, parameterListOpt); + return handleProduction(nonterminal, rhs, parameterListOpt, 'SYNTACTIC'); }, ParameterList(_open, listOfParameter, _close) { const params = listOfParameter.asIteration().children.map(c => c.toOhm()); @@ -356,7 +215,7 @@ semantics.addOperation( term_opt(application, _) { return `${application.toOhm()}?`; }, - term_assertion(_open, assertionContents, _close) { + term_assertion(assertionContents) { return assertionContents.toOhm(); }, term_terminal(terminal) { @@ -368,12 +227,21 @@ semantics.addOperation( ? terminalsToRules(ohmTerminal) : ohmTerminal; }, + term_link(_) { + return '' + }, + assertion(_open, assertionContents, _close) { + return assertionContents.toOhm(); + }, AssertionContents_empty(_) { return '/* empty */'; }, AssertionContents_noSymbolHere(_no, nonterminal, _here) { return `~${nonterminal.toOhm()}`; }, + AssertionContents_lexicalGoal(_lexical, _goal, nonterminal) { + return `~${nonterminal.toOhm()}`; + }, AssertionContents_paramSet(_, param) { return `guard${param.sourceString}`; }, @@ -385,9 +253,12 @@ semantics.addOperation( }, Lookahead_positive: handlePositiveLookahead, Lookahead_positiveSet: handlePositiveLookahead, + Lookahead_positiveSetEpsilon: handlePositiveLookahead, Lookahead_negative: handleNegativeLookahead, Lookahead_negativeSet: handleNegativeLookahead, + Lookahead_negativeSetEpsilon: handleNegativeLookahead, Lookahead_negativeNonterminal: handleNegativeLookahead, + Lookahead_negativeNonterminalEpsilon: handleNegativeLookahead, LookaheadSet(_open, listOfTerminalIter, _close) { const items = listOfTerminalIter.asIteration().children.map(terminalIter => { const ans = terminalIter.children.map(c => c.toOhm()).join(' '); @@ -422,6 +293,9 @@ semantics.addOperation( argument_pass(_, param) { return param.toOhm(); }, + argument_unset(_, param) { + return `no${param.sourceString}`; + }, butNotCondition_basic(_, basicTerm) { return `~${basicTerm.toOhm()}`; }, @@ -429,13 +303,14 @@ semantics.addOperation( const terms = listOfBasicTerm.asIteration().children.map(c => c.toOhm()); return `~(${terms.join(' | ')})`; }, - nonterminal(_, _2) { + nonterminal(_optPipe, _, _2, _optPipe2) { const {sourceString} = this; + const trimmedSourceString = sourceString.replaceAll('|', '') const root = this.context.productions; - if (root.productionsByName.has(sourceString)) { - return sourceString; + if (root.productionsByName.has(trimmedSourceString)) { + return trimmedSourceString; } - const lexicalName = lexicalRuleName(sourceString); + const lexicalName = lexicalRuleName(trimmedSourceString); assert(root.productionsByName.has(lexicalName)); return lexicalName; }, @@ -452,7 +327,7 @@ semantics.addOperation( case ';': return '#sc'; } - return `"${sourceString}"`; + return `"${sourceString.replace('\\','\\\\')}"`; }, literal(_open, charIter, _close) { const name = charIter.sourceString; @@ -476,7 +351,7 @@ semantics.addOperation('getAdditionalRules', { _terminal() { return []; }, - Production_lexical(nonterminal, _, rhs) { + Production_lexical(nonterminal, _parameterList, _, rhs) { if (reservedWordProductions.includes(nonterminal.sourceString)) { const ruleNames = rhs.getReservedWordTerminals().map(t => terminalsToRules(t.toOhm())); return ruleNames.map(name => `${name} = "${name}" ~identifierPart`); @@ -499,6 +374,9 @@ semantics.addOperation('getReservedWordTerminals()', { }, term_terminal(terminal) { return [terminal]; + }, + term_link(_) { + return ''; } }); @@ -516,10 +394,11 @@ semantics.addAttribute('allParameters', { Productions(productionIter) { return productionIter.children.flatMap(c => c.allParameters); }, - Production_lexical(nonterminal, _, rhs) { - return []; + Production_lexical(_nonterminal, parameterListOpt, _, rhs) { + const parameterList = parameterListOpt.child(0); + return parameterList ? parameterList.allParameters : []; }, - Production_syntactic(nonterminal, parameterListOpt, _, rhs) { + Production_syntactic(_nonterminal, parameterListOpt, _, rhs) { const parameterList = parameterListOpt.child(0); return parameterList ? parameterList.allParameters : []; }, @@ -551,10 +430,16 @@ semantics.addAttribute('ruleNameForApplication', { term_nonterminal(appl) { return appl.ruleNameForApplication; }, + term_terminalOpt(_, _opt) { + return undefined; + }, term_terminal(_) { return undefined; }, - term_assertion(_open, assertion, _close) { + term_assertion(assertion) { + return undefined; + }, + term_link(_) { return undefined; }, application(child) { @@ -586,8 +471,10 @@ function getOhmArgs(root, ruleName, argumentArr) { return `with${paramName}`; case 'pass': return `guard${paramName}`; + case 'unset': + default: + return `no${paramName}`; } - return `no${paramName}`; }); } @@ -614,7 +501,7 @@ semantics.addAttribute('reservedWords', { Production_syntactic(nonterminal, parameterListOpt, _, rhs) { return new Set(); }, - Production_lexical(nonterminal, _, rhs) { + Production_lexical(nonterminal, parameterListOpts, _, rhs) { if (reservedWordProductions.includes(nonterminal.sourceString)) { return new Set(rhs.getReservedWordTerminals().map(t => t.toOhm())); } @@ -623,7 +510,7 @@ semantics.addAttribute('reservedWords', { }); semantics.addAttribute('ruleNameForProduction', { - Production_lexical(nonterminal, _, rhs) { + Production_lexical(nonterminal, parameterListOpt, _, rhs) { return lexicalRuleName(nonterminal.sourceString); }, Production_syntactic(nonterminal, parameterListOpt, _, rhs) { @@ -637,6 +524,9 @@ semantics.addAttribute('argumentInfo', { }, argument_pass(_, param) { return {name: param.sourceString, type: 'pass'}; + }, + argument_unset(_, param) { + return {name: param.sourceString, type: 'unset'}; } }); @@ -644,7 +534,7 @@ addContext(semantics, (setContext, getContext) => ({ Productions(productionIter) { setContext(productionIter, {productions: this}); }, - Production_lexical(nonterminal, _, rhs) { + Production_lexical(nonterminal, parameterListOpt, _, rhs) { setContext(rhs, { ruleName: this.ruleNameForProduction, isLexicalProduction: true, @@ -704,6 +594,19 @@ function addContext(semantics, getActions) { (function main() { grammarName = process.argv[2]; const inputFilename = process.argv[3]; + if (process.argv.length > 4) { + const overrideConfig = JSON.parse(readFileSync(process.argv[4], { encoding: 'utf-8'})); + if (overrideConfig.substitutions) { + ruleOverrides = mkRuleOverrides(overrideConfig.substitutions); + } + if (overrideConfig.reservedWords) { + reservedWordProductions = mkReservedWordProductions(overrideConfig.reservedWords) + // Add a rule override for each of the reserved word productions. + for (const prod of reservedWordProductions) { + ruleOverrides[lexicalRuleName(prod)] = (rhs, defaultBody) => terminalsToRules(defaultBody); + } + } + } const result = grammarkdown.match(readFileSync(inputFilename, 'utf-8')); if (!result.succeeded()) { diff --git a/examples/ecmascript/scripts/grammarkdown.ohm b/examples/ecmascript/scripts/grammarkdown.ohm index 7408ef85..06fafde7 100644 --- a/examples/ecmascript/scripts/grammarkdown.ohm +++ b/examples/ecmascript/scripts/grammarkdown.ohm @@ -6,20 +6,23 @@ */ Grammarkdown { Productions = Production* - Production = nonterminal "::" RightHandSide -- lexical + Production = nonterminal ParameterList? sep RightHandSide -- lexical | nonterminal ParameterList? ":" RightHandSide -- syntactic - nonterminal = upper alnum* + nonterminal = "|"? upper alnum* "|"? + | "|"? ~keyword lower alnum* "|"? RightHandSide = oneof terminal+ -- oneOf | ">" proseSentence -- prose | (~Production rhsSentence)+ -- alternatives proseSentence = (spacesNoNL word)+ rhsSentence = (spacesNoNL term)+ - term = + term = | application "?" -- opt | application -- nonterminal + | terminal "?" -- terminalOpt | terminal -- terminal - | "[" applySyntactic "]" -- assertion + | assertion -- assertion + | link -- link application = | nonterminal butNotCondition -- withCondition @@ -30,45 +33,70 @@ Grammarkdown { literal = "<" upper+ ">" butNotCondition = - | " but not " basicTerm -- basic - | " but not one of " listOf -- oneOf + | butnotpadded basicTerm -- basic + | butnotoneofpadded listOf -- oneOf + + butnotpadded = spaces butnot spaces + butnotoneofpadded = butnotpadded oneof spaces + + assertion = "[" applySyntactic "]" AssertionContents = - | "empty" -- empty + | empty -- empty | Lookahead -- lookahead - | "no" nonterminal "here" -- noSymbolHere - /* lexical-goal - not used in es2015 */ + | no nonterminal here -- noSymbolHere + | lexical goal nonterminal -- lexicalGoal | "+" parameter -- paramSet | "~" parameter -- paramCleared - | ">" (~"]" any)+ -- prose + | ">" (~("]"|newline) any)+ -- prose + + LexicalGoal = lexical goal nonterminal Lookahead = - | "lookahead" "==" terminal -- positive - | "lookahead" "!=" terminal -- negative - | "lookahead" "<-" LookaheadSet -- positiveSet - | "lookahead" " "}" + LookaheadSet = "{" NonemptyListOf<(terminal|assertion)+, ","> "}" ParameterList = "[" NonemptyListOf "]" parameter = upper letter* argument = "+" parameter -- set | "?" parameter -- pass + | "~" parameter -- unset - word = (letter | "\"" | "_" | ",")+ + link = "#" letter+ + word = (letter | digit | "\"" | "_" | "," | "\u201c" | "\u201d")+ terminal = "```" -- backtick | quote (~quote any)+ quote -- other | literal -- literal atDefine = "@define" (~newline any)* + atLine = "@line" (~newline any)* + atImport = "@import" (~newline any)* comment = "//" (~newline any)* spacesNoNL = ~newline spaces - space += atDefine | comment + space += atDefine | atLine | atImport | comment newline = "\n" | "\r\n" quote = "`" oneof = "one of" + butnot = "but not" + lookahead = "lookahead" + lexical = "lexical" + goal = "goal" + no = "no" + empty = "empty" + here = "here" + + keyword = oneof | butnot | lookahead | lexical | goal | no | empty | here + + sep = ":::" | "::" } diff --git a/examples/ecmascript/spec/LICENSE.txt b/examples/ecmascript/spec/LICENSE.txt index 52244ded..cc37ebd2 100644 --- a/examples/ecmascript/spec/LICENSE.txt +++ b/examples/ecmascript/spec/LICENSE.txt @@ -2,9 +2,9 @@ License information =================== The .grammar files in this directory are taken from -https://github.com/rbuckton/grammarkdown whose original license is below. -These are almost certainly derivative work from the ECMA-262 spec, whose -license is also included below. +https://github.com/rbuckton/grammarkdown and https://tc39.es/ecma262/ +whose original license is below. These are almost certainly derivative work +from the ECMA-262 spec, whose license is also included below. grammarkdown ------------ diff --git a/examples/ecmascript/spec/es2015/overrides.json b/examples/ecmascript/spec/es2015/overrides.json new file mode 100644 index 00000000..b0c1503a --- /dev/null +++ b/examples/ecmascript/spec/es2015/overrides.json @@ -0,0 +1,152 @@ +{ + "reservedWords": [ + "Keyword", + "FutureReservedWord", + "NullLiteral", + "BooleanLiteral" + ], + "substitutions": [ + { + "name": "unicodeIDStart", + "override": "letter /* fixme */" + }, + { + "name": "unicodeIDContinue", + "override": "letter | digit /* fixme */" + }, + { + "name": "sourceCharacter", + "override": "any" + }, + { + "name": "postAsteriskCommentChars", + "pattern": "| \"*\" postAsteriskCommentChars?", + "replacement": "| \"*\" ~\"/\" postAsteriskCommentChars?" + }, + { + "name": "LeftHandSideExpression", + "pattern": "| NewExpression\n | CallExpression", + "replacement": "| CallExpression\n | NewExpression" + }, + { + "_comment_": " MethodDefinition must come before IdentifierReference.", + "name": "PropertyDefinition", + "pattern": "| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName \":\" AssignmentExpression -- alt3\n | MethodDefinition -- alt4", + "replacement": "| MethodDefinition -- alt4\n | PropertyName \":\" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2" + }, + { + "_comment_": " Need this rather than `#sc` so that EmptyStatement is not nullable.", + "name": "EmptyStatement", + "override": "\";\" // note: this semicolon eats newlines" + }, + { + "_comment_": " ArrowFunction must come before ConditionalExpression, because the arrow function parameters will parse as a parenthesized expression. Both LeftHandSideExpression alternatives must also come before ConditionalExpression.", + "name": "AssignmentExpression", + "pattern": "| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt4\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt5", + "replacement": "| ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt4\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt5\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2" + }, + { + "name": "FormalParameters", + "pattern": "| /* empty */ -- alt1\n | FormalParameterList -- alt2", + "replacement": "| FormalParameterList -- alt2\n | /* empty */ -- alt1" + }, + { + "_comment_": " The recursive MemberExpression application must come before PrimaryExpression.", + "name": "MemberExpression", + "pattern": "| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7", + "replacement": "| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6" + }, + { + "_comment_": " Move PostfixExpression to the very end.", + "name": "UnaryExpression", + "pattern": " | PostfixExpression -- alt1\n", + "postlude": "\n | PostfixExpression -- alt1", + "replacement": "" + }, + { + "_comment_": " The first alternative is a subset of the second one, so flip the order.", + "name": "ConditionalExpression", + "pattern": "| LogicalORExpression -- alt1\n | LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2", + "replacement": "| LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2\n | LogicalORExpression -- alt1" + }, + { + "_comment_": " First, put move the left recursive application above the ShiftExpression. (It's not properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` to be right before the `'in'` terminal.", + "name": "RelationalExpression", + "pattern": "| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7", + "replacement": "| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1" + }, + { + "_comment_": " FIXME: Make sure these produce something useful.", + "name": "identifierPart", + "pattern": "| \"\" /* FIXME */ -- alt5\n | \"\" /* FIXME */ -- alt6", + "replacement": "" + }, + { + "_comment_": " Move decimalLiteral to the very end.", + "name": "numericLiteral", + "pattern": " | decimalLiteral\n", + "postlude": "\n | decimalLiteral", + "replacement": "" + }, + { + "_comment_": " alt2 is strictly a subset of alt3, so swap the order.", + "name": "FormalParameterList", + "pattern": "| FormalsList -- alt2\n | FormalsList \",\" FunctionRestParameter -- alt3", + "replacement": "| FormalsList \",\" FunctionRestParameter -- alt3\n | FormalsList -- alt2" + }, + { + "_comment_": " alt1 is strictly a subset of the following two alternatives, so put it at the end.", + "name": "PostfixExpression", + "pattern": "| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3", + "replacement": "| LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3\n | LeftHandSideExpression -- alt1" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "ModuleItemList", + "pattern": "| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1", + "replacement": "| ModuleItem+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "singleLineCommentChars", + "pattern": "| singleLineCommentChar singleLineCommentChars? -- alt1", + "replacement": "| singleLineCommentChar+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "doubleStringCharacters", + "pattern": "| doubleStringCharacter doubleStringCharacters? -- alt1", + "replacement": "| doubleStringCharacter+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "singleStringCharacters", + "pattern": "| singleStringCharacter singleStringCharacters? -- alt1", + "replacement": "| singleStringCharacter+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "templateCharacters", + "pattern": "| templateCharacter templateCharacters? -- alt1", + "replacement": "| templateCharacter+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "multiLineCommentChars", + "pattern": "| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | \"*\" postAsteriskCommentChars? -- alt2", + "replacement": "(~\"*/\" sourceCharacter)*" + } + ] +} diff --git a/examples/ecmascript/spec/es2015.grammar b/examples/ecmascript/spec/es2015/spec.grammar similarity index 100% rename from examples/ecmascript/spec/es2015.grammar rename to examples/ecmascript/spec/es2015/spec.grammar diff --git a/examples/ecmascript/spec/es2016/overrides.json b/examples/ecmascript/spec/es2016/overrides.json new file mode 100644 index 00000000..794a3e09 --- /dev/null +++ b/examples/ecmascript/spec/es2016/overrides.json @@ -0,0 +1,152 @@ +{ + "reservedWords": [ + "Keyword", + "FutureReservedWord", + "NullLiteral", + "BooleanLiteral" + ], + "substitutions": [ + { + "name": "unicodeIDStart", + "override": "letter /* fixme */" + }, + { + "name": "unicodeIDContinue", + "override": "letter | digit /* fixme */" + }, + { + "name": "sourceCharacter", + "override": "any" + }, + { + "name": "postAsteriskCommentChars", + "pattern": "| \"*\" postAsteriskCommentChars?", + "replacement": "| \"*\" ~\"/\" postAsteriskCommentChars?" + }, + { + "name": "LeftHandSideExpression", + "pattern": "| NewExpression\n | CallExpression", + "replacement": "| CallExpression\n | NewExpression" + }, + { + "_comment_": " MethodDefinition must come before IdentifierReference.", + "name": "PropertyDefinition", + "pattern": "| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName \":\" AssignmentExpression -- alt3\n | MethodDefinition -- alt4", + "replacement": "| MethodDefinition -- alt4\n | PropertyName \":\" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2" + }, + { + "_comment_": " Need this rather than `#sc` so that EmptyStatement is not nullable.", + "name": "EmptyStatement", + "override": "\";\" // note: this semicolon eats newlines" + }, + { + "_comment_": " ArrowFunction must come before ConditionalExpression, because the arrow function parameters will parse as a parenthesized expression. Both LeftHandSideExpression alternatives must also come before ConditionalExpression.", + "name": "AssignmentExpression", + "pattern": "| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt4\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt5", + "replacement": "| ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt4\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt5\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2" + }, + { + "name": "FormalParameters", + "pattern": "| /* empty */ -- alt1\n | FormalParameterList -- alt2", + "replacement": "| FormalParameterList -- alt2\n | /* empty */ -- alt1" + }, + { + "_comment_": " The recursive MemberExpression application must come before PrimaryExpression.", + "name": "MemberExpression", + "pattern": "| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7", + "replacement": "| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6" + }, + { + "_comment_": " Move PostfixExpression to the very end.", + "name": "UnaryExpression", + "pattern": " | UpdateExpression -- alt1\n", + "postlude": "\n | UpdateExpression -- alt1", + "replacement": "" + }, + { + "_comment_": " The first alternative is a subset of the second one, so flip the order.", + "name": "ConditionalExpression", + "pattern": "| LogicalORExpression -- alt1\n | LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2", + "replacement": "| LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2\n | LogicalORExpression -- alt1" + }, + { + "_comment_": " First, put move the left recursive application above the ShiftExpression. (It's not properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` to be right before the `'in'` terminal.", + "name": "RelationalExpression", + "pattern": "| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7", + "replacement": "| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1" + }, + { + "_comment_": " FIXME: Make sure these produce something useful.", + "name": "identifierPart", + "pattern": "| \"\" /* FIXME */ -- alt5\n | \"\" /* FIXME */ -- alt6", + "replacement": "| \"_\" -- alt5 /* FIXME */" + }, + { + "_comment_": " Move decimalLiteral to the very end.", + "name": "numericLiteral", + "pattern": " | decimalLiteral\n", + "postlude": "\n | decimalLiteral", + "replacement": "" + }, + { + "_comment_": " alt2 is strictly a subset of alt3, so swap the order.", + "name": "FormalParameterList", + "pattern": "| FormalsList -- alt2\n | FormalsList \",\" FunctionRestParameter -- alt3", + "replacement": "| FormalsList \",\" FunctionRestParameter -- alt3\n | FormalsList -- alt2" + }, + { + "_comment_": " alt1 is strictly a subset of the following two alternatives, so put it at the end.", + "name": "PostfixExpression", + "pattern": "| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3", + "replacement": "| LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3\n | LeftHandSideExpression -- alt1" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "ModuleItemList", + "pattern": "| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1", + "replacement": "| ModuleItem+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "singleLineCommentChars", + "pattern": "| singleLineCommentChar singleLineCommentChars? -- alt1", + "replacement": "| singleLineCommentChar+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "doubleStringCharacters", + "pattern": "| doubleStringCharacter doubleStringCharacters? -- alt1", + "replacement": "| doubleStringCharacter+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "singleStringCharacters", + "pattern": "| singleStringCharacter singleStringCharacters? -- alt1", + "replacement": "| singleStringCharacter+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "templateCharacters", + "pattern": "| templateCharacter templateCharacters? -- alt1", + "replacement": "| templateCharacter+" + }, + { + "_comment_": " Change from recursive to iterative.", + "name": "multiLineCommentChars", + "pattern": "| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | \"*\" postAsteriskCommentChars? -- alt2", + "replacement": "(~\"*/\" sourceCharacter)*" + } + ] +} diff --git a/examples/ecmascript/spec/es2016/spec.grammar b/examples/ecmascript/spec/es2016/spec.grammar new file mode 100644 index 00000000..f64f00dd --- /dev/null +++ b/examples/ecmascript/spec/es2016/spec.grammar @@ -0,0 +1,1345 @@ +@define noStrictParametricProductions true + +@line 8777 + +SourceCharacter :: + > any Unicode code point + +@line 8887 + +InputElementDiv :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + RightBracePunctuator + +InputElementRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + RightBracePunctuator + RegularExpressionLiteral + +InputElementRegExpOrTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + RegularExpressionLiteral + TemplateSubstitutionTail + +InputElementTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + TemplateSubstitutionTail + +@line 9097 + +WhiteSpace :: + + + + + + + + +@line 9179 + +LineTerminator :: + + + + + +LineTerminatorSequence :: + + [lookahead != ] + + + + +@line 9202 + +Comment :: + MultiLineComment + SingleLineComment + +MultiLineComment :: + `/*` MultiLineCommentChars? `*/` + +MultiLineCommentChars :: + MultiLineNotAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +PostAsteriskCommentChars :: + MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +MultiLineNotAsteriskChar :: + SourceCharacter but not `*` + +MultiLineNotForwardSlashOrAsteriskChar :: + SourceCharacter but not one of `/` or `*` + +SingleLineComment :: + `//` SingleLineCommentChars? + +SingleLineCommentChars :: + SingleLineCommentChar SingleLineCommentChars? + +SingleLineCommentChar :: + SourceCharacter but not LineTerminator + +@line 9239 + +CommonToken :: + IdentifierName + Punctuator + NumericLiteral + StringLiteral + Template + +@line 9262 + +IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + +IdentifierStart :: + UnicodeIDStart + `$` + `_` + `\` UnicodeEscapeSequence + +IdentifierPart :: + UnicodeIDContinue + `$` + `_` + `\` UnicodeEscapeSequence + + + +UnicodeIDStart :: + > any Unicode code point with the Unicode property “ID_Start” + +UnicodeIDContinue :: + > any Unicode code point with the Unicode property “ID_Continue” + +@line 9333 + +ReservedWord :: + Keyword + FutureReservedWord + NullLiteral + BooleanLiteral + +@line 9349 + +Keyword :: one of + `break` `do` `in` `typeof` `case` `else` `instanceof` `var` `catch` `export` `new` `void` `class` `extends` `return` `while` `const` `finally` `super` `with` `continue` `for` `switch` `yield` `debugger` `function` `this` `default` `if` `throw` `delete` `import` `try` + +@line 9363 + +FutureReservedWord :: + `enum` + `await` + +@line 9412 + +Punctuator :: one of + `{` `(` `)` `[` `]` `.` `...` `;` `,` `<` `>` `<=` `>=` `==` `!=` `===` `!==` `+` `-` `*` `%` `++` `--` `<<` `>>` `>>>` `&` `|` `^` `!` `~` `&&` `||` `?` `:` `=` `+=` `-=` `*=` `%=` `<<=` `>>=` `>>>=` `&=` `|=` `^=` `=>` `**` `**=` + +DivPunctuator :: + `/` + `/=` + +RightBracePunctuator :: + `}` + +@line 9433 + +NullLiteral :: + `null` + +@line 9443 + +BooleanLiteral :: + `true` + `false` + +@line 9454 + +NumericLiteral :: + DecimalLiteral + BinaryIntegerLiteral + OctalIntegerLiteral + HexIntegerLiteral + +DecimalLiteral :: + DecimalIntegerLiteral `.` DecimalDigits? ExponentPart? + `.` DecimalDigits ExponentPart? + DecimalIntegerLiteral ExponentPart? + +DecimalIntegerLiteral :: + `0` + NonZeroDigit DecimalDigits? + +DecimalDigits :: + DecimalDigit + DecimalDigits DecimalDigit + +DecimalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + +NonZeroDigit :: one of + `1` `2` `3` `4` `5` `6` `7` `8` `9` + +ExponentPart :: + ExponentIndicator SignedInteger + +ExponentIndicator :: one of + `e` `E` + +SignedInteger :: + DecimalDigits + `+` DecimalDigits + `-` DecimalDigits + +BinaryIntegerLiteral :: + `0b` BinaryDigits + `0B` BinaryDigits + +BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + +BinaryDigit :: one of + `0` `1` + +OctalIntegerLiteral :: + `0o` OctalDigits + `0O` OctalDigits + +OctalDigits :: + OctalDigit + OctalDigits OctalDigit + +OctalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` + +HexIntegerLiteral :: + `0x` HexDigits + `0X` HexDigits + +HexDigits :: + HexDigit + HexDigits HexDigit + +HexDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `a` `b` `c` `d` `e` `f` `A` `B` `C` `D` `E` `F` + +@line 9702 + +StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + +DoubleStringCharacters :: + DoubleStringCharacter DoubleStringCharacters? + +SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + +DoubleStringCharacter :: + SourceCharacter but not one of `"` or `\` or LineTerminator + `\` EscapeSequence + LineContinuation + +SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + `\` EscapeSequence + LineContinuation + +LineContinuation :: + `\` LineTerminatorSequence + +EscapeSequence :: + CharacterEscapeSequence + `0` [lookahead >` AdditiveExpression[?Yield] + ShiftExpression[?Yield] `>>>` AdditiveExpression[?Yield] + +@line 13026 + +RelationalExpression[In, Yield] : + ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `<` ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `>` ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `<=` ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `>=` ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `instanceof` ShiftExpression[?Yield] + [+In] RelationalExpression[+In, ?Yield] `in` ShiftExpression[?Yield] + +@line 13163 + +EqualityExpression[In, Yield] : + RelationalExpression[?In, ?Yield] + EqualityExpression[?In, ?Yield] `==` RelationalExpression[?In, ?Yield] + EqualityExpression[?In, ?Yield] `!=` RelationalExpression[?In, ?Yield] + EqualityExpression[?In, ?Yield] `===` RelationalExpression[?In, ?Yield] + EqualityExpression[?In, ?Yield] `!==` RelationalExpression[?In, ?Yield] + +@line 13287 + +BitwiseANDExpression[In, Yield] : + EqualityExpression[?In, ?Yield] + BitwiseANDExpression[?In, ?Yield] `&` EqualityExpression[?In, ?Yield] + +BitwiseXORExpression[In, Yield] : + BitwiseANDExpression[?In, ?Yield] + BitwiseXORExpression[?In, ?Yield] `^` BitwiseANDExpression[?In, ?Yield] + +BitwiseORExpression[In, Yield] : + BitwiseXORExpression[?In, ?Yield] + BitwiseORExpression[?In, ?Yield] `|` BitwiseXORExpression[?In, ?Yield] + +@line 13353 + +LogicalANDExpression[In, Yield] : + BitwiseORExpression[?In, ?Yield] + LogicalANDExpression[?In, ?Yield] `&&` BitwiseORExpression[?In, ?Yield] + +LogicalORExpression[In, Yield] : + LogicalANDExpression[?In, ?Yield] + LogicalORExpression[?In, ?Yield] `||` LogicalANDExpression[?In, ?Yield] + +@line 13422 + +ConditionalExpression[In, Yield] : + LogicalORExpression[?In, ?Yield] + LogicalORExpression[?In, ?Yield] `?` AssignmentExpression[+In, ?Yield] `:` AssignmentExpression[?In, ?Yield] + +@line 13472 + +AssignmentExpression[In, Yield] : + ConditionalExpression[?In, ?Yield] + [+Yield] YieldExpression[?In] + ArrowFunction[?In, ?Yield] + LeftHandSideExpression[?Yield] `=` AssignmentExpression[?In, ?Yield] #assignment + LeftHandSideExpression[?Yield] AssignmentOperator AssignmentExpression[?In, ?Yield] + +AssignmentOperator : one of + `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + +@line 13582 + +AssignmentPattern[Yield] : + ObjectAssignmentPattern[?Yield] + ArrayAssignmentPattern[?Yield] + +ObjectAssignmentPattern[Yield] : + `{` `}` + `{` AssignmentPropertyList[?Yield] `}` + `{` AssignmentPropertyList[?Yield] `,` `}` + +ArrayAssignmentPattern[Yield] : + `[` Elision? AssignmentRestElement[?Yield]? `]` + `[` AssignmentElementList[?Yield] `]` + `[` AssignmentElementList[?Yield] `,` Elision? AssignmentRestElement[?Yield]? `]` + +AssignmentPropertyList[Yield] : + AssignmentProperty[?Yield] + AssignmentPropertyList[?Yield] `,` AssignmentProperty[?Yield] + +AssignmentElementList[Yield] : + AssignmentElisionElement[?Yield] + AssignmentElementList[?Yield] `,` AssignmentElisionElement[?Yield] + +AssignmentElisionElement[Yield] : + Elision? AssignmentElement[?Yield] + +AssignmentProperty[Yield] : + IdentifierReference[?Yield] Initializer[+In, ?Yield]? + PropertyName[?Yield] `:` AssignmentElement[?Yield] + +AssignmentElement[Yield] : + DestructuringAssignmentTarget[?Yield] Initializer[+In, ?Yield]? + +AssignmentRestElement[Yield] : + `...` DestructuringAssignmentTarget[?Yield] + +DestructuringAssignmentTarget[Yield] : + LeftHandSideExpression[?Yield] + +@line 13869 + +Expression[In, Yield] : + AssignmentExpression[?In, ?Yield] + Expression[?In, ?Yield] `,` AssignmentExpression[?In, ?Yield] + +@line 13916 + +Statement[Yield, Return] : + BlockStatement[?Yield, ?Return] + VariableStatement[?Yield] + EmptyStatement + ExpressionStatement[?Yield] + IfStatement[?Yield, ?Return] + BreakableStatement[?Yield, ?Return] + ContinueStatement[?Yield] + BreakStatement[?Yield] + [+Return] ReturnStatement[?Yield] + WithStatement[?Yield, ?Return] + LabelledStatement[?Yield, ?Return] + ThrowStatement[?Yield] + TryStatement[?Yield, ?Return] + DebuggerStatement + +Declaration[Yield] : + HoistableDeclaration[?Yield] + ClassDeclaration[?Yield] + LexicalDeclaration[+In, ?Yield] + +HoistableDeclaration[Yield, Default] : + FunctionDeclaration[?Yield, ?Default] + GeneratorDeclaration[?Yield, ?Default] + +BreakableStatement[Yield, Return] : + IterationStatement[?Yield, ?Return] + SwitchStatement[?Yield, ?Return] + +@line 14137 + +BlockStatement[Yield, Return] : + Block[?Yield, ?Return] + +Block[Yield, Return] : + `{` StatementList[?Yield, ?Return]? `}` + +StatementList[Yield, Return] : + StatementListItem[?Yield, ?Return] + StatementList[?Yield, ?Return] StatementListItem[?Yield, ?Return] + +StatementListItem[Yield, Return] : + Statement[?Yield, ?Return] + Declaration[?Yield] + +@line 14498 + +LexicalDeclaration[In, Yield] : + LetOrConst BindingList[?In, ?Yield] `;` + +LetOrConst : + `let` + `const` + +BindingList[In, Yield] : + LexicalBinding[?In, ?Yield] + BindingList[?In, ?Yield] `,` LexicalBinding[?In, ?Yield] + +LexicalBinding[In, Yield] : + BindingIdentifier[?Yield] Initializer[?In, ?Yield]? + BindingPattern[?Yield] Initializer[?In, ?Yield] + +@line 14628 + +VariableStatement[Yield] : + `var` VariableDeclarationList[+In, ?Yield] `;` + +VariableDeclarationList[In, Yield] : + VariableDeclaration[?In, ?Yield] + VariableDeclarationList[?In, ?Yield] `,` VariableDeclaration[?In, ?Yield] + +VariableDeclaration[In, Yield] : + BindingIdentifier[?Yield] Initializer[?In, ?Yield]? + BindingPattern[?Yield] Initializer[?In, ?Yield] + +@line 14733 + +BindingPattern[Yield] : + ObjectBindingPattern[?Yield] + ArrayBindingPattern[?Yield] + +ObjectBindingPattern[Yield] : + `{` `}` + `{` BindingPropertyList[?Yield] `}` + `{` BindingPropertyList[?Yield] `,` `}` + +ArrayBindingPattern[Yield] : + `[` Elision? BindingRestElement[?Yield]? `]` + `[` BindingElementList[?Yield] `]` + `[` BindingElementList[?Yield] `,` Elision? BindingRestElement[?Yield]? `]` + +BindingPropertyList[Yield] : + BindingProperty[?Yield] + BindingPropertyList[?Yield] `,` BindingProperty[?Yield] + +BindingElementList[Yield] : + BindingElisionElement[?Yield] + BindingElementList[?Yield] `,` BindingElisionElement[?Yield] + +BindingElisionElement[Yield] : + Elision? BindingElement[?Yield] + +BindingProperty[Yield] : + SingleNameBinding[?Yield] + PropertyName[?Yield] `:` BindingElement[?Yield] + +BindingElement[Yield] : + SingleNameBinding[?Yield] + BindingPattern[?Yield] Initializer[+In, ?Yield]? + +SingleNameBinding[Yield] : + BindingIdentifier[?Yield] Initializer[+In, ?Yield]? + +BindingRestElement[Yield] : + `...` BindingIdentifier[?Yield] + `...` BindingPattern[?Yield] + +@line 15178 + +EmptyStatement : + `;` + +@line 15197 + +ExpressionStatement[Yield] : + [lookahead ` ConciseBody[?In] + +ArrowParameters[Yield] : + BindingIdentifier[?Yield] + CoverParenthesizedExpressionAndArrowParameterList[?Yield] #parencover + +ConciseBody[In] : + [lookahead != `{` ] AssignmentExpression[?In] + `{` FunctionBody `}` + +@line 17939 + +ArrowFormalParameters[Yield] : + `(` StrictFormalParameters[?Yield] `)` + +@line 18179 + +MethodDefinition[Yield] : + PropertyName[?Yield] `(` StrictFormalParameters `)` `{` FunctionBody `}` + GeneratorMethod[?Yield] + `get` PropertyName[?Yield] `(` `)` `{` FunctionBody `}` + `set` PropertyName[?Yield] `(` PropertySetParameterList `)` `{` FunctionBody `}` + +PropertySetParameterList : + FormalParameter + +@line 18375 + +GeneratorMethod[Yield] : + `*` PropertyName[?Yield] `(` StrictFormalParameters[+Yield] `)` `{` GeneratorBody `}` + +GeneratorDeclaration[Yield, Default] : + `function` `*` BindingIdentifier[?Yield] `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` + +GeneratorExpression : + `function` `*` BindingIdentifier[+Yield]? `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` + +GeneratorBody : + FunctionBody[+Yield] + +YieldExpression[In] : + `yield` + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield] + +@line 18727 + +ClassDeclaration[Yield, Default] : + `class` BindingIdentifier[?Yield] ClassTail[?Yield] + [+Default] `class` ClassTail[?Yield] + +ClassExpression[Yield] : + `class` BindingIdentifier[?Yield]? ClassTail[?Yield] + +ClassTail[Yield] : + ClassHeritage[?Yield]? `{` ClassBody[?Yield]? `}` + +ClassHeritage[Yield] : + `extends` LeftHandSideExpression[?Yield] + +ClassBody[Yield] : + ClassElementList[?Yield] + +ClassElementList[Yield] : + ClassElement[?Yield] + ClassElementList[?Yield] ClassElement[?Yield] + +ClassElement[Yield] : + MethodDefinition[?Yield] + `static` MethodDefinition[?Yield] + `;` + +@line 19445 + +Script : + ScriptBody? + +ScriptBody : + StatementList + +@line 19743 + +Module : + ModuleBody? + +ModuleBody : + ModuleItemList + +ModuleItemList : + ModuleItem + ModuleItemList ModuleItem + +ModuleItem : + ImportDeclaration + ExportDeclaration + StatementListItem + +@line 20990 + +ImportDeclaration : + `import` ImportClause FromClause `;` + `import` ModuleSpecifier `;` + +ImportClause : + ImportedDefaultBinding + NameSpaceImport + NamedImports + ImportedDefaultBinding `,` NameSpaceImport + ImportedDefaultBinding `,` NamedImports + +ImportedDefaultBinding : + ImportedBinding + +NameSpaceImport : + `*` `as` ImportedBinding + +NamedImports : + `{` `}` + `{` ImportsList `}` + `{` ImportsList `,` `}` + +FromClause : + `from` ModuleSpecifier + +ImportsList : + ImportSpecifier + ImportsList `,` ImportSpecifier + +ImportSpecifier : + ImportedBinding + IdentifierName `as` ImportedBinding + +ModuleSpecifier : + StringLiteral + +ImportedBinding : + BindingIdentifier + +@line 21169 + +ExportDeclaration : + `export` `*` FromClause `;` + `export` ExportClause FromClause `;` + `export` ExportClause `;` + `export` VariableStatement + `export` Declaration + `export` `default` HoistableDeclaration[+Default] + `export` `default` ClassDeclaration[+Default] + `export` `default` [lookahead but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF] + +TrailSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF] + +NonSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] + +IdentityEscape[U] :: + [+U] SyntaxCharacter + [+U] `/` + [~U] SourceCharacter but not UnicodeIDContinue + +DecimalEscape :: + DecimalIntegerLiteral [lookahead any Unicode code point + +@line 8887 + +InputElementDiv :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + RightBracePunctuator + +InputElementRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + RightBracePunctuator + RegularExpressionLiteral + +InputElementRegExpOrTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + RegularExpressionLiteral + TemplateSubstitutionTail + +InputElementTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + TemplateSubstitutionTail + +@line 9097 + +WhiteSpace :: + + + + + + + + +@line 9179 + +LineTerminator :: + + + + + +LineTerminatorSequence :: + + [lookahead != ] + + + + +@line 9202 + +Comment :: + MultiLineComment + SingleLineComment + +MultiLineComment :: + `/*` MultiLineCommentChars? `*/` + +MultiLineCommentChars :: + MultiLineNotAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +PostAsteriskCommentChars :: + MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +MultiLineNotAsteriskChar :: + SourceCharacter but not `*` + +MultiLineNotForwardSlashOrAsteriskChar :: + SourceCharacter but not one of `/` or `*` + +SingleLineComment :: + `//` SingleLineCommentChars? + +SingleLineCommentChars :: + SingleLineCommentChar SingleLineCommentChars? + +SingleLineCommentChar :: + SourceCharacter but not LineTerminator + +@line 9239 + +CommonToken :: + IdentifierName + Punctuator + NumericLiteral + StringLiteral + Template + +@line 9262 + +IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + +IdentifierStart :: + UnicodeIDStart + `$` + `_` + `\` UnicodeEscapeSequence + +IdentifierPart :: + UnicodeIDContinue + `$` + `_` + `\` UnicodeEscapeSequence + + + +UnicodeIDStart :: + > any Unicode code point with the Unicode property “ID_Start” + +UnicodeIDContinue :: + > any Unicode code point with the Unicode property “ID_Continue” + +@line 9333 + +ReservedWord :: + Keyword + FutureReservedWord + NullLiteral + BooleanLiteral + +@line 9349 + +Keyword :: one of + `break` `do` `in` `typeof` `case` `else` `instanceof` `var` `catch` `export` `new` `void` `class` `extends` `return` `while` `const` `finally` `super` `with` `continue` `for` `switch` `yield` `debugger` `function` `this` `default` `if` `throw` `delete` `import` `try` + +@line 9363 + +FutureReservedWord :: + `enum` + `await` + +@line 9412 + +Punctuator :: one of + `{` `(` `)` `[` `]` `.` `...` `;` `,` `<` `>` `<=` `>=` `==` `!=` `===` `!==` `+` `-` `*` `%` `++` `--` `<<` `>>` `>>>` `&` `|` `^` `!` `~` `&&` `||` `?` `:` `=` `+=` `-=` `*=` `%=` `<<=` `>>=` `>>>=` `&=` `|=` `^=` `=>` `**` `**=` + +DivPunctuator :: + `/` + `/=` + +RightBracePunctuator :: + `}` + +@line 9433 + +NullLiteral :: + `null` + +@line 9443 + +BooleanLiteral :: + `true` + `false` + +@line 9454 + +NumericLiteral :: + DecimalLiteral + BinaryIntegerLiteral + OctalIntegerLiteral + HexIntegerLiteral + +DecimalLiteral :: + DecimalIntegerLiteral `.` DecimalDigits? ExponentPart? + `.` DecimalDigits ExponentPart? + DecimalIntegerLiteral ExponentPart? + +DecimalIntegerLiteral :: + `0` + NonZeroDigit DecimalDigits? + +DecimalDigits :: + DecimalDigit + DecimalDigits DecimalDigit + +DecimalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + +NonZeroDigit :: one of + `1` `2` `3` `4` `5` `6` `7` `8` `9` + +ExponentPart :: + ExponentIndicator SignedInteger + +ExponentIndicator :: one of + `e` `E` + +SignedInteger :: + DecimalDigits + `+` DecimalDigits + `-` DecimalDigits + +BinaryIntegerLiteral :: + `0b` BinaryDigits + `0B` BinaryDigits + +BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + +BinaryDigit :: one of + `0` `1` + +OctalIntegerLiteral :: + `0o` OctalDigits + `0O` OctalDigits + +OctalDigits :: + OctalDigit + OctalDigits OctalDigit + +OctalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` + +HexIntegerLiteral :: + `0x` HexDigits + `0X` HexDigits + +HexDigits :: + HexDigit + HexDigits HexDigit + +HexDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `a` `b` `c` `d` `e` `f` `A` `B` `C` `D` `E` `F` + +StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + +DoubleStringCharacters :: + DoubleStringCharacter DoubleStringCharacters? + +SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + +DoubleStringCharacter :: + SourceCharacter but not one of `"` or `\` or LineTerminator + `\` EscapeSequence + LineContinuation + +SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + `\` EscapeSequence + LineContinuation + +LineContinuation :: + `\` LineTerminatorSequence + +EscapeSequence :: + CharacterEscapeSequence + `0` [lookahead >` AdditiveExpression[?Yield] + ShiftExpression[?Yield] `>>>` AdditiveExpression[?Yield] + +@line 13026 + +RelationalExpression[In, Yield] : + ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `<` ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `>` ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `<=` ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `>=` ShiftExpression[?Yield] + RelationalExpression[?In, ?Yield] `instanceof` ShiftExpression[?Yield] + [+In] RelationalExpression[+In, ?Yield] `in` ShiftExpression[?Yield] + +@line 13163 + +EqualityExpression[In, Yield] : + RelationalExpression[?In, ?Yield] + EqualityExpression[?In, ?Yield] `==` RelationalExpression[?In, ?Yield] + EqualityExpression[?In, ?Yield] `!=` RelationalExpression[?In, ?Yield] + EqualityExpression[?In, ?Yield] `===` RelationalExpression[?In, ?Yield] + EqualityExpression[?In, ?Yield] `!==` RelationalExpression[?In, ?Yield] + +@line 13287 + +BitwiseANDExpression[In, Yield] : + EqualityExpression[?In, ?Yield] + BitwiseANDExpression[?In, ?Yield] `&` EqualityExpression[?In, ?Yield] + +BitwiseXORExpression[In, Yield] : + BitwiseANDExpression[?In, ?Yield] + BitwiseXORExpression[?In, ?Yield] `^` BitwiseANDExpression[?In, ?Yield] + +BitwiseORExpression[In, Yield] : + BitwiseXORExpression[?In, ?Yield] + BitwiseORExpression[?In, ?Yield] `|` BitwiseXORExpression[?In, ?Yield] + +@line 13353 + +LogicalANDExpression[In, Yield] : + BitwiseORExpression[?In, ?Yield] + LogicalANDExpression[?In, ?Yield] `&&` BitwiseORExpression[?In, ?Yield] + +LogicalORExpression[In, Yield] : + LogicalANDExpression[?In, ?Yield] + LogicalORExpression[?In, ?Yield] `||` LogicalANDExpression[?In, ?Yield] + +@line 13422 + +ConditionalExpression[In, Yield] : + LogicalORExpression[?In, ?Yield] + LogicalORExpression[?In, ?Yield] `?` AssignmentExpression[+In, ?Yield] `:` AssignmentExpression[?In, ?Yield] + +@line 13472 + +AssignmentExpression[In, Yield] : + ConditionalExpression[?In, ?Yield] + [+Yield] YieldExpression[?In] + ArrowFunction[?In, ?Yield] + LeftHandSideExpression[?Yield] `=` AssignmentExpression[?In, ?Yield] #assignment + LeftHandSideExpression[?Yield] AssignmentOperator AssignmentExpression[?In, ?Yield] + +AssignmentOperator : one of + `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + +@line 13582 + +AssignmentPattern[Yield] : + ObjectAssignmentPattern[?Yield] + ArrayAssignmentPattern[?Yield] + +ObjectAssignmentPattern[Yield] : + `{` `}` + `{` AssignmentPropertyList[?Yield] `}` + `{` AssignmentPropertyList[?Yield] `,` `}` + +ArrayAssignmentPattern[Yield] : + `[` Elision? AssignmentRestElement[?Yield]? `]` + `[` AssignmentElementList[?Yield] `]` + `[` AssignmentElementList[?Yield] `,` Elision? AssignmentRestElement[?Yield]? `]` + +AssignmentPropertyList[Yield] : + AssignmentProperty[?Yield] + AssignmentPropertyList[?Yield] `,` AssignmentProperty[?Yield] + +AssignmentElementList[Yield] : + AssignmentElisionElement[?Yield] + AssignmentElementList[?Yield] `,` AssignmentElisionElement[?Yield] + +AssignmentElisionElement[Yield] : + Elision? AssignmentElement[?Yield] + +AssignmentProperty[Yield] : + IdentifierReference[?Yield] Initializer[+In, ?Yield]? + PropertyName[?Yield] `:` AssignmentElement[?Yield] + +AssignmentElement[Yield] : + DestructuringAssignmentTarget[?Yield] Initializer[+In, ?Yield]? + +AssignmentRestElement[Yield] : + `...` DestructuringAssignmentTarget[?Yield] + +DestructuringAssignmentTarget[Yield] : + LeftHandSideExpression[?Yield] + +@line 13869 + +Expression[In, Yield] : + AssignmentExpression[?In, ?Yield] + Expression[?In, ?Yield] `,` AssignmentExpression[?In, ?Yield] + +@line 13916 + +Statement[Yield, Return] : + BlockStatement[?Yield, ?Return] + VariableStatement[?Yield] + EmptyStatement + ExpressionStatement[?Yield] + IfStatement[?Yield, ?Return] + BreakableStatement[?Yield, ?Return] + ContinueStatement[?Yield] + BreakStatement[?Yield] + [+Return] ReturnStatement[?Yield] + WithStatement[?Yield, ?Return] + LabelledStatement[?Yield, ?Return] + ThrowStatement[?Yield] + TryStatement[?Yield, ?Return] + DebuggerStatement + +Declaration[Yield] : + HoistableDeclaration[?Yield, ~Default] + ClassDeclaration[?Yield, ~Default] + LexicalDeclaration[+In, ?Yield] + +HoistableDeclaration[Yield, Default] : + FunctionDeclaration[?Yield, ?Default] + GeneratorDeclaration[?Yield, ?Default] + +BreakableStatement[Yield, Return] : + IterationStatement[?Yield, ?Return] + SwitchStatement[?Yield, ?Return] + +@line 14137 + +BlockStatement[Yield, Return] : + Block[?Yield, ?Return] + +Block[Yield, Return] : + `{` StatementList[?Yield, ?Return]? `}` + +StatementList[Yield, Return] : + StatementListItem[?Yield, ?Return] + StatementList[?Yield, ?Return] StatementListItem[?Yield, ?Return] + +StatementListItem[Yield, Return] : + Statement[?Yield, ?Return] + Declaration[?Yield] + +@line 14498 + +LexicalDeclaration[In, Yield] : + LetOrConst BindingList[?In, ?Yield] `;` + +LetOrConst : + `let` + `const` + +BindingList[In, Yield] : + LexicalBinding[?In, ?Yield] + BindingList[?In, ?Yield] `,` LexicalBinding[?In, ?Yield] + +LexicalBinding[In, Yield] : + BindingIdentifier[?Yield] Initializer[?In, ?Yield]? + BindingPattern[?Yield] Initializer[?In, ?Yield] + +@line 14628 + +VariableStatement[Yield] : + `var` VariableDeclarationList[+In, ?Yield] `;` + +VariableDeclarationList[In, Yield] : + VariableDeclaration[?In, ?Yield] + VariableDeclarationList[?In, ?Yield] `,` VariableDeclaration[?In, ?Yield] + +VariableDeclaration[In, Yield] : + BindingIdentifier[?Yield] Initializer[?In, ?Yield]? + BindingPattern[?Yield] Initializer[?In, ?Yield] + +@line 14733 + +BindingPattern[Yield] : + ObjectBindingPattern[?Yield] + ArrayBindingPattern[?Yield] + +ObjectBindingPattern[Yield] : + `{` `}` + `{` BindingPropertyList[?Yield] `}` + `{` BindingPropertyList[?Yield] `,` `}` + +ArrayBindingPattern[Yield] : + `[` Elision? BindingRestElement[?Yield]? `]` + `[` BindingElementList[?Yield] `]` + `[` BindingElementList[?Yield] `,` Elision? BindingRestElement[?Yield]? `]` + +BindingPropertyList[Yield] : + BindingProperty[?Yield] + BindingPropertyList[?Yield] `,` BindingProperty[?Yield] + +BindingElementList[Yield] : + BindingElisionElement[?Yield] + BindingElementList[?Yield] `,` BindingElisionElement[?Yield] + +BindingElisionElement[Yield] : + Elision? BindingElement[?Yield] + +BindingProperty[Yield] : + SingleNameBinding[?Yield] + PropertyName[?Yield] `:` BindingElement[?Yield] + +BindingElement[Yield] : + SingleNameBinding[?Yield] + BindingPattern[?Yield] Initializer[+In, ?Yield]? + +SingleNameBinding[Yield] : + BindingIdentifier[?Yield] Initializer[+In, ?Yield]? + +BindingRestElement[Yield] : + `...` BindingIdentifier[?Yield] + `...` BindingPattern[?Yield] + +@line 15178 + +EmptyStatement : + `;` + +@line 15197 + +ExpressionStatement[Yield] : + [lookahead ` ConciseBody[?In] + +ArrowParameters[Yield] : + BindingIdentifier[?Yield] + CoverParenthesizedExpressionAndArrowParameterList[?Yield] #parencover + +ConciseBody[In] : + [lookahead != `{` ] AssignmentExpression[?In, ~Yield] + `{` FunctionBody[~Yield] `}` + +@line 17939 + +ArrowFormalParameters[Yield] : + `(` StrictFormalParameters[?Yield] `)` + +@line 18179 + +MethodDefinition[Yield] : + PropertyName[?Yield] `(` StrictFormalParameters[~Yield] `)` `{` FunctionBody[~Yield] `}` + GeneratorMethod[?Yield] + `get` PropertyName[?Yield] `(` `)` `{` FunctionBody[~Yield] `}` + `set` PropertyName[?Yield] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield] `}` + +PropertySetParameterList : + FormalParameter[~Yield] + +@line 18375 + +GeneratorMethod[Yield] : + `*` PropertyName[?Yield] `(` StrictFormalParameters[+Yield] `)` `{` GeneratorBody `}` + +GeneratorDeclaration[Yield, Default] : + `function` `*` BindingIdentifier[?Yield] `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` + +GeneratorExpression : + `function` `*` BindingIdentifier[+Yield]? `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` + +GeneratorBody : + FunctionBody[+Yield] + +YieldExpression[In] : + `yield` + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield] + +@line 18727 + +ClassDeclaration[Yield, Default] : + `class` BindingIdentifier[?Yield] ClassTail[?Yield] + [+Default] `class` ClassTail[?Yield] + +ClassExpression[Yield] : + `class` BindingIdentifier[?Yield]? ClassTail[?Yield] + +ClassTail[Yield] : + ClassHeritage[?Yield]? `{` ClassBody[?Yield]? `}` + +ClassHeritage[Yield] : + `extends` LeftHandSideExpression[?Yield] + +ClassBody[Yield] : + ClassElementList[?Yield] + +ClassElementList[Yield] : + ClassElement[?Yield] + ClassElementList[?Yield] ClassElement[?Yield] + +ClassElement[Yield] : + MethodDefinition[?Yield] + `static` MethodDefinition[?Yield] + `;` + +@line 19445 + +Script : + ScriptBody? + +ScriptBody : + StatementList[~Yield, ~Return] + +@line 19743 + +Module : + ModuleBody? + +ModuleBody : + ModuleItemList + +ModuleItemList : + ModuleItem + ModuleItemList ModuleItem + +ModuleItem : + ImportDeclaration + ExportDeclaration + StatementListItem[~Yield, ~Return] + +@line 20990 + +ImportDeclaration : + `import` ImportClause FromClause `;` + `import` ModuleSpecifier `;` + +ImportClause : + ImportedDefaultBinding + NameSpaceImport + NamedImports + ImportedDefaultBinding `,` NameSpaceImport + ImportedDefaultBinding `,` NamedImports + +ImportedDefaultBinding : + ImportedBinding + +NameSpaceImport : + `*` `as` ImportedBinding + +NamedImports : + `{` `}` + `{` ImportsList `}` + `{` ImportsList `,` `}` + +FromClause : + `from` ModuleSpecifier + +ImportsList : + ImportSpecifier + ImportsList `,` ImportSpecifier + +ImportSpecifier : + ImportedBinding + IdentifierName `as` ImportedBinding + +ModuleSpecifier : + StringLiteral + +ImportedBinding : + BindingIdentifier[~Yield] + +@line 21169 + +ExportDeclaration : + `export` `*` FromClause `;` + `export` ExportClause FromClause `;` + `export` ExportClause `;` + `export` VariableStatement[~Yield] + `export` Declaration[~Yield] + `export` `default` HoistableDeclaration[~Yield, +Default] + `export` `default` ClassDeclaration[~Yield, +Default] + `export` `default` [lookahead but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF] + +TrailSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF] + +NonSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] + +IdentityEscape[U] :: + [+U] SyntaxCharacter + [+U] `/` + [~U] SourceCharacter but not UnicodeIDContinue + +DecimalEscape :: + DecimalIntegerLiteral [lookahead \n | CallExpression", + "replacement": "| CallExpression\n | NewExpression" + }, + { + "_comment_": "MethodDefinition must come before IdentifierReference.", + "name": "PropertyDefinition", + "pattern": "| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName \":\" AssignmentExpression -- alt3\n | MethodDefinition -- alt4", + "replacement": "| MethodDefinition -- alt4\n | PropertyName \":\" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2" + }, + { + "_comment_": "Need this rather than `#sc` so that EmptyStatement is not nullable.", + "name": "EmptyStatement", + "override": "\";\" // note: this semicolon eats newlines" + }, + { + "_comment_": "ArrowFunction must come before ConditionalExpression, because the arrow function parameters will parse as a parenthesized expression. Both LeftHandSideExpression alternatives must also come before ConditionalExpression.", + "name": "AssignmentExpression", + "pattern": "| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | AsyncArrowFunction -- alt4\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6", + "replacement": "| AsyncArrowFunction -- alt4\n | ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2" + }, + { + "name": "FormalParameters", + "pattern": "| /* empty */ -- alt1\n | FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5", + "replacement": "| FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5\n | /* empty */ -- alt1" + }, + { + "_comment_": "The recursive MemberExpression application must come before PrimaryExpression.", + "name": "MemberExpression", + "pattern": "| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7", + "replacement": "| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6" + }, + { + "_comment_": "Move PostfixExpression to the very end.", + "name": "UnaryExpression", + "pattern": " | UpdateExpression -- alt1\n", + "postlude": "\n | UpdateExpression -- alt1", + "replacement": "" + }, + { + "_comment_": "The first alternative is a subset of the second one, so flip the order.", + "name": "ConditionalExpression", + "pattern": "| LogicalORExpression -- alt1\n | LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2", + "replacement": "| LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2\n | LogicalORExpression -- alt1" + }, + { + "_comment_": "First, put move the left recursive application above the ShiftExpression. (It's not properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` to be right before the `\"in\"` terminal.", + "name": "RelationalExpression", + "pattern": "| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7", + "replacement": "| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1" + }, + { + "_comment_": "FIXME: Make sure these produce something useful.", + "name": "identifierPart", + "pattern": "| \"\" /* FIXME */ -- alt5\n | \"\" /* FIXME */ -- alt6", + "replacement": "| \"_\" -- alt5 /* FIXME */" + }, + { + "_comment_": "Move decimalLiteral to the very end.", + "name": "numericLiteral", + "pattern": " | decimalLiteral\n", + "postlude": "\n | decimalLiteral", + "replacement": "" + }, + { + "_comment_": "alt1 is strictly a subset of the following two alternatives, so put it at the end.", + "name": "PostfixExpression", + "pattern": "| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3", + "replacement": "| LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3\n | LeftHandSideExpression -- alt1" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "ModuleItemList", + "pattern": "| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1", + "replacement": "| ModuleItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleLineCommentChars", + "pattern": "| singleLineCommentChar singleLineCommentChars? -- alt1", + "replacement": "| singleLineCommentChar+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "doubleStringCharacters", + "pattern": "| doubleStringCharacter doubleStringCharacters? -- alt1", + "replacement": "| doubleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleStringCharacters", + "pattern": "| singleStringCharacter singleStringCharacters? -- alt1", + "replacement": "| singleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "templateCharacters", + "pattern": "| templateCharacter templateCharacters? -- alt1", + "replacement": "| templateCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "multiLineCommentChars", + "pattern": "| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | \"*\" postAsteriskCommentChars? -- alt2", + "replacement": "(~\"*/\" sourceCharacter)*" + } + ] +} diff --git a/examples/ecmascript/spec/es2017/spec.grammar b/examples/ecmascript/spec/es2017/spec.grammar new file mode 100644 index 00000000..9ed9f5a4 --- /dev/null +++ b/examples/ecmascript/spec/es2017/spec.grammar @@ -0,0 +1,1420 @@ +@define noStrictParametricProductions true + +@line 9040 + +SourceCharacter :: + > any Unicode code point + +@line 9150 + +InputElementDiv :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + RightBracePunctuator + +InputElementRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + RightBracePunctuator + RegularExpressionLiteral + +InputElementRegExpOrTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + RegularExpressionLiteral + TemplateSubstitutionTail + +InputElementTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + TemplateSubstitutionTail + +@line 9360 + +WhiteSpace :: + + + + + + + + +@line 9442 + +LineTerminator :: + + + + + +LineTerminatorSequence :: + + [lookahead != ] + + + + +@line 9465 + +Comment :: + MultiLineComment + SingleLineComment + +MultiLineComment :: + `/*` MultiLineCommentChars? `*/` + +MultiLineCommentChars :: + MultiLineNotAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +PostAsteriskCommentChars :: + MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +MultiLineNotAsteriskChar :: + SourceCharacter but not `*` + +MultiLineNotForwardSlashOrAsteriskChar :: + SourceCharacter but not one of `/` or `*` + +SingleLineComment :: + `//` SingleLineCommentChars? + +SingleLineCommentChars :: + SingleLineCommentChar SingleLineCommentChars? + +SingleLineCommentChar :: + SourceCharacter but not LineTerminator + +@line 9502 + +CommonToken :: + IdentifierName + Punctuator + NumericLiteral + StringLiteral + Template + +@line 9525 + +IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + +IdentifierStart :: + UnicodeIDStart + `$` + `_` + `\` UnicodeEscapeSequence + +IdentifierPart :: + UnicodeIDContinue + `$` + `_` + `\` UnicodeEscapeSequence + + + +UnicodeIDStart :: + > any Unicode code point with the Unicode property “ID_Start” + +UnicodeIDContinue :: + > any Unicode code point with the Unicode property “ID_Continue” + +@line 9596 + +ReservedWord :: + Keyword + FutureReservedWord + NullLiteral + BooleanLiteral + +@line 9612 + +Keyword :: + `await` + `break` + `case` `catch` `class` `const` `continue` + `debugger` `default` `delete` `do` + `else` `export` `extends` + `finally` `for` `function` + `if` `import` `in` `instanceof` + `new` + `return` + `super` `switch` + `this` `throw` `try` `typeof` + `var` `void` + `while` `with` + `yield` + +@line 9639 + +FutureReservedWord :: + `enum` + +@line 9686 + +Punctuator :: + `{` `(` `)` `[` `]` + `.` `...` `;` `,` + `<` `>` `<=` `>=` + `==` `!=` `===` `!==` + `+` `-` `*` `%` `**` + `++` `--` + `<<` `>>` `>>>` + `&` `|` `^` + `!` `~` + `&&` `||` + `?` `:` + `=` `+=` `-=` `*=` `%=` `**=` `<<=` `>>=` `>>>=` `&=` `|=` `^=` + `=>` + +DivPunctuator :: + `/` + `/=` + +RightBracePunctuator :: + `}` + +@line 9719 + +NullLiteral :: + `null` + +@line 9729 + +BooleanLiteral :: + `true` + `false` + +@line 9740 + +NumericLiteral :: + DecimalLiteral + BinaryIntegerLiteral + OctalIntegerLiteral + HexIntegerLiteral + +DecimalLiteral :: + DecimalIntegerLiteral `.` DecimalDigits? ExponentPart? + `.` DecimalDigits ExponentPart? + DecimalIntegerLiteral ExponentPart? + +DecimalIntegerLiteral :: + `0` + NonZeroDigit DecimalDigits? + +DecimalDigits :: + DecimalDigit + DecimalDigits DecimalDigit + +DecimalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + +NonZeroDigit :: one of + `1` `2` `3` `4` `5` `6` `7` `8` `9` + +ExponentPart :: + ExponentIndicator SignedInteger + +ExponentIndicator :: one of + `e` `E` + +SignedInteger :: + DecimalDigits + `+` DecimalDigits + `-` DecimalDigits + +BinaryIntegerLiteral :: + `0b` BinaryDigits + `0B` BinaryDigits + +BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + +BinaryDigit :: one of + `0` `1` + +OctalIntegerLiteral :: + `0o` OctalDigits + `0O` OctalDigits + +OctalDigits :: + OctalDigit + OctalDigits OctalDigit + +OctalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` + +HexIntegerLiteral :: + `0x` HexDigits + `0X` HexDigits + +HexDigits :: + HexDigit + HexDigits HexDigit + +HexDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `a` `b` `c` `d` `e` `f` `A` `B` `C` `D` `E` `F` + +@line 9988 + +StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + +DoubleStringCharacters :: + DoubleStringCharacter DoubleStringCharacters? + +SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + +DoubleStringCharacter :: + SourceCharacter but not one of `"` or `\` or LineTerminator + `\` EscapeSequence + LineContinuation + +SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + `\` EscapeSequence + LineContinuation + +LineContinuation :: + `\` LineTerminatorSequence + +EscapeSequence :: + CharacterEscapeSequence + `0` [lookahead >` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>>` AdditiveExpression[?Yield, ?Await] + +RelationalExpression[In, Yield, Await] : + ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `instanceof` ShiftExpression[?Yield, ?Await] + [+In] RelationalExpression[+In, ?Yield, ?Await] `in` ShiftExpression[?Yield, ?Await] + +@line 13494 + +EqualityExpression[In, Yield, Await] : + RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `==` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!=` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `===` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!==` RelationalExpression[?In, ?Yield, ?Await] + +@line 13618 + +BitwiseANDExpression[In, Yield, Await] : + EqualityExpression[?In, ?Yield, ?Await] + BitwiseANDExpression[?In, ?Yield, ?Await] `&` EqualityExpression[?In, ?Yield, ?Await] + +BitwiseXORExpression[In, Yield, Await] : + BitwiseANDExpression[?In, ?Yield, ?Await] + BitwiseXORExpression[?In, ?Yield, ?Await] `^` BitwiseANDExpression[?In, ?Yield, ?Await] + +BitwiseORExpression[In, Yield, Await] : + BitwiseXORExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] `|` BitwiseXORExpression[?In, ?Yield, ?Await] + +@line 13684 + +LogicalANDExpression[In, Yield, Await] : + BitwiseORExpression[?In, ?Yield, ?Await] + LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await] + +LogicalORExpression[In, Yield, Await] : + LogicalANDExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await] + +@line 13753 + +ConditionalExpression[In, Yield, Await] : + LogicalORExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await] + +@line 13803 + +AssignmentExpression[In, Yield, Await] : + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield] YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + +AssignmentOperator : one of + `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + +@line 13919 + +AssignmentPattern[Yield, Await] : + ObjectAssignmentPattern[?Yield, ?Await] + ArrayAssignmentPattern[?Yield, ?Await] + +ObjectAssignmentPattern[Yield, Await] : + `{` `}` + `{` AssignmentPropertyList[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `,` `}` + +ArrayAssignmentPattern[Yield, Await] : + `[` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + `[` AssignmentElementList[?Yield, ?Await] `]` + `[` AssignmentElementList[?Yield, ?Await] `,` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + +AssignmentPropertyList[Yield, Await] : + AssignmentProperty[?Yield, ?Await] + AssignmentPropertyList[?Yield, ?Await] `,` AssignmentProperty[?Yield, ?Await] + +AssignmentElementList[Yield, Await] : + AssignmentElisionElement[?Yield, ?Await] + AssignmentElementList[?Yield, ?Await] `,` AssignmentElisionElement[?Yield, ?Await] + +AssignmentElisionElement[Yield, Await] : + Elision? AssignmentElement[?Yield, ?Await] + +AssignmentProperty[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + PropertyName[?Yield, ?Await] `:` AssignmentElement[?Yield, ?Await] + +AssignmentElement[Yield, Await] : + DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +AssignmentRestElement[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +DestructuringAssignmentTarget[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + +@line 14204 + +Expression[In, Yield, Await] : + AssignmentExpression[?In, ?Yield, ?Await] + Expression[?In, ?Yield, ?Await] `,` AssignmentExpression[?In, ?Yield, ?Await] + +@line 14251 + +Statement[Yield, Await, Return] : + BlockStatement[?Yield, ?Await, ?Return] + VariableStatement[?Yield, ?Await] + EmptyStatement + ExpressionStatement[?Yield, ?Await] + IfStatement[?Yield, ?Await, ?Return] + BreakableStatement[?Yield, ?Await, ?Return] + ContinueStatement[?Yield, ?Await] + BreakStatement[?Yield, ?Await] + [+Return] ReturnStatement[?Yield, ?Await] + WithStatement[?Yield, ?Await, ?Return] + LabelledStatement[?Yield, ?Await, ?Return] + ThrowStatement[?Yield, ?Await] + TryStatement[?Yield, ?Await, ?Return] + DebuggerStatement + +Declaration[Yield, Await] : + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + +HoistableDeclaration[Yield, Await, Default] : + FunctionDeclaration[?Yield, ?Await, ?Default] + GeneratorDeclaration[?Yield, ?Await, ?Default] + AsyncFunctionDeclaration[?Yield, ?Await, ?Default] + +BreakableStatement[Yield, Await, Return] : + IterationStatement[?Yield, ?Await, ?Return] + SwitchStatement[?Yield, ?Await, ?Return] + +@line 14481 + +BlockStatement[Yield, Await, Return] : + Block[?Yield, ?Await, ?Return] + +Block[Yield, Await, Return] : + `{` StatementList[?Yield, ?Await, ?Return]? `}` + +StatementList[Yield, Await, Return] : + StatementListItem[?Yield, ?Await, ?Return] + StatementList[?Yield, ?Await, ?Return] StatementListItem[?Yield, ?Await, ?Return] + +StatementListItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + Declaration[?Yield, ?Await] + +@line 14847 + +LexicalDeclaration[In, Yield, Await] : + LetOrConst BindingList[?In, ?Yield, ?Await] `;` + +LetOrConst : + `let` + `const` + +BindingList[In, Yield, Await] : + LexicalBinding[?In, ?Yield, ?Await] + BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await] + +LexicalBinding[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 14977 + +VariableStatement[Yield, Await] : + `var` VariableDeclarationList[+In, ?Yield, ?Await] `;` + +VariableDeclarationList[In, Yield, Await] : + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] `,` VariableDeclaration[?In, ?Yield, ?Await] + +VariableDeclaration[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 15082 + +BindingPattern[Yield, Await] : + ObjectBindingPattern[?Yield, ?Await] + ArrayBindingPattern[?Yield, ?Await] + +ObjectBindingPattern[Yield, Await] : + `{` `}` + `{` BindingPropertyList[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `,` `}` + +ArrayBindingPattern[Yield, Await] : + `[` Elision? BindingRestElement[?Yield, ?Await]? `]` + `[` BindingElementList[?Yield, ?Await] `]` + `[` BindingElementList[?Yield, ?Await] `,` Elision? BindingRestElement[?Yield, ?Await]? `]` + +BindingPropertyList[Yield, Await] : + BindingProperty[?Yield, ?Await] + BindingPropertyList[?Yield, ?Await] `,` BindingProperty[?Yield, ?Await] + +BindingElementList[Yield, Await] : + BindingElisionElement[?Yield, ?Await] + BindingElementList[?Yield, ?Await] `,` BindingElisionElement[?Yield, ?Await] + +BindingElisionElement[Yield, Await] : + Elision? BindingElement[?Yield, ?Await] + +BindingProperty[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` BindingElement[?Yield, ?Await] + +BindingElement[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + BindingPattern[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +SingleNameBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +BindingRestElement[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + `...` BindingPattern[?Yield, ?Await] + +@line 15527 + +EmptyStatement : + `;` + +@line 15546 + +ExpressionStatement[Yield, Await] : + [lookahead ` ConciseBody[?In] + +ArrowParameters[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +ConciseBody[In] : + [lookahead != `{` ] AssignmentExpression[?In, ~Yield, ~Await] + `{` FunctionBody[~Yield, ~Await] `}` + +@line 18307 + +ArrowFormalParameters[Yield, Await] : + `(` UniqueFormalParameters[?Yield, ?Await] `)` + +@line 18547 + +MethodDefinition[Yield, Await] : + PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + GeneratorMethod[?Yield, ?Await] + AsyncMethod[?Yield, ?Await] + `get` PropertyName[?Yield, ?Await] `(` `)` `{` FunctionBody[~Yield, ~Await] `}` + `set` PropertyName[?Yield, ?Await] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield, ~Await] `}` + +PropertySetParameterList : + FormalParameter[~Yield, ~Await] + +@line 18733 + +GeneratorMethod[Yield, Await] : + `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorDeclaration[Yield, Await, Default] : + `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorExpression : + `function` `*` BindingIdentifier[+Yield, ~Await]? `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorBody : + FunctionBody[+Yield, ~Await] + +YieldExpression[In, Await] : + `yield` + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await] + +@line 19075 + +ClassDeclaration[Yield, Await, Default] : + `class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] `class` ClassTail[?Yield, ?Await] + +ClassExpression[Yield, Await] : + `class` BindingIdentifier[?Yield, ?Await]? ClassTail[?Yield, ?Await] + +ClassTail[Yield, Await] : + ClassHeritage[?Yield, ?Await]? `{` ClassBody[?Yield, ?Await]? `}` + +ClassHeritage[Yield, Await] : + `extends` LeftHandSideExpression[?Yield, ?Await] + +ClassBody[Yield, Await] : + ClassElementList[?Yield, ?Await] + +ClassElementList[Yield, Await] : + ClassElement[?Yield, ?Await] + ClassElementList[?Yield, ?Await] ClassElement[?Yield, ?Await] + +ClassElement[Yield, Await] : + MethodDefinition[?Yield, ?Await] + `static` MethodDefinition[?Yield, ?Await] + `;` + +@line 19450 + +AsyncFunctionDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, ?Await] `)` `{` AsyncFunctionBody `}` + [+Default] `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, ?Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionExpression : + `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncMethod[Yield, Await] : + `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionBody : + FunctionBody[~Yield, +Await] + +AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] + +@line 19740 + +AsyncArrowFunction[In, Yield, Await] : + `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + +AsyncConciseBody[In] : + [lookahead != `{`] AssignmentExpression[?In, ~Yield, +Await] + `{` AsyncFunctionBody `}` + +AsyncArrowBindingIdentifier[Yield] : + BindingIdentifier[?Yield, +Await] + +CoverCallExpressionAndAsyncArrowHead[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 19758 + +AsyncArrowHead : + `async` [no LineTerminator here] ArrowFormalParameters[~Yield, +Await] + +@line 20318 + +Script : + ScriptBody? + +ScriptBody : + StatementList[~Yield, ~Await, ~Return] + +@line 20621 + +Module : + ModuleBody? + +ModuleBody : + ModuleItemList + +ModuleItemList : + ModuleItem + ModuleItemList ModuleItem + +ModuleItem : + ImportDeclaration + ExportDeclaration + StatementListItem[~Yield, ~Await, ~Return] + +@line 21865 + +ImportDeclaration : + `import` ImportClause FromClause `;` + `import` ModuleSpecifier `;` + +ImportClause : + ImportedDefaultBinding + NameSpaceImport + NamedImports + ImportedDefaultBinding `,` NameSpaceImport + ImportedDefaultBinding `,` NamedImports + +ImportedDefaultBinding : + ImportedBinding + +NameSpaceImport : + `*` `as` ImportedBinding + +NamedImports : + `{` `}` + `{` ImportsList `}` + `{` ImportsList `,` `}` + +FromClause : + `from` ModuleSpecifier + +ImportsList : + ImportSpecifier + ImportsList `,` ImportSpecifier + +ImportSpecifier : + ImportedBinding + IdentifierName `as` ImportedBinding + +ModuleSpecifier : + StringLiteral + +ImportedBinding : + BindingIdentifier[~Yield, ~Await] + +@line 22044 + +ExportDeclaration : + `export` `*` FromClause `;` + `export` ExportClause FromClause `;` + `export` ExportClause `;` + `export` VariableStatement[~Yield, ~Await] + `export` Declaration[~Yield, ~Await] + `export` `default` HoistableDeclaration[~Yield, ~Await, +Default] + `export` `default` ClassDeclaration[~Yield, ~Await, +Default] + `export` `default` [lookahead but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF] + +TrailSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF] + +NonSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] + +IdentityEscape[U] :: + [+U] SyntaxCharacter + [+U] `/` + [~U] SourceCharacter but not UnicodeIDContinue + +DecimalEscape :: + NonZeroDigit DecimalDigits? [lookahead \n | CallExpression", + "replacement": "| CallExpression\n | NewExpression" + }, + { + "_comment_": "MethodDefinition must come before IdentifierReference.", + "name": "PropertyDefinition", + "pattern": "| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName \":\" AssignmentExpression -- alt3\n | MethodDefinition -- alt4", + "replacement": "| MethodDefinition -- alt4\n | PropertyName \":\" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2" + }, + { + "_comment_": "Need this rather than `#sc` so that EmptyStatement is not nullable.", + "name": "EmptyStatement", + "override": "\";\" // note: this semicolon eats newlines" + }, + { + "_comment_": "ArrowFunction must come before ConditionalExpression, because the arrow function parameters will parse as a parenthesized expression. Both LeftHandSideExpression alternatives must also come before ConditionalExpression.", + "name": "AssignmentExpression", + "pattern": "| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | AsyncArrowFunction -- alt4\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6", + "replacement": "| AsyncArrowFunction -- alt4\n | ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2" + }, + { + "name": "FormalParameters", + "pattern": "| /* empty */ -- alt1\n | FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5", + "replacement": "| FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5\n | /* empty */ -- alt1" + }, + { + "_comment_": "The recursive MemberExpression application must come before PrimaryExpression.", + "name": "MemberExpression", + "pattern": "| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7", + "replacement": "| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6" + }, + { + "_comment_": "Move PostfixExpression to the very end.", + "name": "UnaryExpression", + "pattern": " | UpdateExpression -- alt1\n", + "postlude": "\n | UpdateExpression -- alt1", + "replacement": "" + }, + { + "_comment_": "The first alternative is a subset of the second one, so flip the order.", + "name": "ConditionalExpression", + "pattern": "| LogicalORExpression -- alt1\n | LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2", + "replacement": "| LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2\n | LogicalORExpression -- alt1" + }, + { + "_comment_": "First, put move the left recursive application above the ShiftExpression. (It's not properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` to be right before the `\"in\"` terminal.", + "name": "RelationalExpression", + "pattern": "| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7", + "replacement": "| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1" + }, + { + "_comment_": "FIXME: Make sure these produce something useful.", + "name": "identifierPart", + "pattern": "| \"\" /* FIXME */ -- alt4\n | \"\" /* FIXME */ -- alt5", + "replacement": "| \"_\" -- alt4 /* FIXME */" + }, + { + "_comment_": "Move decimalLiteral to the very end.", + "name": "numericLiteral", + "pattern": " | decimalLiteral\n", + "postlude": "\n | decimalLiteral", + "replacement": "" + }, + { + "_comment_": "alt1 is strictly a subset of the following two alternatives, so put it at the end.", + "name": "PostfixExpression", + "pattern": "| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3", + "replacement": "| LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3\n | LeftHandSideExpression -- alt1" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "ModuleItemList", + "pattern": "| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1", + "replacement": "| ModuleItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleLineCommentChars", + "pattern": "| singleLineCommentChar singleLineCommentChars? -- alt1", + "replacement": "| singleLineCommentChar+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "doubleStringCharacters", + "pattern": "| doubleStringCharacter doubleStringCharacters? -- alt1", + "replacement": "| doubleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleStringCharacters", + "pattern": "| singleStringCharacter singleStringCharacters? -- alt1", + "replacement": "| singleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "templateCharacters", + "pattern": "| templateCharacter templateCharacters? -- alt1", + "replacement": "| templateCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "multiLineCommentChars", + "pattern": "| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | \"*\" postAsteriskCommentChars? -- alt2", + "replacement": "(~\"*/\" sourceCharacter)*" + } + ] +} diff --git a/examples/ecmascript/spec/es2018/spec.grammar b/examples/ecmascript/spec/es2018/spec.grammar new file mode 100644 index 00000000..451a0cd2 --- /dev/null +++ b/examples/ecmascript/spec/es2018/spec.grammar @@ -0,0 +1,1544 @@ +@define noStrictParametricProductions true + +@line 9241 + +SourceCharacter :: + > any Unicode code point + +@line 9345 + +InputElementDiv :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + RightBracePunctuator + +InputElementRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + RightBracePunctuator + RegularExpressionLiteral + +InputElementRegExpOrTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + RegularExpressionLiteral + TemplateSubstitutionTail + +InputElementTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + TemplateSubstitutionTail + +@line 9553 + +WhiteSpace :: + + + + + + + + +@line 9634 + +LineTerminator :: + + + + + +LineTerminatorSequence :: + + [lookahead != ] + + + + +@line 9656 + +Comment :: + MultiLineComment + SingleLineComment + +MultiLineComment :: + `/*` MultiLineCommentChars? `*/` + +MultiLineCommentChars :: + MultiLineNotAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +PostAsteriskCommentChars :: + MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +MultiLineNotAsteriskChar :: + SourceCharacter but not `*` + +MultiLineNotForwardSlashOrAsteriskChar :: + SourceCharacter but not one of `/` or `*` + +SingleLineComment :: + `//` SingleLineCommentChars? + +SingleLineCommentChars :: + SingleLineCommentChar SingleLineCommentChars? + +SingleLineCommentChar :: + SourceCharacter but not LineTerminator + +@line 9692 + +CommonToken :: + IdentifierName + Punctuator + NumericLiteral + StringLiteral + Template + +@line 9714 + +IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + +IdentifierStart :: + UnicodeIDStart + `$` + `_` + `\` UnicodeEscapeSequence + +IdentifierPart :: + UnicodeIDContinue + `$` + `\` UnicodeEscapeSequence + + + +UnicodeIDStart :: + > any Unicode code point with the Unicode property “ID_Start” + +UnicodeIDContinue :: + > any Unicode code point with the Unicode property “ID_Continue” + +@line 9783 + +ReservedWord :: + Keyword + FutureReservedWord + NullLiteral + BooleanLiteral + +@line 9798 + +Keyword :: one of + `await` + `break` + `case` `catch` `class` `const` `continue` + `debugger` `default` `delete` `do` + `else` `export` `extends` + `finally` `for` `function` + `if` `import` `in` `instanceof` + `new` + `return` + `super` `switch` + `this` `throw` `try` `typeof` + `var` `void` + `while` `with` + `yield` + +@line 9824 + +FutureReservedWord :: + `enum` + +@line 9870 + +Punctuator :: one of + `{` `(` `)` `[` `]` + `.` `...` `;` `,` + `<` `>` `<=` `>=` + `==` `!=` `===` `!==` + `+` `-` `*` `%` `**` + `++` `--` + `<<` `>>` `>>>` + `&` `|` `^` + `!` `~` + `&&` `||` + `?` `:` + `=` `+=` `-=` `*=` `%=` `**=` `<<=` `>>=` `>>>=` `&=` `|=` `^=` + `=>` + +DivPunctuator :: + `/` + `/=` + +RightBracePunctuator :: + `}` + +@line 9901 + +NullLiteral :: + `null` + +@line 9910 + +BooleanLiteral :: + `true` + `false` + +@line 9920 + +NumericLiteral :: + DecimalLiteral + BinaryIntegerLiteral + OctalIntegerLiteral + HexIntegerLiteral + +DecimalLiteral :: + DecimalIntegerLiteral `.` DecimalDigits? ExponentPart? + `.` DecimalDigits ExponentPart? + DecimalIntegerLiteral ExponentPart? + +DecimalIntegerLiteral :: + `0` + NonZeroDigit DecimalDigits? + +DecimalDigits :: + DecimalDigit + DecimalDigits DecimalDigit + +DecimalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + +NonZeroDigit :: one of + `1` `2` `3` `4` `5` `6` `7` `8` `9` + +ExponentPart :: + ExponentIndicator SignedInteger + +ExponentIndicator :: one of + `e` `E` + +SignedInteger :: + DecimalDigits + `+` DecimalDigits + `-` DecimalDigits + +BinaryIntegerLiteral :: + `0b` BinaryDigits + `0B` BinaryDigits + +BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + +BinaryDigit :: one of + `0` `1` + +OctalIntegerLiteral :: + `0o` OctalDigits + `0O` OctalDigits + +OctalDigits :: + OctalDigit + OctalDigits OctalDigit + +OctalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` + +HexIntegerLiteral :: + `0x` HexDigits + `0X` HexDigits + +HexDigits :: + HexDigit + HexDigits HexDigit + +HexDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `a` `b` `c` `d` `e` `f` `A` `B` `C` `D` `E` `F` + +@line 10166 + +StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + +DoubleStringCharacters :: + DoubleStringCharacter DoubleStringCharacters? + +SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + +DoubleStringCharacter :: + SourceCharacter but not one of `"` or `\` or LineTerminator + `\` EscapeSequence + LineContinuation + +SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + `\` EscapeSequence + LineContinuation + +LineContinuation :: + `\` LineTerminatorSequence + +EscapeSequence :: + CharacterEscapeSequence + `0` [lookahead but only if MV of HexDigits > 0x10FFFF ] + +CodePoint :: + HexDigits [> but only if MV of HexDigits ≤ 0x10FFFF ] + +@line 10960 + +IdentifierReference[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +BindingIdentifier[Yield, Await] : + Identifier + `yield` + `await` + +LabelIdentifier[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +Identifier : + IdentifierName but not ReservedWord + +@line 11194 + +PrimaryExpression[Yield, Await] : + `this` + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `)` + `(` `)` + `(` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` `...` BindingPattern[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingPattern[?Yield, ?Await] `)` + +@line 11225 + +ParenthesizedExpression[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + +@line 11350 + +Literal : + NullLiteral + BooleanLiteral + NumericLiteral + StringLiteral + +@line 11387 + +ArrayLiteral[Yield, Await] : + `[` Elision? `]` + `[` ElementList[?Yield, ?Await] `]` + `[` ElementList[?Yield, ?Await] `,` Elision? `]` + +ElementList[Yield, Await] : + Elision? AssignmentExpression[+In, ?Yield, ?Await] + Elision? SpreadElement[?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? AssignmentExpression[+In, ?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? SpreadElement[?Yield, ?Await] + +Elision : + `,` + Elision `,` + +SpreadElement[Yield, Await] : + `...` AssignmentExpression[+In, ?Yield, ?Await] + +@line 11511 + +ObjectLiteral[Yield, Await] : + `{` `}` + `{` PropertyDefinitionList[?Yield, ?Await] `}` + `{` PropertyDefinitionList[?Yield, ?Await] `,` `}` + +PropertyDefinitionList[Yield, Await] : + PropertyDefinition[?Yield, ?Await] + PropertyDefinitionList[?Yield, ?Await] `,` PropertyDefinition[?Yield, ?Await] + +PropertyDefinition[Yield, Await] : + IdentifierReference[?Yield, ?Await] + CoverInitializedName[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` AssignmentExpression[+In, ?Yield, ?Await] + MethodDefinition[?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + +PropertyName[Yield, Await] : + LiteralPropertyName + ComputedPropertyName[?Yield, ?Await] + +LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + +ComputedPropertyName[Yield, Await] : + `[` AssignmentExpression[+In, ?Yield, ?Await] `]` + +CoverInitializedName[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await] + +Initializer[In, Yield, Await] : + `=` AssignmentExpression[?In, ?Yield, ?Await] + +@line 11789 + +TemplateLiteral[Yield, Await, Tagged] : + NoSubstitutionTemplate + SubstitutionTemplate[?Yield, ?Await, ?Tagged] + +SubstitutionTemplate[Yield, Await, Tagged] : + TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await, ?Tagged] + +TemplateSpans[Yield, Await, Tagged] : + TemplateTail + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateTail + +TemplateMiddleList[Yield, Await, Tagged] : + TemplateMiddle Expression[+In, ?Yield, ?Await] + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await] + +@line 12109 + +MemberExpression[Yield, Await] : + PrimaryExpression[?Yield, ?Await] + MemberExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + MemberExpression[?Yield, ?Await] `.` IdentifierName + MemberExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + SuperProperty[?Yield, ?Await] + MetaProperty + `new` MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +SuperProperty[Yield, Await] : + `super` `[` Expression[+In, ?Yield, ?Await] `]` + `super` `.` IdentifierName + +MetaProperty : + NewTarget + +NewTarget : + `new` `.` `target` + +NewExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] + `new` NewExpression[?Yield, ?Await] + +CallExpression[Yield, Await] : + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] #callcover + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + CallExpression[?Yield, ?Await] `.` IdentifierName + CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + +SuperCall[Yield, Await] : + `super` Arguments[?Yield, ?Await] + +Arguments[Yield, Await] : + `(` `)` + `(` ArgumentList[?Yield, ?Await] `)` + `(` ArgumentList[?Yield, ?Await] `,` `)` + +ArgumentList[Yield, Await] : + AssignmentExpression[+In, ?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` `...` AssignmentExpression[+In, ?Yield, ?Await] + +LeftHandSideExpression[Yield, Await] : + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + +@line 12161 + +CallMemberExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 12634 + +UpdateExpression[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++` + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--` + `++` UnaryExpression[?Yield, ?Await] + `--` UnaryExpression[?Yield, ?Await] + +@line 12766 + +UnaryExpression[Yield, Await] : + UpdateExpression[?Yield, ?Await] + `delete` UnaryExpression[?Yield, ?Await] + `void` UnaryExpression[?Yield, ?Await] + `typeof` UnaryExpression[?Yield, ?Await] + `+` UnaryExpression[?Yield, ?Await] + `-` UnaryExpression[?Yield, ?Await] + `~` UnaryExpression[?Yield, ?Await] + `!` UnaryExpression[?Yield, ?Await] + [+Await] AwaitExpression[?Yield] + +@line 13065 + +ExponentiationExpression[Yield, Await] : + UnaryExpression[?Yield, ?Await] + UpdateExpression[?Yield, ?Await] `**` ExponentiationExpression[?Yield, ?Await] + +@line 13150 + +MultiplicativeExpression[Yield, Await] : + ExponentiationExpression[?Yield, ?Await] + MultiplicativeExpression[?Yield, ?Await] MultiplicativeOperator ExponentiationExpression[?Yield, ?Await] + +MultiplicativeOperator : one of + `*` `/` `%` + +@line 13285 + +AdditiveExpression[Yield, Await] : + MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `+` MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `-` MultiplicativeExpression[?Yield, ?Await] + +@line 13409 + +ShiftExpression[Yield, Await] : + AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `<<` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>>` AdditiveExpression[?Yield, ?Await] + +@line 13518 + +RelationalExpression[In, Yield, Await] : + ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `instanceof` ShiftExpression[?Yield, ?Await] + [+In] RelationalExpression[+In, ?Yield, ?Await] `in` ShiftExpression[?Yield, ?Await] + +@line 13650 + +EqualityExpression[In, Yield, Await] : + RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `==` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!=` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `===` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!==` RelationalExpression[?In, ?Yield, ?Await] + +@line 13770 + +BitwiseANDExpression[In, Yield, Await] : + EqualityExpression[?In, ?Yield, ?Await] + BitwiseANDExpression[?In, ?Yield, ?Await] `&` EqualityExpression[?In, ?Yield, ?Await] + +BitwiseXORExpression[In, Yield, Await] : + BitwiseANDExpression[?In, ?Yield, ?Await] + BitwiseXORExpression[?In, ?Yield, ?Await] `^` BitwiseANDExpression[?In, ?Yield, ?Await] + +BitwiseORExpression[In, Yield, Await] : + BitwiseXORExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] `|` BitwiseXORExpression[?In, ?Yield, ?Await] + +@line 13832 + +LogicalANDExpression[In, Yield, Await] : + BitwiseORExpression[?In, ?Yield, ?Await] + LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await] + +LogicalORExpression[In, Yield, Await] : + LogicalANDExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await] + +@line 13897 + +ConditionalExpression[In, Yield, Await] : + LogicalORExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await] + +@line 13943 + +AssignmentExpression[In, Yield, Await] : + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield] YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + +AssignmentOperator : one of + `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + +@line 14053 + +AssignmentPattern[Yield, Await] : + ObjectAssignmentPattern[?Yield, ?Await] + ArrayAssignmentPattern[?Yield, ?Await] + +ObjectAssignmentPattern[Yield, Await] : + `{` `}` + `{` AssignmentRestProperty[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `,` AssignmentRestProperty[?Yield, ?Await]? `}` + +ArrayAssignmentPattern[Yield, Await] : + `[` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + `[` AssignmentElementList[?Yield, ?Await] `]` + `[` AssignmentElementList[?Yield, ?Await] `,` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + +AssignmentRestProperty[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +AssignmentPropertyList[Yield, Await] : + AssignmentProperty[?Yield, ?Await] + AssignmentPropertyList[?Yield, ?Await] `,` AssignmentProperty[?Yield, ?Await] + +AssignmentElementList[Yield, Await] : + AssignmentElisionElement[?Yield, ?Await] + AssignmentElementList[?Yield, ?Await] `,` AssignmentElisionElement[?Yield, ?Await] + +AssignmentElisionElement[Yield, Await] : + Elision? AssignmentElement[?Yield, ?Await] + +AssignmentProperty[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + PropertyName[?Yield, ?Await] `:` AssignmentElement[?Yield, ?Await] + +AssignmentElement[Yield, Await] : + DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +AssignmentRestElement[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +DestructuringAssignmentTarget[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + +@line 14378 + +Expression[In, Yield, Await] : + AssignmentExpression[?In, ?Yield, ?Await] + Expression[?In, ?Yield, ?Await] `,` AssignmentExpression[?In, ?Yield, ?Await] + +@line 14421 + +Statement[Yield, Await, Return] : + BlockStatement[?Yield, ?Await, ?Return] + VariableStatement[?Yield, ?Await] + EmptyStatement + ExpressionStatement[?Yield, ?Await] + IfStatement[?Yield, ?Await, ?Return] + BreakableStatement[?Yield, ?Await, ?Return] + ContinueStatement[?Yield, ?Await] + BreakStatement[?Yield, ?Await] + [+Return] ReturnStatement[?Yield, ?Await] + WithStatement[?Yield, ?Await, ?Return] + LabelledStatement[?Yield, ?Await, ?Return] + ThrowStatement[?Yield, ?Await] + TryStatement[?Yield, ?Await, ?Return] + DebuggerStatement + +Declaration[Yield, Await] : + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + +HoistableDeclaration[Yield, Await, Default] : + FunctionDeclaration[?Yield, ?Await, ?Default] + GeneratorDeclaration[?Yield, ?Await, ?Default] + AsyncFunctionDeclaration[?Yield, ?Await, ?Default] + AsyncGeneratorDeclaration[?Yield, ?Await, ?Default] + +BreakableStatement[Yield, Await, Return] : + IterationStatement[?Yield, ?Await, ?Return] + SwitchStatement[?Yield, ?Await, ?Return] + +@line 14643 + +BlockStatement[Yield, Await, Return] : + Block[?Yield, ?Await, ?Return] + +Block[Yield, Await, Return] : + `{` StatementList[?Yield, ?Await, ?Return]? `}` + +StatementList[Yield, Await, Return] : + StatementListItem[?Yield, ?Await, ?Return] + StatementList[?Yield, ?Await, ?Return] StatementListItem[?Yield, ?Await, ?Return] + +StatementListItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + Declaration[?Yield, ?Await] + +@line 14993 + +LexicalDeclaration[In, Yield, Await] : + LetOrConst BindingList[?In, ?Yield, ?Await] `;` + +LetOrConst : + `let` + `const` + +BindingList[In, Yield, Await] : + LexicalBinding[?In, ?Yield, ?Await] + BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await] + +LexicalBinding[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 15118 + +VariableStatement[Yield, Await] : + `var` VariableDeclarationList[+In, ?Yield, ?Await] `;` + +VariableDeclarationList[In, Yield, Await] : + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] `,` VariableDeclaration[?In, ?Yield, ?Await] + +VariableDeclaration[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 15218 + +BindingPattern[Yield, Await] : + ObjectBindingPattern[?Yield, ?Await] + ArrayBindingPattern[?Yield, ?Await] + +ObjectBindingPattern[Yield, Await] : + `{` `}` + `{` BindingRestProperty[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `,` BindingRestProperty[?Yield, ?Await]? `}` + +ArrayBindingPattern[Yield, Await] : + `[` Elision? BindingRestElement[?Yield, ?Await]? `]` + `[` BindingElementList[?Yield, ?Await] `]` + `[` BindingElementList[?Yield, ?Await] `,` Elision? BindingRestElement[?Yield, ?Await]? `]` + +BindingRestProperty[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + +BindingPropertyList[Yield, Await] : + BindingProperty[?Yield, ?Await] + BindingPropertyList[?Yield, ?Await] `,` BindingProperty[?Yield, ?Await] + +BindingElementList[Yield, Await] : + BindingElisionElement[?Yield, ?Await] + BindingElementList[?Yield, ?Await] `,` BindingElisionElement[?Yield, ?Await] + +BindingElisionElement[Yield, Await] : + Elision? BindingElement[?Yield, ?Await] + +BindingProperty[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` BindingElement[?Yield, ?Await] + +BindingElement[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + BindingPattern[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +SingleNameBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +BindingRestElement[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + `...` BindingPattern[?Yield, ?Await] + +@line 15700 + +EmptyStatement : + `;` + +@line 15717 + +ExpressionStatement[Yield, Await] : + [lookahead ` ConciseBody[?In] + +ArrowParameters[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +ConciseBody[In] : + [lookahead != `{` ] AssignmentExpression[?In, ~Yield, ~Await] + `{` FunctionBody[~Yield, ~Await] `}` + +@line 18412 + +ArrowFormalParameters[Yield, Await] : + `(` UniqueFormalParameters[?Yield, ?Await] `)` + +@line 18636 + +MethodDefinition[Yield, Await] : + PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + GeneratorMethod[?Yield, ?Await] + AsyncMethod[?Yield, ?Await] + AsyncGeneratorMethod[?Yield, ?Await] + `get` PropertyName[?Yield, ?Await] `(` `)` `{` FunctionBody[~Yield, ~Await] `}` + `set` PropertyName[?Yield, ?Await] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield, ~Await] `}` + +PropertySetParameterList : + FormalParameter[~Yield, ~Await] + +@line 18815 + +GeneratorMethod[Yield, Await] : + `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorDeclaration[Yield, Await, Default] : + `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorExpression : + `function` `*` BindingIdentifier[+Yield, ~Await]? `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorBody : + FunctionBody[+Yield, ~Await] + +YieldExpression[In, Await] : + `yield` + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await] + +@line 19160 + +AsyncGeneratorMethod[Yield, Await] : + `async` [no LineTerminator here] `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + [+Default] `async` [no LineTerminator here] `function` `*` `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorExpression : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[+Yield, +Await]? `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorBody : + FunctionBody[+Yield, +Await] + +@line 19419 + +ClassDeclaration[Yield, Await, Default] : + `class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] `class` ClassTail[?Yield, ?Await] + +ClassExpression[Yield, Await] : + `class` BindingIdentifier[?Yield, ?Await]? ClassTail[?Yield, ?Await] + +ClassTail[Yield, Await] : + ClassHeritage[?Yield, ?Await]? `{` ClassBody[?Yield, ?Await]? `}` + +ClassHeritage[Yield, Await] : + `extends` LeftHandSideExpression[?Yield, ?Await] + +ClassBody[Yield, Await] : + ClassElementList[?Yield, ?Await] + +ClassElementList[Yield, Await] : + ClassElement[?Yield, ?Await] + ClassElementList[?Yield, ?Await] ClassElement[?Yield, ?Await] + +ClassElement[Yield, Await] : + MethodDefinition[?Yield, ?Await] + `static` MethodDefinition[?Yield, ?Await] + `;` + +@line 19778 + +AsyncFunctionDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + [+Default] `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionExpression : + `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncMethod[Yield, Await] : + `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionBody : + FunctionBody[~Yield, +Await] + +AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] + +@line 20068 + +AsyncArrowFunction[In, Yield, Await] : + `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + +AsyncConciseBody[In] : + [lookahead != `{`] AssignmentExpression[?In, ~Yield, +Await] + `{` AsyncFunctionBody `}` + +AsyncArrowBindingIdentifier[Yield] : + BindingIdentifier[?Yield, +Await] + +CoverCallExpressionAndAsyncArrowHead[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 20086 + +AsyncArrowHead : + `async` [no LineTerminator here] ArrowFormalParameters[~Yield, +Await] + +@line 20640 + +Script : + ScriptBody? + +ScriptBody : + StatementList[~Yield, ~Await, ~Return] + +@line 20933 + +Module : + ModuleBody? + +ModuleBody : + ModuleItemList + +ModuleItemList : + ModuleItem + ModuleItemList ModuleItem + +ModuleItem : + ImportDeclaration + ExportDeclaration + StatementListItem[~Yield, ~Await, ~Return] + +@line 22380 + +ImportDeclaration : + `import` ImportClause FromClause `;` + `import` ModuleSpecifier `;` + +ImportClause : + ImportedDefaultBinding + NameSpaceImport + NamedImports + ImportedDefaultBinding `,` NameSpaceImport + ImportedDefaultBinding `,` NamedImports + +ImportedDefaultBinding : + ImportedBinding + +NameSpaceImport : + `*` `as` ImportedBinding + +NamedImports : + `{` `}` + `{` ImportsList `}` + `{` ImportsList `,` `}` + +FromClause : + `from` ModuleSpecifier + +ImportsList : + ImportSpecifier + ImportsList `,` ImportSpecifier + +ImportSpecifier : + ImportedBinding + IdentifierName `as` ImportedBinding + +ModuleSpecifier : + StringLiteral + +ImportedBinding : + BindingIdentifier[~Yield, ~Await] + +@line 22553 + +ExportDeclaration : + `export` `*` FromClause `;` + `export` ExportClause FromClause `;` + `export` ExportClause `;` + `export` VariableStatement[~Yield, ~Await] + `export` Declaration[~Yield, ~Await] + `export` `default` HoistableDeclaration[~Yield, ~Await, +Default] + `export` `default` ClassDeclaration[~Yield, ~Await, +Default] + `export` `default` [lookahead ` + +RegExpIdentifierName[U] :: + RegExpIdentifierStart[?U] + RegExpIdentifierName[?U] RegExpIdentifierPart[?U] + +RegExpIdentifierStart[U] :: + UnicodeIDStart + `$` + `_` + `\` RegExpUnicodeEscapeSequence[?U] + +RegExpIdentifierPart[U] :: + UnicodeIDContinue + `$` + `\` RegExpUnicodeEscapeSequence[?U] + + + +RegExpUnicodeEscapeSequence[U] :: + [+U] `u` LeadSurrogate `\u` TrailSurrogate + [+U] `u` LeadSurrogate + [+U] `u` TrailSurrogate + [+U] `u` NonSurrogate + [~U] `u` Hex4Digits + [+U] `u{` CodePoint `}` + +@line 28875 + +LeadSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF] + +TrailSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF] + +NonSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] + +IdentityEscape[U] :: + [+U] SyntaxCharacter + [+U] `/` + [~U] SourceCharacter but not UnicodeIDContinue + +DecimalEscape :: + NonZeroDigit DecimalDigits? [lookahead \n | CallExpression", + "replacement": "| CallExpression\n | NewExpression" + }, + { + "_comment_": "MethodDefinition must come before IdentifierReference.", + "name": "PropertyDefinition", + "pattern": "| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName \":\" AssignmentExpression -- alt3\n | MethodDefinition -- alt4", + "replacement": "| MethodDefinition -- alt4\n | PropertyName \":\" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2" + }, + { + "_comment_": "Need this rather than `#sc` so that EmptyStatement is not nullable.", + "name": "EmptyStatement", + "override": "\";\" // note: this semicolon eats newlines" + }, + { + "_comment_": "ArrowFunction must come before ConditionalExpression, because the arrow function parameters will parse as a parenthesized expression. Both LeftHandSideExpression alternatives must also come before ConditionalExpression.", + "name": "AssignmentExpression", + "pattern": "| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | AsyncArrowFunction -- alt4\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6", + "replacement": "| AsyncArrowFunction -- alt4\n | ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2" + }, + { + "name": "FormalParameters", + "pattern": "| /* empty */ -- alt1\n | FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5", + "replacement": "| FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5\n | /* empty */ -- alt1" + }, + { + "_comment_": "The recursive MemberExpression application must come before PrimaryExpression.", + "name": "MemberExpression", + "pattern": "| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7", + "replacement": "| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6" + }, + { + "_comment_": "Move PostfixExpression to the very end.", + "name": "UnaryExpression", + "pattern": " | UpdateExpression -- alt1\n", + "postlude": "\n | UpdateExpression -- alt1", + "replacement": "" + }, + { + "_comment_": "The first alternative is a subset of the second one, so flip the order.", + "name": "ConditionalExpression", + "pattern": "| LogicalORExpression -- alt1\n | LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2", + "replacement": "| LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2\n | LogicalORExpression -- alt1" + }, + { + "_comment_": "First, put move the left recursive application above the ShiftExpression. (It's not properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` to be right before the `\"in\"` terminal.", + "name": "RelationalExpression", + "pattern": "| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7", + "replacement": "| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1" + }, + { + "_comment_": "FIXME: Make sure these produce something useful.", + "name": "identifierPart", + "pattern": "| \"\" /* FIXME */ -- alt4\n | \"\" /* FIXME */ -- alt5", + "replacement": "| \"_\" -- alt4 /* FIXME */" + }, + { + "_comment_": "Move decimalLiteral to the very end.", + "name": "numericLiteral", + "pattern": " | decimalLiteral\n", + "postlude": "\n | decimalLiteral", + "replacement": "" + }, + { + "_comment_": "alt1 is strictly a subset of the following two alternatives, so put it at the end.", + "name": "PostfixExpression", + "pattern": "| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3", + "replacement": "| LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3\n | LeftHandSideExpression -- alt1" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "ModuleItemList", + "pattern": "| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1", + "replacement": "| ModuleItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleLineCommentChars", + "pattern": "| singleLineCommentChar singleLineCommentChars? -- alt1", + "replacement": "| singleLineCommentChar+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "doubleStringCharacters", + "pattern": "| doubleStringCharacter doubleStringCharacters? -- alt1", + "replacement": "| doubleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleStringCharacters", + "pattern": "| singleStringCharacter singleStringCharacters? -- alt1", + "replacement": "| singleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "templateCharacters", + "pattern": "| templateCharacter templateCharacters? -- alt1", + "replacement": "| templateCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "multiLineCommentChars", + "pattern": "| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | \"*\" postAsteriskCommentChars? -- alt2", + "replacement": "(~\"*/\" sourceCharacter)*" + } + ] +} diff --git a/examples/ecmascript/spec/es2019/spec.grammar b/examples/ecmascript/spec/es2019/spec.grammar new file mode 100644 index 00000000..335ba196 --- /dev/null +++ b/examples/ecmascript/spec/es2019/spec.grammar @@ -0,0 +1,1552 @@ +@line 9289 + +SourceCharacter :: + > any Unicode code point + +@line 9393 + +InputElementDiv :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + RightBracePunctuator + +InputElementRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + RightBracePunctuator + RegularExpressionLiteral + +InputElementRegExpOrTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + RegularExpressionLiteral + TemplateSubstitutionTail + +InputElementTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + TemplateSubstitutionTail + +@line 9601 + +WhiteSpace :: + + + + + + + + +@line 9682 + +LineTerminator :: + + + + + +LineTerminatorSequence :: + + [lookahead != ] + + + + +@line 9704 + +Comment :: + MultiLineComment + SingleLineComment + +MultiLineComment :: + `/*` MultiLineCommentChars? `*/` + +MultiLineCommentChars :: + MultiLineNotAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +PostAsteriskCommentChars :: + MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +MultiLineNotAsteriskChar :: + SourceCharacter but not `*` + +MultiLineNotForwardSlashOrAsteriskChar :: + SourceCharacter but not one of `/` or `*` + +SingleLineComment :: + `//` SingleLineCommentChars? + +SingleLineCommentChars :: + SingleLineCommentChar SingleLineCommentChars? + +SingleLineCommentChar :: + SourceCharacter but not LineTerminator + +@line 9740 + +CommonToken :: + IdentifierName + Punctuator + NumericLiteral + StringLiteral + Template + +@line 9762 + +IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + +IdentifierStart :: + UnicodeIDStart + `$` + `_` + `\` UnicodeEscapeSequence + +IdentifierPart :: + UnicodeIDContinue + `$` + `\` UnicodeEscapeSequence + + + +UnicodeIDStart :: + > any Unicode code point with the Unicode property “ID_Start” + +UnicodeIDContinue :: + > any Unicode code point with the Unicode property “ID_Continue” + +@line 9831 + +ReservedWord :: + Keyword + FutureReservedWord + NullLiteral + BooleanLiteral + +@line 9846 + +Keyword :: one of + `await` + `break` + `case` `catch` `class` `const` `continue` + `debugger` `default` `delete` `do` + `else` `export` `extends` + `finally` `for` `function` + `if` `import` `in` `instanceof` + `new` + `return` + `super` `switch` + `this` `throw` `try` `typeof` + `var` `void` + `while` `with` + `yield` + +@line 9872 + +FutureReservedWord :: + `enum` + +@line 9918 + +Punctuator :: one of + `{` `(` `)` `[` `]` + `.` `...` `;` `,` + `<` `>` `<=` `>=` + `==` `!=` `===` `!==` + `+` `-` `*` `%` `**` + `++` `--` + `<<` `>>` `>>>` + `&` `|` `^` + `!` `~` + `&&` `||` + `?` `:` + `=` `+=` `-=` `*=` `%=` `**=` `<<=` `>>=` `>>>=` `&=` `|=` `^=` + `=>` + +DivPunctuator :: + `/` + `/=` + +RightBracePunctuator :: + `}` + +@line 9949 + +NullLiteral :: + `null` + +@line 9958 + +BooleanLiteral :: + `true` + `false` + +@line 9968 + +NumericLiteral :: + DecimalLiteral + BinaryIntegerLiteral + OctalIntegerLiteral + HexIntegerLiteral + +DecimalLiteral :: + DecimalIntegerLiteral `.` DecimalDigits? ExponentPart? + `.` DecimalDigits ExponentPart? + DecimalIntegerLiteral ExponentPart? + +DecimalIntegerLiteral :: + `0` + NonZeroDigit DecimalDigits? + +DecimalDigits :: + DecimalDigit + DecimalDigits DecimalDigit + +DecimalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + +NonZeroDigit :: one of + `1` `2` `3` `4` `5` `6` `7` `8` `9` + +ExponentPart :: + ExponentIndicator SignedInteger + +ExponentIndicator :: one of + `e` `E` + +SignedInteger :: + DecimalDigits + `+` DecimalDigits + `-` DecimalDigits + +BinaryIntegerLiteral :: + `0b` BinaryDigits + `0B` BinaryDigits + +BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + +BinaryDigit :: one of + `0` `1` + +OctalIntegerLiteral :: + `0o` OctalDigits + `0O` OctalDigits + +OctalDigits :: + OctalDigit + OctalDigits OctalDigit + +OctalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` + +HexIntegerLiteral :: + `0x` HexDigits + `0X` HexDigits + +HexDigits :: + HexDigit + HexDigits HexDigit + +HexDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `a` `b` `c` `d` `e` `f` `A` `B` `C` `D` `E` `F` + +@line 10214 + +StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + +DoubleStringCharacters :: + DoubleStringCharacter DoubleStringCharacters? + +SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + +DoubleStringCharacter :: + SourceCharacter but not one of `"` or `\` or LineTerminator + + + `\` EscapeSequence + LineContinuation + +SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + + + `\` EscapeSequence + LineContinuation + +LineContinuation :: + `\` LineTerminatorSequence + +EscapeSequence :: + CharacterEscapeSequence + `0` [lookahead but only if MV of |HexDigits| > 0x10FFFF ] + +CodePoint :: + HexDigits [> but only if MV of |HexDigits| ≤ 0x10FFFF ] + +@line 11024 + +IdentifierReference[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +BindingIdentifier[Yield, Await] : + Identifier + `yield` + `await` + +LabelIdentifier[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +Identifier : + IdentifierName but not ReservedWord + +@line 11258 + +PrimaryExpression[Yield, Await] : + `this` + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `)` + `(` `)` + `(` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` `...` BindingPattern[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingPattern[?Yield, ?Await] `)` + +@line 11289 + +ParenthesizedExpression[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + +@line 11414 + +Literal : + NullLiteral + BooleanLiteral + NumericLiteral + StringLiteral + +@line 11451 + +ArrayLiteral[Yield, Await] : + `[` Elision? `]` + `[` ElementList[?Yield, ?Await] `]` + `[` ElementList[?Yield, ?Await] `,` Elision? `]` + +ElementList[Yield, Await] : + Elision? AssignmentExpression[+In, ?Yield, ?Await] + Elision? SpreadElement[?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? AssignmentExpression[+In, ?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? SpreadElement[?Yield, ?Await] + +Elision : + `,` + Elision `,` + +SpreadElement[Yield, Await] : + `...` AssignmentExpression[+In, ?Yield, ?Await] + +@line 11575 + +ObjectLiteral[Yield, Await] : + `{` `}` + `{` PropertyDefinitionList[?Yield, ?Await] `}` + `{` PropertyDefinitionList[?Yield, ?Await] `,` `}` + +PropertyDefinitionList[Yield, Await] : + PropertyDefinition[?Yield, ?Await] + PropertyDefinitionList[?Yield, ?Await] `,` PropertyDefinition[?Yield, ?Await] + +PropertyDefinition[Yield, Await] : + IdentifierReference[?Yield, ?Await] + CoverInitializedName[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` AssignmentExpression[+In, ?Yield, ?Await] + MethodDefinition[?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + +PropertyName[Yield, Await] : + LiteralPropertyName + ComputedPropertyName[?Yield, ?Await] + +LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + +ComputedPropertyName[Yield, Await] : + `[` AssignmentExpression[+In, ?Yield, ?Await] `]` + +CoverInitializedName[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await] + +Initializer[In, Yield, Await] : + `=` AssignmentExpression[?In, ?Yield, ?Await] + +@line 11855 + +TemplateLiteral[Yield, Await, Tagged] : + NoSubstitutionTemplate + SubstitutionTemplate[?Yield, ?Await, ?Tagged] + +SubstitutionTemplate[Yield, Await, Tagged] : + TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await, ?Tagged] + +TemplateSpans[Yield, Await, Tagged] : + TemplateTail + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateTail + +TemplateMiddleList[Yield, Await, Tagged] : + TemplateMiddle Expression[+In, ?Yield, ?Await] + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await] + +@line 12190 + +MemberExpression[Yield, Await] : + PrimaryExpression[?Yield, ?Await] + MemberExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + MemberExpression[?Yield, ?Await] `.` IdentifierName + MemberExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + SuperProperty[?Yield, ?Await] + MetaProperty + `new` MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +SuperProperty[Yield, Await] : + `super` `[` Expression[+In, ?Yield, ?Await] `]` + `super` `.` IdentifierName + +MetaProperty : + NewTarget + +NewTarget : + `new` `.` `target` + +NewExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] + `new` NewExpression[?Yield, ?Await] + +CallExpression[Yield, Await] : + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] #callcover + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + CallExpression[?Yield, ?Await] `.` IdentifierName + CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + +SuperCall[Yield, Await] : + `super` Arguments[?Yield, ?Await] + +Arguments[Yield, Await] : + `(` `)` + `(` ArgumentList[?Yield, ?Await] `)` + `(` ArgumentList[?Yield, ?Await] `,` `)` + +ArgumentList[Yield, Await] : + AssignmentExpression[+In, ?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` `...` AssignmentExpression[+In, ?Yield, ?Await] + +LeftHandSideExpression[Yield, Await] : + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + +@line 12242 + +CallMemberExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 12718 + +UpdateExpression[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++` + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--` + `++` UnaryExpression[?Yield, ?Await] + `--` UnaryExpression[?Yield, ?Await] + +@line 12856 + +UnaryExpression[Yield, Await] : + UpdateExpression[?Yield, ?Await] + `delete` UnaryExpression[?Yield, ?Await] + `void` UnaryExpression[?Yield, ?Await] + `typeof` UnaryExpression[?Yield, ?Await] + `+` UnaryExpression[?Yield, ?Await] + `-` UnaryExpression[?Yield, ?Await] + `~` UnaryExpression[?Yield, ?Await] + `!` UnaryExpression[?Yield, ?Await] + [+Await] AwaitExpression[?Yield] + +@line 13155 + +ExponentiationExpression[Yield, Await] : + UnaryExpression[?Yield, ?Await] + UpdateExpression[?Yield, ?Await] `**` ExponentiationExpression[?Yield, ?Await] + +@line 13240 + +MultiplicativeExpression[Yield, Await] : + ExponentiationExpression[?Yield, ?Await] + MultiplicativeExpression[?Yield, ?Await] MultiplicativeOperator ExponentiationExpression[?Yield, ?Await] + +MultiplicativeOperator : one of + `*` `/` `%` + +@line 13375 + +AdditiveExpression[Yield, Await] : + MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `+` MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `-` MultiplicativeExpression[?Yield, ?Await] + +@line 13499 + +ShiftExpression[Yield, Await] : + AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `<<` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>>` AdditiveExpression[?Yield, ?Await] + +@line 13608 + +RelationalExpression[In, Yield, Await] : + ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `instanceof` ShiftExpression[?Yield, ?Await] + [+In] RelationalExpression[+In, ?Yield, ?Await] `in` ShiftExpression[?Yield, ?Await] + +@line 13740 + +EqualityExpression[In, Yield, Await] : + RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `==` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!=` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `===` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!==` RelationalExpression[?In, ?Yield, ?Await] + +@line 13860 + +BitwiseANDExpression[In, Yield, Await] : + EqualityExpression[?In, ?Yield, ?Await] + BitwiseANDExpression[?In, ?Yield, ?Await] `&` EqualityExpression[?In, ?Yield, ?Await] + +BitwiseXORExpression[In, Yield, Await] : + BitwiseANDExpression[?In, ?Yield, ?Await] + BitwiseXORExpression[?In, ?Yield, ?Await] `^` BitwiseANDExpression[?In, ?Yield, ?Await] + +BitwiseORExpression[In, Yield, Await] : + BitwiseXORExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] `|` BitwiseXORExpression[?In, ?Yield, ?Await] + +@line 13922 + +LogicalANDExpression[In, Yield, Await] : + BitwiseORExpression[?In, ?Yield, ?Await] + LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await] + +LogicalORExpression[In, Yield, Await] : + LogicalANDExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await] + +@line 13987 + +ConditionalExpression[In, Yield, Await] : + LogicalORExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await] + +@line 14033 + +AssignmentExpression[In, Yield, Await] : + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield] YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + +AssignmentOperator : one of + `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + +@line 14149 + +AssignmentPattern[Yield, Await] : + ObjectAssignmentPattern[?Yield, ?Await] + ArrayAssignmentPattern[?Yield, ?Await] + +ObjectAssignmentPattern[Yield, Await] : + `{` `}` + `{` AssignmentRestProperty[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `,` AssignmentRestProperty[?Yield, ?Await]? `}` + +ArrayAssignmentPattern[Yield, Await] : + `[` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + `[` AssignmentElementList[?Yield, ?Await] `]` + `[` AssignmentElementList[?Yield, ?Await] `,` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + +AssignmentRestProperty[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +AssignmentPropertyList[Yield, Await] : + AssignmentProperty[?Yield, ?Await] + AssignmentPropertyList[?Yield, ?Await] `,` AssignmentProperty[?Yield, ?Await] + +AssignmentElementList[Yield, Await] : + AssignmentElisionElement[?Yield, ?Await] + AssignmentElementList[?Yield, ?Await] `,` AssignmentElisionElement[?Yield, ?Await] + +AssignmentElisionElement[Yield, Await] : + Elision? AssignmentElement[?Yield, ?Await] + +AssignmentProperty[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + PropertyName[?Yield, ?Await] `:` AssignmentElement[?Yield, ?Await] + +AssignmentElement[Yield, Await] : + DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +AssignmentRestElement[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +DestructuringAssignmentTarget[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + +@line 14476 + +Expression[In, Yield, Await] : + AssignmentExpression[?In, ?Yield, ?Await] + Expression[?In, ?Yield, ?Await] `,` AssignmentExpression[?In, ?Yield, ?Await] + +@line 14519 + +Statement[Yield, Await, Return] : + BlockStatement[?Yield, ?Await, ?Return] + VariableStatement[?Yield, ?Await] + EmptyStatement + ExpressionStatement[?Yield, ?Await] + IfStatement[?Yield, ?Await, ?Return] + BreakableStatement[?Yield, ?Await, ?Return] + ContinueStatement[?Yield, ?Await] + BreakStatement[?Yield, ?Await] + [+Return] ReturnStatement[?Yield, ?Await] + WithStatement[?Yield, ?Await, ?Return] + LabelledStatement[?Yield, ?Await, ?Return] + ThrowStatement[?Yield, ?Await] + TryStatement[?Yield, ?Await, ?Return] + DebuggerStatement + +Declaration[Yield, Await] : + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + +HoistableDeclaration[Yield, Await, Default] : + FunctionDeclaration[?Yield, ?Await, ?Default] + GeneratorDeclaration[?Yield, ?Await, ?Default] + AsyncFunctionDeclaration[?Yield, ?Await, ?Default] + AsyncGeneratorDeclaration[?Yield, ?Await, ?Default] + +BreakableStatement[Yield, Await, Return] : + IterationStatement[?Yield, ?Await, ?Return] + SwitchStatement[?Yield, ?Await, ?Return] + +@line 14741 + +BlockStatement[Yield, Await, Return] : + Block[?Yield, ?Await, ?Return] + +Block[Yield, Await, Return] : + `{` StatementList[?Yield, ?Await, ?Return]? `}` + +StatementList[Yield, Await, Return] : + StatementListItem[?Yield, ?Await, ?Return] + StatementList[?Yield, ?Await, ?Return] StatementListItem[?Yield, ?Await, ?Return] + +StatementListItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + Declaration[?Yield, ?Await] + +@line 15091 + +LexicalDeclaration[In, Yield, Await] : + LetOrConst BindingList[?In, ?Yield, ?Await] `;` + +LetOrConst : + `let` + `const` + +BindingList[In, Yield, Await] : + LexicalBinding[?In, ?Yield, ?Await] + BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await] + +LexicalBinding[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 15216 + +VariableStatement[Yield, Await] : + `var` VariableDeclarationList[+In, ?Yield, ?Await] `;` + +VariableDeclarationList[In, Yield, Await] : + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] `,` VariableDeclaration[?In, ?Yield, ?Await] + +VariableDeclaration[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 15316 + +BindingPattern[Yield, Await] : + ObjectBindingPattern[?Yield, ?Await] + ArrayBindingPattern[?Yield, ?Await] + +ObjectBindingPattern[Yield, Await] : + `{` `}` + `{` BindingRestProperty[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `,` BindingRestProperty[?Yield, ?Await]? `}` + +ArrayBindingPattern[Yield, Await] : + `[` Elision? BindingRestElement[?Yield, ?Await]? `]` + `[` BindingElementList[?Yield, ?Await] `]` + `[` BindingElementList[?Yield, ?Await] `,` Elision? BindingRestElement[?Yield, ?Await]? `]` + +BindingRestProperty[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + +BindingPropertyList[Yield, Await] : + BindingProperty[?Yield, ?Await] + BindingPropertyList[?Yield, ?Await] `,` BindingProperty[?Yield, ?Await] + +BindingElementList[Yield, Await] : + BindingElisionElement[?Yield, ?Await] + BindingElementList[?Yield, ?Await] `,` BindingElisionElement[?Yield, ?Await] + +BindingElisionElement[Yield, Await] : + Elision? BindingElement[?Yield, ?Await] + +BindingProperty[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` BindingElement[?Yield, ?Await] + +BindingElement[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + BindingPattern[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +SingleNameBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +BindingRestElement[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + `...` BindingPattern[?Yield, ?Await] + +@line 15798 + +EmptyStatement : + `;` + +@line 15815 + +ExpressionStatement[Yield, Await] : + [lookahead ` ConciseBody[?In] + +ArrowParameters[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +ConciseBody[In] : + [lookahead != `{` ] AssignmentExpression[?In, ~Yield, ~Await] + `{` FunctionBody[~Yield, ~Await] `}` + +@line 18532 + +ArrowFormalParameters[Yield, Await] : + `(` UniqueFormalParameters[?Yield, ?Await] `)` + +@line 18768 + +MethodDefinition[Yield, Await] : + PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + GeneratorMethod[?Yield, ?Await] + AsyncMethod[?Yield, ?Await] + AsyncGeneratorMethod[?Yield, ?Await] + `get` PropertyName[?Yield, ?Await] `(` `)` `{` FunctionBody[~Yield, ~Await] `}` + `set` PropertyName[?Yield, ?Await] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield, ~Await] `}` + +PropertySetParameterList : + FormalParameter[~Yield, ~Await] + +@line 18950 + +GeneratorMethod[Yield, Await] : + `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorDeclaration[Yield, Await, Default] : + `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorExpression : + `function` `*` BindingIdentifier[+Yield, ~Await]? `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorBody : + FunctionBody[+Yield, ~Await] + +YieldExpression[In, Await] : + `yield` + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await] + +@line 19311 + +AsyncGeneratorMethod[Yield, Await] : + `async` [no LineTerminator here] `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + [+Default] `async` [no LineTerminator here] `function` `*` `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorExpression : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[+Yield, +Await]? `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorBody : + FunctionBody[+Yield, +Await] + +@line 19588 + +ClassDeclaration[Yield, Await, Default] : + `class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] `class` ClassTail[?Yield, ?Await] + +ClassExpression[Yield, Await] : + `class` BindingIdentifier[?Yield, ?Await]? ClassTail[?Yield, ?Await] + +ClassTail[Yield, Await] : + ClassHeritage[?Yield, ?Await]? `{` ClassBody[?Yield, ?Await]? `}` + +ClassHeritage[Yield, Await] : + `extends` LeftHandSideExpression[?Yield, ?Await] + +ClassBody[Yield, Await] : + ClassElementList[?Yield, ?Await] + +ClassElementList[Yield, Await] : + ClassElement[?Yield, ?Await] + ClassElementList[?Yield, ?Await] ClassElement[?Yield, ?Await] + +ClassElement[Yield, Await] : + MethodDefinition[?Yield, ?Await] + `static` MethodDefinition[?Yield, ?Await] + `;` + +@line 19954 + +AsyncFunctionDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + [+Default] `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionExpression : + `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncMethod[Yield, Await] : + `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionBody : + FunctionBody[~Yield, +Await] + +AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] + +@line 20263 + +AsyncArrowFunction[In, Yield, Await] : + `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + +AsyncConciseBody[In] : + [lookahead != `{`] AssignmentExpression[?In, ~Yield, +Await] + `{` AsyncFunctionBody `}` + +AsyncArrowBindingIdentifier[Yield] : + BindingIdentifier[?Yield, +Await] + +CoverCallExpressionAndAsyncArrowHead[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 20281 + +AsyncArrowHead : + `async` [no LineTerminator here] ArrowFormalParameters[~Yield, +Await] + +@line 20850 + +Script : + ScriptBody? + +ScriptBody : + StatementList[~Yield, ~Await, ~Return] + +@line 21143 + +Module : + ModuleBody? + +ModuleBody : + ModuleItemList + +ModuleItemList : + ModuleItem + ModuleItemList ModuleItem + +ModuleItem : + ImportDeclaration + ExportDeclaration + StatementListItem[~Yield, ~Await, ~Return] + +@line 22645 + +ImportDeclaration : + `import` ImportClause FromClause `;` + `import` ModuleSpecifier `;` + +ImportClause : + ImportedDefaultBinding + NameSpaceImport + NamedImports + ImportedDefaultBinding `,` NameSpaceImport + ImportedDefaultBinding `,` NamedImports + +ImportedDefaultBinding : + ImportedBinding + +NameSpaceImport : + `*` `as` ImportedBinding + +NamedImports : + `{` `}` + `{` ImportsList `}` + `{` ImportsList `,` `}` + +FromClause : + `from` ModuleSpecifier + +ImportsList : + ImportSpecifier + ImportsList `,` ImportSpecifier + +ImportSpecifier : + ImportedBinding + IdentifierName `as` ImportedBinding + +ModuleSpecifier : + StringLiteral + +ImportedBinding : + BindingIdentifier[~Yield, ~Await] + +@line 22818 + +ExportDeclaration : + `export` `*` FromClause `;` + `export` ExportClause FromClause `;` + `export` ExportClause `;` + `export` VariableStatement[~Yield, ~Await] + `export` Declaration[~Yield, ~Await] + `export` `default` HoistableDeclaration[~Yield, ~Await, +Default] + `export` `default` ClassDeclaration[~Yield, ~Await, +Default] + `export` `default` [lookahead ` + +RegExpIdentifierName[U] :: + RegExpIdentifierStart[?U] + RegExpIdentifierName[?U] RegExpIdentifierPart[?U] + +RegExpIdentifierStart[U] :: + UnicodeIDStart + `$` + `_` + `\` RegExpUnicodeEscapeSequence[?U] + +RegExpIdentifierPart[U] :: + UnicodeIDContinue + `$` + `\` RegExpUnicodeEscapeSequence[?U] + + + +RegExpUnicodeEscapeSequence[U] :: + [+U] `u` LeadSurrogate `\u` TrailSurrogate + [+U] `u` LeadSurrogate + [+U] `u` TrailSurrogate + [+U] `u` NonSurrogate + [~U] `u` Hex4Digits + [+U] `u{` CodePoint `}` + +@line 29248 + +LeadSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF] + +TrailSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF] + +NonSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] + +IdentityEscape[U] :: + [+U] SyntaxCharacter + [+U] `/` + [~U] SourceCharacter but not UnicodeIDContinue + +DecimalEscape :: + NonZeroDigit DecimalDigits? [lookahead \n | CallExpression", + "replacement": "| CallExpression\n | NewExpression" + }, + { + "_comment_": "MethodDefinition must come before IdentifierReference.", + "name": "PropertyDefinition", + "pattern": "| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName \":\" AssignmentExpression -- alt3\n | MethodDefinition -- alt4\n | \"...\" AssignmentExpression -- alt5", + "replacement": "| \"...\" AssignmentExpression -- alt5\n | MethodDefinition -- alt4\n | PropertyName \":\" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2" + }, + { + "_comment_": "Need this rather than `#sc` so that EmptyStatement is not nullable.", + "name": "EmptyStatement", + "override": "\";\" // note: this semicolon eats newlines" + }, + { + "_comment_": "ArrowFunction must come before ConditionalExpression, because the arrow function parameters will parse as a parenthesized expression. Both LeftHandSideExpression alternatives must also come before ConditionalExpression.", + "name": "AssignmentExpression", + "pattern": "| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | AsyncArrowFunction -- alt4\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6", + "replacement": "| AsyncArrowFunction -- alt4\n | ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2" + }, + { + "name": "FormalParameters", + "pattern": "| /* empty */ -- alt1\n | FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5", + "replacement": "| FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5\n | /* empty */ -- alt1" + }, + { + "_comment_": "The recursive MemberExpression application must come before PrimaryExpression.", + "name": "MemberExpression", + "pattern": "| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7", + "replacement": "| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6" + }, + { + "_comment_": "Move PostfixExpression to the very end.", + "name": "UnaryExpression", + "pattern": " | UpdateExpression -- alt1\n", + "postlude": "\n | UpdateExpression -- alt1", + "replacement": "" + }, + { + "_comment_": "The first alternative is a subset of the second one, so flip the order.", + "name": "ConditionalExpression", + "pattern": "| ShortCircuitExpression -- alt1\n | ShortCircuitExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2", + "replacement": "| ShortCircuitExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2\n | ShortCircuitExpression -- alt1" + }, + { + "_comment_": "First, put move the left recursive application above the ShiftExpression. (It's not properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` to be right before the `\"in\"` terminal.", + "name": "RelationalExpression", + "pattern": "| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7", + "replacement": "| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1" + }, + { + "_comment_": "FIXME: Make sure these produce something useful.", + "name": "identifierPart", + "pattern": "| \"\" /* FIXME */ -- alt4\n | \"\" /* FIXME */ -- alt5", + "replacement": "| \"_\" -- alt4 /* FIXME */" + }, + { + "_comment_": "Move decimalLiteral to the very end.", + "name": "numericLiteral", + "pattern": " | decimalLiteral -- alt1", + "postlude": "\n | decimalLiteral -- alt1", + "replacement": "" + }, + { + "_comment_": "alt1 is strictly a subset of the following two alternatives, so put it at the end.", + "name": "PostfixExpression", + "pattern": "| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3", + "replacement": "| LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3\n | LeftHandSideExpression -- alt1" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "ModuleItemList", + "pattern": "| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1", + "replacement": "| ModuleItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleLineCommentChars", + "pattern": "| singleLineCommentChar singleLineCommentChars? -- alt1", + "replacement": "| singleLineCommentChar+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "doubleStringCharacters", + "pattern": "| doubleStringCharacter doubleStringCharacters? -- alt1", + "replacement": "| doubleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleStringCharacters", + "pattern": "| singleStringCharacter singleStringCharacters? -- alt1", + "replacement": "| singleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "templateCharacters", + "pattern": "| templateCharacter templateCharacters? -- alt1", + "replacement": "| templateCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "multiLineCommentChars", + "pattern": "| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | \"*\" postAsteriskCommentChars? -- alt2", + "replacement": "(~\"*/\" sourceCharacter)*" + } + ] +} diff --git a/examples/ecmascript/spec/es2020/spec.grammar b/examples/ecmascript/spec/es2020/spec.grammar new file mode 100644 index 00000000..ffed318d --- /dev/null +++ b/examples/ecmascript/spec/es2020/spec.grammar @@ -0,0 +1,1569 @@ +@line 10352 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +SourceCharacter :: + > any Unicode code point + +@line 10510 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +InputElementDiv :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + RightBracePunctuator + +InputElementRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + RightBracePunctuator + RegularExpressionLiteral + +InputElementRegExpOrTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + RegularExpressionLiteral + TemplateSubstitutionTail + +InputElementTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + TemplateSubstitutionTail + +@line 10718 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +WhiteSpace :: + + + + + + + + +@line 10799 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +LineTerminator :: + + + + + +LineTerminatorSequence :: + + [lookahead != ] + + + + +@line 10821 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +Comment :: + MultiLineComment + SingleLineComment + +MultiLineComment :: + `/*` MultiLineCommentChars? `*/` + +MultiLineCommentChars :: + MultiLineNotAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +PostAsteriskCommentChars :: + MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +MultiLineNotAsteriskChar :: + SourceCharacter but not `*` + +MultiLineNotForwardSlashOrAsteriskChar :: + SourceCharacter but not one of `/` or `*` + +SingleLineComment :: + `//` SingleLineCommentChars? + +SingleLineCommentChars :: + SingleLineCommentChar SingleLineCommentChars? + +SingleLineCommentChar :: + SourceCharacter but not LineTerminator + +@line 10857 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +CommonToken :: + IdentifierName + Punctuator + NumericLiteral + StringLiteral + Template + +@line 10879 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + +IdentifierStart :: + UnicodeIDStart + `$` + `_` + `\` UnicodeEscapeSequence + +IdentifierPart :: + UnicodeIDContinue + `$` + `\` UnicodeEscapeSequence + + + +UnicodeIDStart :: + > any Unicode code point with the Unicode property “ID_Start” + +UnicodeIDContinue :: + > any Unicode code point with the Unicode property “ID_Continue” + +@line 10970 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ReservedWord :: one of + `await` + `break` + `case` `catch` `class` `const` `continue` + `debugger` `default` `delete` `do` + `else` `enum` `export` `extends` + `false` `finally` `for` `function` + `if` `import` `in` `instanceof` + `new` `null` + `return` + `super` `switch` + `this` `throw` `true` `try` `typeof` + `var` `void` + `while` `with` + `yield` + +@line 11004 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +Punctuator :: + OptionalChainingPunctuator + OtherPunctuator + +OptionalChainingPunctuator :: + `?.` [lookahead ` `<=` `>=` + `==` `!=` `===` `!==` + `+` `-` `*` `%` `**` + `++` `--` + `<<` `>>` `>>>` + `&` `|` `^` + `!` `~` + `&&` `||` `??` + `?` `:` + `=` `+=` `-=` `*=` `%=` `**=` `<<=` `>>=` `>>>=` `&=` `|=` `^=` + `=>` + +DivPunctuator :: + `/` + `/=` + +RightBracePunctuator :: + `}` + +@line 11042 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +NullLiteral :: + `null` + +@line 11051 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +BooleanLiteral :: + `true` + `false` + +@line 11061 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +NumericLiteral :: + DecimalLiteral + DecimalBigIntegerLiteral + NonDecimalIntegerLiteral + NonDecimalIntegerLiteral BigIntLiteralSuffix + +DecimalBigIntegerLiteral :: + `0` BigIntLiteralSuffix + NonZeroDigit DecimalDigits? BigIntLiteralSuffix + +NonDecimalIntegerLiteral :: + BinaryIntegerLiteral + OctalIntegerLiteral + HexIntegerLiteral + +BigIntLiteralSuffix :: + `n` + +DecimalLiteral :: + DecimalIntegerLiteral `.` DecimalDigits? ExponentPart? + `.` DecimalDigits ExponentPart? + DecimalIntegerLiteral ExponentPart? + +DecimalIntegerLiteral :: + `0` + NonZeroDigit DecimalDigits? + +DecimalDigits :: + DecimalDigit + DecimalDigits DecimalDigit + +DecimalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + +NonZeroDigit :: one of + `1` `2` `3` `4` `5` `6` `7` `8` `9` + +ExponentPart :: + ExponentIndicator SignedInteger + +ExponentIndicator :: one of + `e` `E` + +SignedInteger :: + DecimalDigits + `+` DecimalDigits + `-` DecimalDigits + +BinaryIntegerLiteral :: + `0b` BinaryDigits + `0B` BinaryDigits + +BinaryDigits :: + BinaryDigit + BinaryDigits BinaryDigit + +BinaryDigit :: one of + `0` `1` + +OctalIntegerLiteral :: + `0o` OctalDigits + `0O` OctalDigits + +OctalDigits :: + OctalDigit + OctalDigits OctalDigit + +OctalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` + +HexIntegerLiteral :: + `0x` HexDigits + `0X` HexDigits + +HexDigits :: + HexDigit + HexDigits HexDigit + +HexDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `a` `b` `c` `d` `e` `f` `A` `B` `C` `D` `E` `F` + +@line 11354 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + +DoubleStringCharacters :: + DoubleStringCharacter DoubleStringCharacters? + +SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + +DoubleStringCharacter :: + SourceCharacter but not one of `"` or `\` or LineTerminator + + + `\` EscapeSequence + LineContinuation + +SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + + + `\` EscapeSequence + LineContinuation + +LineContinuation :: + `\` LineTerminatorSequence + +EscapeSequence :: + CharacterEscapeSequence + `0` [lookahead but only if MV of |HexDigits| > 0x10FFFF] + +CodePoint :: + HexDigits [> but only if MV of |HexDigits| < 0x10FFFF] + +@line 12204 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +IdentifierReference[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +BindingIdentifier[Yield, Await] : + Identifier + `yield` + `await` + +LabelIdentifier[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +Identifier : + IdentifierName but not ReservedWord + +@line 12438 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +PrimaryExpression[Yield, Await] : + `this` + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `)` + `(` `)` + `(` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` `...` BindingPattern[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingPattern[?Yield, ?Await] `)` + +@line 12469 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ParenthesizedExpression[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + +@line 12594 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +Literal : + NullLiteral + BooleanLiteral + NumericLiteral + StringLiteral + +@line 12631 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ArrayLiteral[Yield, Await] : + `[` Elision? `]` + `[` ElementList[?Yield, ?Await] `]` + `[` ElementList[?Yield, ?Await] `,` Elision? `]` + +ElementList[Yield, Await] : + Elision? AssignmentExpression[+In, ?Yield, ?Await] + Elision? SpreadElement[?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? AssignmentExpression[+In, ?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? SpreadElement[?Yield, ?Await] + +Elision : + `,` + Elision `,` + +SpreadElement[Yield, Await] : + `...` AssignmentExpression[+In, ?Yield, ?Await] + +@line 12756 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ObjectLiteral[Yield, Await] : + `{` `}` + `{` PropertyDefinitionList[?Yield, ?Await] `}` + `{` PropertyDefinitionList[?Yield, ?Await] `,` `}` + +PropertyDefinitionList[Yield, Await] : + PropertyDefinition[?Yield, ?Await] + PropertyDefinitionList[?Yield, ?Await] `,` PropertyDefinition[?Yield, ?Await] + +PropertyDefinition[Yield, Await] : + IdentifierReference[?Yield, ?Await] + CoverInitializedName[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` AssignmentExpression[+In, ?Yield, ?Await] + MethodDefinition[?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + +PropertyName[Yield, Await] : + LiteralPropertyName + ComputedPropertyName[?Yield, ?Await] + +LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + +ComputedPropertyName[Yield, Await] : + `[` AssignmentExpression[+In, ?Yield, ?Await] `]` + +CoverInitializedName[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await] + +Initializer[In, Yield, Await] : + `=` AssignmentExpression[?In, ?Yield, ?Await] + +@line 13048 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +TemplateLiteral[Yield, Await, Tagged] : + NoSubstitutionTemplate + SubstitutionTemplate[?Yield, ?Await, ?Tagged] + +SubstitutionTemplate[Yield, Await, Tagged] : + TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await, ?Tagged] + +TemplateSpans[Yield, Await, Tagged] : + TemplateTail + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateTail + +TemplateMiddleList[Yield, Await, Tagged] : + TemplateMiddle Expression[+In, ?Yield, ?Await] + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await] + +@line 13387 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +MemberExpression[Yield, Await] : + PrimaryExpression[?Yield, ?Await] + MemberExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + MemberExpression[?Yield, ?Await] `.` IdentifierName + MemberExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + SuperProperty[?Yield, ?Await] + MetaProperty + `new` MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +SuperProperty[Yield, Await] : + `super` `[` Expression[+In, ?Yield, ?Await] `]` + `super` `.` IdentifierName + +MetaProperty : + NewTarget + ImportMeta + +NewTarget : + `new` `.` `target` + +ImportMeta : + `import` `.` `meta` + +NewExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] + `new` NewExpression[?Yield, ?Await] + +CallExpression[Yield, Await] : + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] #callcover + SuperCall[?Yield, ?Await] + ImportCall[?Yield, ?Await] + CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + CallExpression[?Yield, ?Await] `.` IdentifierName + CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + +SuperCall[Yield, Await] : + `super` Arguments[?Yield, ?Await] + +ImportCall[Yield, Await] : + `import` `(` AssignmentExpression[+In, ?Yield, ?Await] `)` + +Arguments[Yield, Await] : + `(` `)` + `(` ArgumentList[?Yield, ?Await] `)` + `(` ArgumentList[?Yield, ?Await] `,` `)` + +ArgumentList[Yield, Await] : + AssignmentExpression[+In, ?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` `...` AssignmentExpression[+In, ?Yield, ?Await] + +OptionalExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + CallExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + OptionalExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + +OptionalChain[Yield, Await] : + `?.` Arguments[?Yield, ?Await] + `?.` `[` Expression[+In, ?Yield, ?Await] `]` + `?.` IdentifierName + `?.` TemplateLiteral[?Yield, ?Await, +Tagged] + OptionalChain[?Yield, ?Await] Arguments[?Yield, ?Await] + OptionalChain[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + OptionalChain[?Yield, ?Await] `.` IdentifierName + OptionalChain[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + +LeftHandSideExpression[Yield, Await] : + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + OptionalExpression[?Yield, ?Await] + +@line 13463 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +CallMemberExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 14173 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +UpdateExpression[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++` + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--` + `++` UnaryExpression[?Yield, ?Await] + `--` UnaryExpression[?Yield, ?Await] + +@line 14305 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +UnaryExpression[Yield, Await] : + UpdateExpression[?Yield, ?Await] + `delete` UnaryExpression[?Yield, ?Await] + `void` UnaryExpression[?Yield, ?Await] + `typeof` UnaryExpression[?Yield, ?Await] + `+` UnaryExpression[?Yield, ?Await] + `-` UnaryExpression[?Yield, ?Await] + `~` UnaryExpression[?Yield, ?Await] + `!` UnaryExpression[?Yield, ?Await] + [+Await] AwaitExpression[?Yield] + +@line 14595 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ExponentiationExpression[Yield, Await] : + UnaryExpression[?Yield, ?Await] + UpdateExpression[?Yield, ?Await] `**` ExponentiationExpression[?Yield, ?Await] + +@line 14646 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +MultiplicativeExpression[Yield, Await] : + ExponentiationExpression[?Yield, ?Await] + MultiplicativeExpression[?Yield, ?Await] MultiplicativeOperator ExponentiationExpression[?Yield, ?Await] + +MultiplicativeOperator : one of + `*` `/` `%` + +@line 14697 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +AdditiveExpression[Yield, Await] : + MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `+` MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `-` MultiplicativeExpression[?Yield, ?Await] + +@line 14789 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ShiftExpression[Yield, Await] : + AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `<` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>` AdditiveExpression[?Yield, ?Await] + +@line 14901 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +RelationalExpression[In, Yield, Await] : + ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `instanceof` ShiftExpression[?Yield, ?Await] + [+In] RelationalExpression[+In, ?Yield, ?Await] `in` ShiftExpression[?Yield, ?Await] + +@line 15033 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +EqualityExpression[In, Yield, Await] : + RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `==` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!=` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `===` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!==` RelationalExpression[?In, ?Yield, ?Await] + +@line 15155 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +BitwiseANDExpression[In, Yield, Await] : + EqualityExpression[?In, ?Yield, ?Await] + BitwiseANDExpression[?In, ?Yield, ?Await] `&` EqualityExpression[?In, ?Yield, ?Await] + +BitwiseXORExpression[In, Yield, Await] : + BitwiseANDExpression[?In, ?Yield, ?Await] + BitwiseXORExpression[?In, ?Yield, ?Await] `^` BitwiseANDExpression[?In, ?Yield, ?Await] + +BitwiseORExpression[In, Yield, Await] : + BitwiseXORExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] `|` BitwiseXORExpression[?In, ?Yield, ?Await] + +@line 15223 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +LogicalANDExpression[In, Yield, Await] : + BitwiseORExpression[?In, ?Yield, ?Await] + LogicalANDExpression[?In, ?Yield, ?Await] `&` BitwiseORExpression[?In, ?Yield, ?Await] + +LogicalORExpression[In, Yield, Await] : + LogicalANDExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await] + +CoalesceExpression[In, Yield, Await] : + CoalesceExpressionHead[?In, ?Yield, ?Await] `??` BitwiseORExpression[?In, ?Yield, ?Await] + +CoalesceExpressionHead[In, Yield, Await] : + CoalesceExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] + +ShortCircuitExpression[In, Yield, Await] : + LogicalORExpression[?In, ?Yield, ?Await] + CoalesceExpression[?In, ?Yield, ?Await] + +@line 15312 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ConditionalExpression[In, Yield, Await] : + ShortCircuitExpression[?In, ?Yield, ?Await] + ShortCircuitExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await] + +@line 15358 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +AssignmentExpression[In, Yield, Await] : + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield] YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + +AssignmentOperator : one of + `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + +@line 15475 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +AssignmentPattern[Yield, Await] : + ObjectAssignmentPattern[?Yield, ?Await] + ArrayAssignmentPattern[?Yield, ?Await] + +ObjectAssignmentPattern[Yield, Await] : + `{` `}` + `{` AssignmentRestProperty[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `,` AssignmentRestProperty[?Yield, ?Await]? `}` + +ArrayAssignmentPattern[Yield, Await] : + `[` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + `[` AssignmentElementList[?Yield, ?Await] `]` + `[` AssignmentElementList[?Yield, ?Await] `,` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + +AssignmentRestProperty[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +AssignmentPropertyList[Yield, Await] : + AssignmentProperty[?Yield, ?Await] + AssignmentPropertyList[?Yield, ?Await] `,` AssignmentProperty[?Yield, ?Await] + +AssignmentElementList[Yield, Await] : + AssignmentElisionElement[?Yield, ?Await] + AssignmentElementList[?Yield, ?Await] `,` AssignmentElisionElement[?Yield, ?Await] + +AssignmentElisionElement[Yield, Await] : + Elision? AssignmentElement[?Yield, ?Await] + +AssignmentProperty[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + PropertyName[?Yield, ?Await] `:` AssignmentElement[?Yield, ?Await] + +AssignmentElement[Yield, Await] : + DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +AssignmentRestElement[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +DestructuringAssignmentTarget[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + +@line 15808 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +Expression[In, Yield, Await] : + AssignmentExpression[?In, ?Yield, ?Await] + Expression[?In, ?Yield, ?Await] `,` AssignmentExpression[?In, ?Yield, ?Await] + +@line 15851 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +Statement[Yield, Await, Return] : + BlockStatement[?Yield, ?Await, ?Return] + VariableStatement[?Yield, ?Await] + EmptyStatement + ExpressionStatement[?Yield, ?Await] + IfStatement[?Yield, ?Await, ?Return] + BreakableStatement[?Yield, ?Await, ?Return] + ContinueStatement[?Yield, ?Await] + BreakStatement[?Yield, ?Await] + [+Return] ReturnStatement[?Yield, ?Await] + WithStatement[?Yield, ?Await, ?Return] + LabelledStatement[?Yield, ?Await, ?Return] + ThrowStatement[?Yield, ?Await] + TryStatement[?Yield, ?Await, ?Return] + DebuggerStatement + +Declaration[Yield, Await] : + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + +HoistableDeclaration[Yield, Await, Default] : + FunctionDeclaration[?Yield, ?Await, ?Default] + GeneratorDeclaration[?Yield, ?Await, ?Default] + AsyncFunctionDeclaration[?Yield, ?Await, ?Default] + AsyncGeneratorDeclaration[?Yield, ?Await, ?Default] + +BreakableStatement[Yield, Await, Return] : + IterationStatement[?Yield, ?Await, ?Return] + SwitchStatement[?Yield, ?Await, ?Return] + +@line 16073 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +BlockStatement[Yield, Await, Return] : + Block[?Yield, ?Await, ?Return] + +Block[Yield, Await, Return] : + `{` StatementList[?Yield, ?Await, ?Return]? `}` + +StatementList[Yield, Await, Return] : + StatementListItem[?Yield, ?Await, ?Return] + StatementList[?Yield, ?Await, ?Return] StatementListItem[?Yield, ?Await, ?Return] + +StatementListItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + Declaration[?Yield, ?Await] + +@line 16423 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +LexicalDeclaration[In, Yield, Await] : + LetOrConst BindingList[?In, ?Yield, ?Await] `;` + +LetOrConst : + `let` + `const` + +BindingList[In, Yield, Await] : + LexicalBinding[?In, ?Yield, ?Await] + BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await] + +LexicalBinding[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 16548 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +VariableStatement[Yield, Await] : + `var` VariableDeclarationList[+In, ?Yield, ?Await] `;` + +VariableDeclarationList[In, Yield, Await] : + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] `,` VariableDeclaration[?In, ?Yield, ?Await] + +VariableDeclaration[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 16648 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +BindingPattern[Yield, Await] : + ObjectBindingPattern[?Yield, ?Await] + ArrayBindingPattern[?Yield, ?Await] + +ObjectBindingPattern[Yield, Await] : + `{` `}` + `{` BindingRestProperty[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `,` BindingRestProperty[?Yield, ?Await]? `}` + +ArrayBindingPattern[Yield, Await] : + `[` Elision? BindingRestElement[?Yield, ?Await]? `]` + `[` BindingElementList[?Yield, ?Await] `]` + `[` BindingElementList[?Yield, ?Await] `,` Elision? BindingRestElement[?Yield, ?Await]? `]` + +BindingRestProperty[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + +BindingPropertyList[Yield, Await] : + BindingProperty[?Yield, ?Await] + BindingPropertyList[?Yield, ?Await] `,` BindingProperty[?Yield, ?Await] + +BindingElementList[Yield, Await] : + BindingElisionElement[?Yield, ?Await] + BindingElementList[?Yield, ?Await] `,` BindingElisionElement[?Yield, ?Await] + +BindingElisionElement[Yield, Await] : + Elision? BindingElement[?Yield, ?Await] + +BindingProperty[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` BindingElement[?Yield, ?Await] + +BindingElement[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + BindingPattern[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +SingleNameBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +BindingRestElement[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + `...` BindingPattern[?Yield, ?Await] + +@line 17142 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +EmptyStatement : + `;` + +@line 17159 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ExpressionStatement[Yield, Await] : + [lookahead ` ConciseBody[?In] + +ArrowParameters[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +ConciseBody[In] : + [lookahead != `{`] ExpressionBody[?In, ~Await] + `{` FunctionBody[~Yield, ~Await] `}` + +ExpressionBody[In, Await] : + AssignmentExpression[?In, ~Yield, ?Await] + +@line 19975 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ArrowFormalParameters[Yield, Await] : + `(` UniqueFormalParameters[?Yield, ?Await] `)` + +@line 20230 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +MethodDefinition[Yield, Await] : + PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + GeneratorMethod[?Yield, ?Await] + AsyncMethod[?Yield, ?Await] + AsyncGeneratorMethod[?Yield, ?Await] + `get` PropertyName[?Yield, ?Await] `(` `)` `{` FunctionBody[~Yield, ~Await] `}` + `set` PropertyName[?Yield, ?Await] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield, ~Await] `}` + +PropertySetParameterList : + FormalParameter[~Yield, ~Await] + +@line 20406 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +GeneratorMethod[Yield, Await] : + `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorDeclaration[Yield, Await, Default] : + `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorExpression : + `function` `*` BindingIdentifier[+Yield, ~Await]? `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorBody : + FunctionBody[+Yield, ~Await] + +YieldExpression[In, Await] : + `yield` + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await] + +@line 20763 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +AsyncGeneratorMethod[Yield, Await] : + `async` [no LineTerminator here] `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + [+Default] `async` [no LineTerminator here] `function` `*` `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorExpression : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[+Yield, +Await]? `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorBody : + FunctionBody[+Yield, +Await] + +@line 21035 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ClassDeclaration[Yield, Await, Default] : + `class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] `class` ClassTail[?Yield, ?Await] + +ClassExpression[Yield, Await] : + `class` BindingIdentifier[?Yield, ?Await]? ClassTail[?Yield, ?Await] + +ClassTail[Yield, Await] : + ClassHeritage[?Yield, ?Await]? `{` ClassBody[?Yield, ?Await]? `}` + +ClassHeritage[Yield, Await] : + `extends` LeftHandSideExpression[?Yield, ?Await] + +ClassBody[Yield, Await] : + ClassElementList[?Yield, ?Await] + +ClassElementList[Yield, Await] : + ClassElement[?Yield, ?Await] + ClassElementList[?Yield, ?Await] ClassElement[?Yield, ?Await] + +ClassElement[Yield, Await] : + MethodDefinition[?Yield, ?Await] + `static` MethodDefinition[?Yield, ?Await] + `;` + +@line 21392 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +AsyncFunctionDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + [+Default] `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionExpression : + `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncMethod[Yield, Await] : + `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionBody : + FunctionBody[~Yield, +Await] + +AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] + +@line 21696 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +AsyncArrowFunction[In, Yield, Await] : + `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + +AsyncConciseBody[In] : + [lookahead != `{`] ExpressionBody[?In, +Await] + `{` AsyncFunctionBody `}` + +AsyncArrowBindingIdentifier[Yield] : + BindingIdentifier[?Yield, +Await] + +CoverCallExpressionAndAsyncArrowHead[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 21714 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +AsyncArrowHead : + `async` [no LineTerminator here] ArrowFormalParameters[~Yield, +Await] + +@line 22317 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +Script : + ScriptBody? + +ScriptBody : + StatementList[~Yield, ~Await, ~Return] + +@line 22596 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +Module : + ModuleBody? + +ModuleBody : + ModuleItemList + +ModuleItemList : + ModuleItem + ModuleItemList ModuleItem + +ModuleItem : + ImportDeclaration + ExportDeclaration + StatementListItem[~Yield, ~Await, ~Return] + +@line 24210 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ImportDeclaration : + `import` ImportClause FromClause `;` + `import` ModuleSpecifier `;` + +ImportClause : + ImportedDefaultBinding + NameSpaceImport + NamedImports + ImportedDefaultBinding `,` NameSpaceImport + ImportedDefaultBinding `,` NamedImports + +ImportedDefaultBinding : + ImportedBinding + +NameSpaceImport : + `*` `as` ImportedBinding + +NamedImports : + `{` `}` + `{` ImportsList `}` + `{` ImportsList `,` `}` + +FromClause : + `from` ModuleSpecifier + +ImportsList : + ImportSpecifier + ImportsList `,` ImportSpecifier + +ImportSpecifier : + ImportedBinding + IdentifierName `as` ImportedBinding + +ModuleSpecifier : + StringLiteral + +ImportedBinding : + BindingIdentifier[~Yield, ~Await] + +@line 24383 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +ExportDeclaration : + `export` ExportFromClause FromClause `;` + `export` NamedExports `;` + `export` VariableStatement[~Yield, ~Await] + `export` Declaration[~Yield, ~Await] + `export` `default` HoistableDeclaration[~Yield, ~Await, +Default] + `export` `default` ClassDeclaration[~Yield, ~Await, +Default] + `export` `default` [lookahead ` + +RegExpIdentifierName[U] :: + RegExpIdentifierStart[?U] + RegExpIdentifierName[?U] RegExpIdentifierPart[?U] + +RegExpIdentifierStart[U] :: + UnicodeIDStart + `$` + `_` + `\` RegExpUnicodeEscapeSequence[+U] + [~U] UnicodeLeadSurrogate UnicodeTrailSurrogate + +RegExpIdentifierPart[U] :: + UnicodeIDContinue + `$` + `\` RegExpUnicodeEscapeSequence[+U] + [~U] UnicodeLeadSurrogate UnicodeTrailSurrogate + + + +RegExpUnicodeEscapeSequence[U] :: + [+U] `u` LeadSurrogate `\u` TrailSurrogate + [+U] `u` LeadSurrogate + [+U] `u` TrailSurrogate + [+U] `u` NonSurrogate + [~U] `u` Hex4Digits + [+U] `u{` CodePoint `}` + +UnicodeLeadSurrogate :: + > any Unicode code point in the inclusive range 0xD800 to 0xDBFF + +UnicodeTrailSurrogate :: + > any Unicode code point in the inclusive range 0xDC00 to 0xDFFF + +@line 30966 "https://github.com/tc39/ecma262/raw/es2020/spec.html" + +LeadSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF] + +TrailSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF] + +NonSurrogate :: + Hex4Digits [> but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] + +IdentityEscape[U] :: + [+U] SyntaxCharacter + [+U] `/` + [~U] SourceCharacter but not UnicodeIDContinue + +DecimalEscape :: + NonZeroDigit DecimalDigits? [lookahead \n | CallExpression", + "replacement": "| CallExpression\n | NewExpression" + }, + { + "_comment_": "MethodDefinition must come before IdentifierReference.", + "name": "PropertyDefinition", + "pattern": "| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName \":\" AssignmentExpression -- alt3\n | MethodDefinition -- alt4\n | \"...\" AssignmentExpression -- alt5", + "replacement": "| \"...\" AssignmentExpression -- alt5\n | MethodDefinition -- alt4\n | PropertyName \":\" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2" + }, + { + "_comment_": "Need this rather than `#sc` so that EmptyStatement is not nullable.", + "name": "EmptyStatement", + "override": "\";\" // note: this semicolon eats newlines" + }, + { + "_comment_": "ArrowFunction must come before ConditionalExpression, because the arrow function parameters will parse as a parenthesized expression. Both LeftHandSideExpression alternatives must also come before ConditionalExpression.", + "name": "AssignmentExpression", + "pattern": "| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | AsyncArrowFunction -- alt4\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6", + "replacement": "| AsyncArrowFunction -- alt4\n | ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2" + }, + { + "name": "FormalParameters", + "pattern": "| /* empty */ -- alt1\n | FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5", + "replacement": "| FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5\n | /* empty */ -- alt1" + }, + { + "_comment_": "The recursive MemberExpression application must come before PrimaryExpression.", + "name": "MemberExpression", + "pattern": "| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7", + "replacement": "| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6" + }, + { + "_comment_": "Move PostfixExpression to the very end.", + "name": "UnaryExpression", + "pattern": " | UpdateExpression -- alt1\n", + "postlude": "\n | UpdateExpression -- alt1", + "replacement": "" + }, + { + "_comment_": "The first alternative is a subset of the second one, so flip the order.", + "name": "ConditionalExpression", + "pattern": "| ShortCircuitExpression -- alt1\n | ShortCircuitExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2", + "replacement": "| ShortCircuitExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2\n | ShortCircuitExpression -- alt1" + }, + { + "_comment_": "First, put move the left recursive application above the ShiftExpression. (It's not properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` to be right before the `\"in\"` terminal.", + "name": "RelationalExpression", + "pattern": "| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7", + "replacement": "| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1" + }, + { + "_comment_": "FIXME: Make sure these produce something useful.", + "name": "identifierPart", + "pattern": "| \"\" /* FIXME */ -- alt4\n | \"\" /* FIXME */ -- alt5", + "replacement": "| \"_\" -- alt4 /* FIXME */" + }, + { + "_comment_": "Move decimalLiteral to the very end.", + "name": "numericLiteral", + "pattern": " | decimalLiteral -- alt1", + "postlude": "\n | decimalLiteral -- alt1", + "replacement": "" + }, + { + "_comment_": "alt1 is strictly a subset of the following two alternatives, so put it at the end.", + "name": "PostfixExpression", + "pattern": "| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3", + "replacement": "| LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3\n | LeftHandSideExpression -- alt1" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "ModuleItemList", + "pattern": "| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1", + "replacement": "| ModuleItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleLineCommentChars", + "pattern": "| singleLineCommentChar singleLineCommentChars? -- alt1", + "replacement": "| singleLineCommentChar+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "doubleStringCharacters", + "pattern": "| doubleStringCharacter doubleStringCharacters? -- alt1", + "replacement": "| doubleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleStringCharacters", + "pattern": "| singleStringCharacter singleStringCharacters? -- alt1", + "replacement": "| singleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "templateCharacters", + "pattern": "| templateCharacter templateCharacters? -- alt1", + "replacement": "| templateCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "multiLineCommentChars", + "pattern": "| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | \"*\" postAsteriskCommentChars? -- alt2", + "replacement": "(~\"*/\" sourceCharacter)*" + } + ] +} diff --git a/examples/ecmascript/spec/es2021/spec.grammar b/examples/ecmascript/spec/es2021/spec.grammar new file mode 100644 index 00000000..d12887dc --- /dev/null +++ b/examples/ecmascript/spec/es2021/spec.grammar @@ -0,0 +1,1635 @@ +@line 12769 + +SourceCharacter :: + > any Unicode code point + +@line 12956 + +InputElementDiv :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + RightBracePunctuator + +InputElementRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + RightBracePunctuator + RegularExpressionLiteral + +InputElementRegExpOrTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + RegularExpressionLiteral + TemplateSubstitutionTail + +InputElementTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + TemplateSubstitutionTail + +@line 13164 + +WhiteSpace :: + + + + + + + + +@line 13245 + +LineTerminator :: + + + + + +LineTerminatorSequence :: + + [lookahead != ] + + + + +@line 13267 + +Comment :: + MultiLineComment + SingleLineComment + +MultiLineComment :: + `/*` MultiLineCommentChars? `*/` + +MultiLineCommentChars :: + MultiLineNotAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +PostAsteriskCommentChars :: + MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +MultiLineNotAsteriskChar :: + SourceCharacter but not `*` + +MultiLineNotForwardSlashOrAsteriskChar :: + SourceCharacter but not one of `/` or `*` + +SingleLineComment :: + `//` SingleLineCommentChars? + +SingleLineCommentChars :: + SingleLineCommentChar SingleLineCommentChars? + +SingleLineCommentChar :: + SourceCharacter but not LineTerminator + +@line 13304 + +CommonToken :: + IdentifierName + Punctuator + NumericLiteral + StringLiteral + Template + +@line 13326 + +IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + +IdentifierStart :: + UnicodeIDStart + `$` + `_` + `\` UnicodeEscapeSequence + +IdentifierPart :: + UnicodeIDContinue + `$` + `\` UnicodeEscapeSequence + + + +UnicodeIDStart :: + > any Unicode code point with the Unicode property “ID_Start” + +UnicodeIDContinue :: + > any Unicode code point with the Unicode property “ID_Continue” + +@line 13402 + +ReservedWord :: one of + `await` + `break` + `case` `catch` `class` `const` `continue` + `debugger` `default` `delete` `do` + `else` `enum` `export` `extends` + `false` `finally` `for` `function` + `if` `import` `in` `instanceof` + `new` `null` + `return` + `super` `switch` + `this` `throw` `true` `try` `typeof` + `var` `void` + `while` `with` + `yield` + +@line 13436 + +Punctuator :: + OptionalChainingPunctuator + OtherPunctuator + +OptionalChainingPunctuator :: + `?.` [lookahead ` `<=` `>=` + `==` `!=` `===` `!==` + `+` `-` `*` `%` `**` + `++` `--` + `<<` `>>` `>>>` + `&` `|` `^` + `!` `~` + `&&` `||` `??` + `?` `:` + `=` `+=` `-=` `*=` `%=` `**=` `<<=` `>>=` `>>>=` `&=` `|=` `^=` + `&&=` `||=` `??=` + `=>` + +DivPunctuator :: + `/` + `/=` + +RightBracePunctuator :: + `}` + +@line 13475 + +NullLiteral :: + `null` + +@line 13484 + +BooleanLiteral :: + `true` + `false` + +@line 13494 + +NumericLiteralSeparator :: + `_` + +NumericLiteral :: + DecimalLiteral + DecimalBigIntegerLiteral + NonDecimalIntegerLiteral[+Sep] + NonDecimalIntegerLiteral[+Sep] BigIntLiteralSuffix + +DecimalBigIntegerLiteral :: + `0` BigIntLiteralSuffix + NonZeroDigit DecimalDigits[+Sep]? BigIntLiteralSuffix + NonZeroDigit NumericLiteralSeparator DecimalDigits[+Sep] BigIntLiteralSuffix + +NonDecimalIntegerLiteral[Sep] :: + BinaryIntegerLiteral[?Sep] + OctalIntegerLiteral[?Sep] + HexIntegerLiteral[?Sep] + +BigIntLiteralSuffix :: + `n` + +DecimalLiteral :: + DecimalIntegerLiteral `.` DecimalDigits[+Sep]? ExponentPart[+Sep]? + `.` DecimalDigits[+Sep] ExponentPart[+Sep]? + DecimalIntegerLiteral ExponentPart[+Sep]? + +DecimalIntegerLiteral :: + `0` + NonZeroDigit + NonZeroDigit NumericLiteralSeparator? DecimalDigits[+Sep] + +DecimalDigits[Sep] :: + DecimalDigit + DecimalDigits[?Sep] DecimalDigit + [+Sep] DecimalDigits[+Sep] NumericLiteralSeparator DecimalDigit + +DecimalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + +NonZeroDigit :: one of + `1` `2` `3` `4` `5` `6` `7` `8` `9` + +ExponentPart[Sep] :: + ExponentIndicator SignedInteger[?Sep] + +ExponentIndicator :: one of + `e` `E` + +SignedInteger[Sep] :: + DecimalDigits[?Sep] + `+` DecimalDigits[?Sep] + `-` DecimalDigits[?Sep] + +BinaryIntegerLiteral[Sep] :: + `0b` BinaryDigits[?Sep] + `0B` BinaryDigits[?Sep] + +BinaryDigits[Sep] :: + BinaryDigit + BinaryDigits[?Sep] BinaryDigit + [+Sep] BinaryDigits[+Sep] NumericLiteralSeparator BinaryDigit + +BinaryDigit :: one of + `0` `1` + +OctalIntegerLiteral[Sep] :: + `0o` OctalDigits[?Sep] + `0O` OctalDigits[?Sep] + +OctalDigits[Sep] :: + OctalDigit + OctalDigits[?Sep] OctalDigit + [+Sep] OctalDigits[+Sep] NumericLiteralSeparator OctalDigit + +OctalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` + +HexIntegerLiteral[Sep] :: + `0x` HexDigits[?Sep] + `0X` HexDigits[?Sep] + +HexDigits[Sep] :: + HexDigit + HexDigits[?Sep] HexDigit + [+Sep] HexDigits[+Sep] NumericLiteralSeparator HexDigit + +HexDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `a` `b` `c` `d` `e` `f` `A` `B` `C` `D` `E` `F` + +@line 13808 + +StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + +DoubleStringCharacters :: + DoubleStringCharacter DoubleStringCharacters? + +SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + +DoubleStringCharacter :: + SourceCharacter but not one of `"` or `\` or LineTerminator + + + `\` EscapeSequence + LineContinuation + +SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + + + `\` EscapeSequence + LineContinuation + +LineContinuation :: + `\` LineTerminatorSequence + +EscapeSequence :: + CharacterEscapeSequence + `0` [lookahead but only if MV of |HexDigits| > 0x10FFFF] + +CodePoint :: + HexDigits[~Sep] [> but only if MV of |HexDigits| ≤ 0x10FFFF] + +@line 14570 + +IdentifierReference[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +BindingIdentifier[Yield, Await] : + Identifier + `yield` + `await` + +LabelIdentifier[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +Identifier : + IdentifierName but not ReservedWord + +@line 14742 + +PrimaryExpression[Yield, Await] : + `this` + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `)` + `(` `)` + `(` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` `...` BindingPattern[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingPattern[?Yield, ?Await] `)` + +@line 14773 + +ParenthesizedExpression[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + +@line 14810 + +Literal : + NullLiteral + BooleanLiteral + NumericLiteral + StringLiteral + +@line 14847 + +ArrayLiteral[Yield, Await] : + `[` Elision? `]` + `[` ElementList[?Yield, ?Await] `]` + `[` ElementList[?Yield, ?Await] `,` Elision? `]` + +ElementList[Yield, Await] : + Elision? AssignmentExpression[+In, ?Yield, ?Await] + Elision? SpreadElement[?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? AssignmentExpression[+In, ?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? SpreadElement[?Yield, ?Await] + +Elision : + `,` + Elision `,` + +SpreadElement[Yield, Await] : + `...` AssignmentExpression[+In, ?Yield, ?Await] + +@line 14972 + +ObjectLiteral[Yield, Await] : + `{` `}` + `{` PropertyDefinitionList[?Yield, ?Await] `}` + `{` PropertyDefinitionList[?Yield, ?Await] `,` `}` + +PropertyDefinitionList[Yield, Await] : + PropertyDefinition[?Yield, ?Await] + PropertyDefinitionList[?Yield, ?Await] `,` PropertyDefinition[?Yield, ?Await] + +PropertyDefinition[Yield, Await] : + IdentifierReference[?Yield, ?Await] + CoverInitializedName[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` AssignmentExpression[+In, ?Yield, ?Await] + MethodDefinition[?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + +PropertyName[Yield, Await] : + LiteralPropertyName + ComputedPropertyName[?Yield, ?Await] + +LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + +ComputedPropertyName[Yield, Await] : + `[` AssignmentExpression[+In, ?Yield, ?Await] `]` + +CoverInitializedName[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await] + +Initializer[In, Yield, Await] : + `=` AssignmentExpression[?In, ?Yield, ?Await] + +@line 15220 + +TemplateLiteral[Yield, Await, Tagged] : + NoSubstitutionTemplate + SubstitutionTemplate[?Yield, ?Await, ?Tagged] + +SubstitutionTemplate[Yield, Await, Tagged] : + TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await, ?Tagged] + +TemplateSpans[Yield, Await, Tagged] : + TemplateTail + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateTail + +TemplateMiddleList[Yield, Await, Tagged] : + TemplateMiddle Expression[+In, ?Yield, ?Await] + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await] + +@line 15504 + +MemberExpression[Yield, Await] : + PrimaryExpression[?Yield, ?Await] + MemberExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + MemberExpression[?Yield, ?Await] `.` IdentifierName + MemberExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + SuperProperty[?Yield, ?Await] + MetaProperty + `new` MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +SuperProperty[Yield, Await] : + `super` `[` Expression[+In, ?Yield, ?Await] `]` + `super` `.` IdentifierName + +MetaProperty : + NewTarget + ImportMeta + +NewTarget : + `new` `.` `target` + +ImportMeta : + `import` `.` `meta` + +NewExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] + `new` NewExpression[?Yield, ?Await] + +CallExpression[Yield, Await] : + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] #callcover + SuperCall[?Yield, ?Await] + ImportCall[?Yield, ?Await] + CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + CallExpression[?Yield, ?Await] `.` IdentifierName + CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + +SuperCall[Yield, Await] : + `super` Arguments[?Yield, ?Await] + +ImportCall[Yield, Await] : + `import` `(` AssignmentExpression[+In, ?Yield, ?Await] `)` + +Arguments[Yield, Await] : + `(` `)` + `(` ArgumentList[?Yield, ?Await] `)` + `(` ArgumentList[?Yield, ?Await] `,` `)` + +ArgumentList[Yield, Await] : + AssignmentExpression[+In, ?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` `...` AssignmentExpression[+In, ?Yield, ?Await] + +OptionalExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + CallExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + OptionalExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + +OptionalChain[Yield, Await] : + `?.` Arguments[?Yield, ?Await] + `?.` `[` Expression[+In, ?Yield, ?Await] `]` + `?.` IdentifierName + `?.` TemplateLiteral[?Yield, ?Await, +Tagged] + OptionalChain[?Yield, ?Await] Arguments[?Yield, ?Await] + OptionalChain[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + OptionalChain[?Yield, ?Await] `.` IdentifierName + OptionalChain[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + +LeftHandSideExpression[Yield, Await] : + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + OptionalExpression[?Yield, ?Await] + +@line 15584 + +CallMemberExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 16153 + +UpdateExpression[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++` + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--` + `++` UnaryExpression[?Yield, ?Await] + `--` UnaryExpression[?Yield, ?Await] + +@line 16255 + +UnaryExpression[Yield, Await] : + UpdateExpression[?Yield, ?Await] + `delete` UnaryExpression[?Yield, ?Await] + `void` UnaryExpression[?Yield, ?Await] + `typeof` UnaryExpression[?Yield, ?Await] + `+` UnaryExpression[?Yield, ?Await] + `-` UnaryExpression[?Yield, ?Await] + `~` UnaryExpression[?Yield, ?Await] + `!` UnaryExpression[?Yield, ?Await] + [+Await] AwaitExpression[?Yield] + +@line 16512 + +ExponentiationExpression[Yield, Await] : + UnaryExpression[?Yield, ?Await] + UpdateExpression[?Yield, ?Await] `**` ExponentiationExpression[?Yield, ?Await] + +@line 16532 + +MultiplicativeExpression[Yield, Await] : + ExponentiationExpression[?Yield, ?Await] + MultiplicativeExpression[?Yield, ?Await] MultiplicativeOperator ExponentiationExpression[?Yield, ?Await] + +MultiplicativeOperator : one of + `*` `/` `%` + +@line 16561 + +AdditiveExpression[Yield, Await] : + MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `+` MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `-` MultiplicativeExpression[?Yield, ?Await] + +@line 16602 + +ShiftExpression[Yield, Await] : + AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `<<` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>>` AdditiveExpression[?Yield, ?Await] + +@line 16662 + +RelationalExpression[In, Yield, Await] : + ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `instanceof` ShiftExpression[?Yield, ?Await] + [+In] RelationalExpression[+In, ?Yield, ?Await] `in` ShiftExpression[?Yield, ?Await] + +@line 16760 + +EqualityExpression[In, Yield, Await] : + RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `==` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!=` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `===` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!==` RelationalExpression[?In, ?Yield, ?Await] + +@line 16852 + +BitwiseANDExpression[In, Yield, Await] : + EqualityExpression[?In, ?Yield, ?Await] + BitwiseANDExpression[?In, ?Yield, ?Await] `&` EqualityExpression[?In, ?Yield, ?Await] + +BitwiseXORExpression[In, Yield, Await] : + BitwiseANDExpression[?In, ?Yield, ?Await] + BitwiseXORExpression[?In, ?Yield, ?Await] `^` BitwiseANDExpression[?In, ?Yield, ?Await] + +BitwiseORExpression[In, Yield, Await] : + BitwiseXORExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] `|` BitwiseXORExpression[?In, ?Yield, ?Await] + +@line 16886 + +LogicalANDExpression[In, Yield, Await] : + BitwiseORExpression[?In, ?Yield, ?Await] + LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await] + +LogicalORExpression[In, Yield, Await] : + LogicalANDExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await] + +CoalesceExpression[In, Yield, Await] : + CoalesceExpressionHead[?In, ?Yield, ?Await] `??` BitwiseORExpression[?In, ?Yield, ?Await] + +CoalesceExpressionHead[In, Yield, Await] : + CoalesceExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] + +ShortCircuitExpression[In, Yield, Await] : + LogicalORExpression[?In, ?Yield, ?Await] + CoalesceExpression[?In, ?Yield, ?Await] + +@line 16945 + +ConditionalExpression[In, Yield, Await] : + ShortCircuitExpression[?In, ?Yield, ?Await] + ShortCircuitExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await] + +@line 16973 + +AssignmentExpression[In, Yield, Await] : + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield] YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `&&=` AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `||=` AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `??=` AssignmentExpression[?In, ?Yield, ?Await] + +AssignmentOperator : one of + `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + +@line 17187 + +AssignmentPattern[Yield, Await] : + ObjectAssignmentPattern[?Yield, ?Await] + ArrayAssignmentPattern[?Yield, ?Await] + +ObjectAssignmentPattern[Yield, Await] : + `{` `}` + `{` AssignmentRestProperty[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `,` AssignmentRestProperty[?Yield, ?Await]? `}` + +ArrayAssignmentPattern[Yield, Await] : + `[` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + `[` AssignmentElementList[?Yield, ?Await] `]` + `[` AssignmentElementList[?Yield, ?Await] `,` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + +AssignmentRestProperty[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +AssignmentPropertyList[Yield, Await] : + AssignmentProperty[?Yield, ?Await] + AssignmentPropertyList[?Yield, ?Await] `,` AssignmentProperty[?Yield, ?Await] + +AssignmentElementList[Yield, Await] : + AssignmentElisionElement[?Yield, ?Await] + AssignmentElementList[?Yield, ?Await] `,` AssignmentElisionElement[?Yield, ?Await] + +AssignmentElisionElement[Yield, Await] : + Elision? AssignmentElement[?Yield, ?Await] + +AssignmentProperty[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + PropertyName[?Yield, ?Await] `:` AssignmentElement[?Yield, ?Await] + +AssignmentElement[Yield, Await] : + DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +AssignmentRestElement[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +DestructuringAssignmentTarget[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + +@line 17519 + +Expression[In, Yield, Await] : + AssignmentExpression[?In, ?Yield, ?Await] + Expression[?In, ?Yield, ?Await] `,` AssignmentExpression[?In, ?Yield, ?Await] + +@line 17544 + +Statement[Yield, Await, Return] : + BlockStatement[?Yield, ?Await, ?Return] + VariableStatement[?Yield, ?Await] + EmptyStatement + ExpressionStatement[?Yield, ?Await] + IfStatement[?Yield, ?Await, ?Return] + BreakableStatement[?Yield, ?Await, ?Return] + ContinueStatement[?Yield, ?Await] + BreakStatement[?Yield, ?Await] + [+Return] ReturnStatement[?Yield, ?Await] + WithStatement[?Yield, ?Await, ?Return] + LabelledStatement[?Yield, ?Await, ?Return] + ThrowStatement[?Yield, ?Await] + TryStatement[?Yield, ?Await, ?Return] + DebuggerStatement + +Declaration[Yield, Await] : + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + +HoistableDeclaration[Yield, Await, Default] : + FunctionDeclaration[?Yield, ?Await, ?Default] + GeneratorDeclaration[?Yield, ?Await, ?Default] + AsyncFunctionDeclaration[?Yield, ?Await, ?Default] + AsyncGeneratorDeclaration[?Yield, ?Await, ?Default] + +BreakableStatement[Yield, Await, Return] : + IterationStatement[?Yield, ?Await, ?Return] + SwitchStatement[?Yield, ?Await, ?Return] + +@line 17612 + +BlockStatement[Yield, Await, Return] : + Block[?Yield, ?Await, ?Return] + +Block[Yield, Await, Return] : + `{` StatementList[?Yield, ?Await, ?Return]? `}` + +StatementList[Yield, Await, Return] : + StatementListItem[?Yield, ?Await, ?Return] + StatementList[?Yield, ?Await, ?Return] StatementListItem[?Yield, ?Await, ?Return] + +StatementListItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + Declaration[?Yield, ?Await] + +@line 17714 + +LexicalDeclaration[In, Yield, Await] : + LetOrConst BindingList[?In, ?Yield, ?Await] `;` + +LetOrConst : + `let` + `const` + +BindingList[In, Yield, Await] : + LexicalBinding[?In, ?Yield, ?Await] + BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await] + +LexicalBinding[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 17799 + +VariableStatement[Yield, Await] : + `var` VariableDeclarationList[+In, ?Yield, ?Await] `;` + +VariableDeclarationList[In, Yield, Await] : + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] `,` VariableDeclaration[?In, ?Yield, ?Await] + +VariableDeclaration[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 17856 + +BindingPattern[Yield, Await] : + ObjectBindingPattern[?Yield, ?Await] + ArrayBindingPattern[?Yield, ?Await] + +ObjectBindingPattern[Yield, Await] : + `{` `}` + `{` BindingRestProperty[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `,` BindingRestProperty[?Yield, ?Await]? `}` + +ArrayBindingPattern[Yield, Await] : + `[` Elision? BindingRestElement[?Yield, ?Await]? `]` + `[` BindingElementList[?Yield, ?Await] `]` + `[` BindingElementList[?Yield, ?Await] `,` Elision? BindingRestElement[?Yield, ?Await]? `]` + +BindingRestProperty[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + +BindingPropertyList[Yield, Await] : + BindingProperty[?Yield, ?Await] + BindingPropertyList[?Yield, ?Await] `,` BindingProperty[?Yield, ?Await] + +BindingElementList[Yield, Await] : + BindingElisionElement[?Yield, ?Await] + BindingElementList[?Yield, ?Await] `,` BindingElisionElement[?Yield, ?Await] + +BindingElisionElement[Yield, Await] : + Elision? BindingElement[?Yield, ?Await] + +BindingProperty[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` BindingElement[?Yield, ?Await] + +BindingElement[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + BindingPattern[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +SingleNameBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +BindingRestElement[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + `...` BindingPattern[?Yield, ?Await] + +@line 17981 + +EmptyStatement : + `;` + +@line 17998 + +ExpressionStatement[Yield, Await] : + [lookahead ` ConciseBody[?In] + +ArrowParameters[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +ConciseBody[In] : + [lookahead != `{`] ExpressionBody[?In, ~Await] + `{` FunctionBody[~Yield, ~Await] `}` + +ExpressionBody[In, Await] : + AssignmentExpression[?In, ~Yield, ?Await] + +@line 19834 + +ArrowFormalParameters[Yield, Await] : + `(` UniqueFormalParameters[?Yield, ?Await] `)` + +@line 19946 + +MethodDefinition[Yield, Await] : + PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + GeneratorMethod[?Yield, ?Await] + AsyncMethod[?Yield, ?Await] + AsyncGeneratorMethod[?Yield, ?Await] + `get` PropertyName[?Yield, ?Await] `(` `)` `{` FunctionBody[~Yield, ~Await] `}` + `set` PropertyName[?Yield, ?Await] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield, ~Await] `}` + +PropertySetParameterList : + FormalParameter[~Yield, ~Await] + +@line 20142 + +GeneratorMethod[Yield, Await] : + `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorDeclaration[Yield, Await, Default] : + `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorExpression : + `function` `*` BindingIdentifier[+Yield, ~Await]? `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorBody : + FunctionBody[+Yield, ~Await] + +YieldExpression[In, Await] : + `yield` + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await] + +@line 20378 + +AsyncGeneratorMethod[Yield, Await] : + `async` [no LineTerminator here] `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + [+Default] `async` [no LineTerminator here] `function` `*` `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorExpression : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[+Yield, +Await]? `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorBody : + FunctionBody[+Yield, +Await] + +@line 20529 + +ClassDeclaration[Yield, Await, Default] : + `class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] `class` ClassTail[?Yield, ?Await] + +ClassExpression[Yield, Await] : + `class` BindingIdentifier[?Yield, ?Await]? ClassTail[?Yield, ?Await] + +ClassTail[Yield, Await] : + ClassHeritage[?Yield, ?Await]? `{` ClassBody[?Yield, ?Await]? `}` + +ClassHeritage[Yield, Await] : + `extends` LeftHandSideExpression[?Yield, ?Await] + +ClassBody[Yield, Await] : + ClassElementList[?Yield, ?Await] + +ClassElementList[Yield, Await] : + ClassElement[?Yield, ?Await] + ClassElementList[?Yield, ?Await] ClassElement[?Yield, ?Await] + +ClassElement[Yield, Await] : + MethodDefinition[?Yield, ?Await] + `static` MethodDefinition[?Yield, ?Await] + `;` + +@line 20811 + +AsyncFunctionDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + [+Default] `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionExpression : + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await]? `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncMethod[Yield, Await] : + `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionBody : + FunctionBody[~Yield, +Await] + +AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] + +@line 20988 + +AsyncArrowFunction[In, Yield, Await] : + `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + +AsyncConciseBody[In] : + [lookahead != `{`] ExpressionBody[?In, +Await] + `{` AsyncFunctionBody `}` + +AsyncArrowBindingIdentifier[Yield] : + BindingIdentifier[?Yield, +Await] + +CoverCallExpressionAndAsyncArrowHead[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 21010 + +AsyncArrowHead : + `async` [no LineTerminator here] ArrowFormalParameters[~Yield, +Await] + +@line 21482 + +Script : + ScriptBody? + +ScriptBody : + StatementList[~Yield, ~Await, ~Return] + +@line 21721 + +Module : + ModuleBody? + +ModuleBody : + ModuleItemList + +ModuleItemList : + ModuleItem + ModuleItemList ModuleItem + +ModuleItem : + ImportDeclaration + ExportDeclaration + StatementListItem[~Yield, ~Await, ~Return] + +@line 23069 + +ImportDeclaration : + `import` ImportClause FromClause `;` + `import` ModuleSpecifier `;` + +ImportClause : + ImportedDefaultBinding + NameSpaceImport + NamedImports + ImportedDefaultBinding `,` NameSpaceImport + ImportedDefaultBinding `,` NamedImports + +ImportedDefaultBinding : + ImportedBinding + +NameSpaceImport : + `*` `as` ImportedBinding + +NamedImports : + `{` `}` + `{` ImportsList `}` + `{` ImportsList `,` `}` + +FromClause : + `from` ModuleSpecifier + +ImportsList : + ImportSpecifier + ImportsList `,` ImportSpecifier + +ImportSpecifier : + ImportedBinding + IdentifierName `as` ImportedBinding + +ModuleSpecifier : + StringLiteral + +ImportedBinding : + BindingIdentifier[~Yield, ~Await] + +@line 23207 + +ExportDeclaration : + `export` ExportFromClause FromClause `;` + `export` NamedExports `;` + `export` VariableStatement[~Yield, ~Await] + `export` Declaration[~Yield, ~Await] + `export` `default` HoistableDeclaration[~Yield, ~Await, +Default] + `export` `default` ClassDeclaration[~Yield, ~Await, +Default] + `export` `default` [lookahead ` + +RegExpIdentifierName[U] :: + RegExpIdentifierStart[?U] + RegExpIdentifierName[?U] RegExpIdentifierPart[?U] + +RegExpIdentifierStart[U] :: + UnicodeIDStart + `$` + `_` + `\` RegExpUnicodeEscapeSequence[+U] + [~U] UnicodeLeadSurrogate UnicodeTrailSurrogate + +RegExpIdentifierPart[U] :: + UnicodeIDContinue + `$` + `\` RegExpUnicodeEscapeSequence[+U] + [~U] UnicodeLeadSurrogate UnicodeTrailSurrogate + + + +RegExpUnicodeEscapeSequence[U] :: + [+U] `u` HexLeadSurrogate `\u` HexTrailSurrogate + [+U] `u` HexLeadSurrogate + [+U] `u` HexTrailSurrogate + [+U] `u` HexNonSurrogate + [~U] `u` Hex4Digits + [+U] `u{` CodePoint `}` + +UnicodeLeadSurrogate :: + > any Unicode code point in the inclusive range 0xD800 to 0xDBFF + +UnicodeTrailSurrogate :: + > any Unicode code point in the inclusive range 0xDC00 to 0xDFFF + +@line 29509 + +HexLeadSurrogate :: + Hex4Digits [> but only if the MV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF] + +HexTrailSurrogate :: + Hex4Digits [> but only if the MV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF] + +HexNonSurrogate :: + Hex4Digits [> but only if the MV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] + +IdentityEscape[U] :: + [+U] SyntaxCharacter + [+U] `/` + [~U] SourceCharacter but not UnicodeIDContinue + +DecimalEscape :: + NonZeroDigit DecimalDigits[~Sep]? [lookahead \n | CallExpression", + "replacement": "| CallExpression\n | NewExpression" + }, + { + "_comment_": "MethodDefinition must come before IdentifierReference.", + "name": "PropertyDefinition", + "pattern": "| IdentifierReference -- alt1\n | CoverInitializedName -- alt2\n | PropertyName \":\" AssignmentExpression -- alt3\n | MethodDefinition -- alt4\n | \"...\" AssignmentExpression -- alt5", + "replacement": "| \"...\" AssignmentExpression -- alt5\n | MethodDefinition -- alt4\n | PropertyName \":\" AssignmentExpression -- alt3\n | IdentifierReference -- alt1\n | CoverInitializedName -- alt2" + }, + { + "_comment_": "Need this rather than `#sc` so that EmptyStatement is not nullable.", + "name": "EmptyStatement", + "override": "\";\" // note: this semicolon eats newlines" + }, + { + "_comment_": "ArrowFunction must come before ConditionalExpression, because the arrow function parameters will parse as a parenthesized expression. Both LeftHandSideExpression alternatives must also come before ConditionalExpression.", + "name": "AssignmentExpression", + "pattern": "| ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2\n | ArrowFunction -- alt3\n | AsyncArrowFunction -- alt4\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6", + "replacement": "| AsyncArrowFunction -- alt4\n | ArrowFunction -- alt3\n | LeftHandSideExpression \"=\" AssignmentExpression -- alt5\n | LeftHandSideExpression AssignmentOperator AssignmentExpression -- alt6\n | ConditionalExpression -- alt1\n | guardYield YieldExpression -- alt2" + }, + { + "name": "FormalParameters", + "pattern": "| /* empty */ -- alt1\n | FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5", + "replacement": "| FunctionRestParameter -- alt2\n | FormalParameterList -- alt3\n | FormalParameterList \",\" -- alt4\n | FormalParameterList \",\" FunctionRestParameter -- alt5\n | /* empty */ -- alt1" + }, + { + "_comment_": "The recursive MemberExpression application must come before PrimaryExpression.", + "name": "MemberExpression", + "pattern": "| PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6\n | new MemberExpression Arguments -- alt7", + "replacement": "| new MemberExpression Arguments -- alt7\n | PrimaryExpression -- alt1\n | SuperProperty -- alt5\n | MetaProperty -- alt6" + }, + { + "_comment_": "Move PostfixExpression to the very end.", + "name": "UnaryExpression", + "pattern": " | UpdateExpression -- alt1\n", + "postlude": "\n | UpdateExpression -- alt1", + "replacement": "" + }, + { + "_comment_": "The first alternative is a subset of the second one, so flip the order.", + "name": "ConditionalExpression", + "pattern": "| ShortCircuitExpression -- alt1\n | ShortCircuitExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2", + "replacement": "| ShortCircuitExpression \"?\" AssignmentExpression \":\" AssignmentExpression -- alt2\n | ShortCircuitExpression -- alt1" + }, + { + "_comment_": "First, put move the left recursive application above the ShiftExpression. (It's not properly recognized as left recursive due to the `guardIn`. Then, move the `guardIn` to be right before the `\"in\"` terminal.", + "name": "RelationalExpression", + "pattern": "| ShiftExpression -- alt1\n | guardIn RelationalExpression in ShiftExpression -- alt7", + "replacement": "| RelationalExpression guardIn in ShiftExpression -- alt7\n | ShiftExpression -- alt1" + }, + { + "_comment_": "FIXME: Make sure these produce something useful.", + "name": "identifierPart", + "pattern": "| identifierPartChar -- alt1\n | \"\\\\\" unicodeEscapeSequence -- alt2", + "replacement": "| \"\\\\\" unicodeEscapeSequence -- alt2\n | identifierPartChar -- alt1" + }, + { + "_comment_": "Move decimalLiteral to the very end.", + "name": "numericLiteral", + "pattern": " | decimalLiteral -- alt1", + "postlude": "\n | decimalLiteral -- alt1", + "replacement": "" + }, + { + "_comment_": "alt1 is strictly a subset of the following two alternatives, so put it at the end.", + "name": "PostfixExpression", + "pattern": "| LeftHandSideExpression -- alt1\n | LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3", + "replacement": "| LeftHandSideExpression ~lineTerminator \"++\" -- alt2\n | LeftHandSideExpression ~lineTerminator \"--\" -- alt3\n | LeftHandSideExpression -- alt1" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "StatementList", + "pattern": "| StatementList StatementListItem -- alt2\n | StatementListItem -- alt1", + "replacement": "| StatementListItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "ModuleItemList", + "pattern": "| ModuleItemList ModuleItem -- alt2\n | ModuleItem -- alt1", + "replacement": "| ModuleItem+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleLineCommentChars", + "pattern": "| singleLineCommentChar singleLineCommentChars? -- alt1", + "replacement": "| singleLineCommentChar+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "doubleStringCharacters", + "pattern": "| doubleStringCharacter doubleStringCharacters? -- alt1", + "replacement": "| doubleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "singleStringCharacters", + "pattern": "| singleStringCharacter singleStringCharacters? -- alt1", + "replacement": "| singleStringCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "templateCharacters", + "pattern": "| templateCharacter templateCharacters? -- alt1", + "replacement": "| templateCharacter+" + }, + { + "_comment_": "Change from recursive to iterative.", + "name": "multiLineCommentChars", + "pattern": "| multiLineNotAsteriskChar multiLineCommentChars? -- alt1\n | \"*\" postAsteriskCommentChars? -- alt2", + "replacement": "(~\"*/\" sourceCharacter)*" + } + ] +} diff --git a/examples/ecmascript/spec/es2022/spec.grammar b/examples/ecmascript/spec/es2022/spec.grammar new file mode 100644 index 00000000..e20f49ef --- /dev/null +++ b/examples/ecmascript/spec/es2022/spec.grammar @@ -0,0 +1,1716 @@ +@line 15814 + +SourceCharacter :: + > any Unicode code point + +@line 16042 + +InputElementDiv :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + RightBracePunctuator + +InputElementRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + RightBracePunctuator + RegularExpressionLiteral + +InputElementRegExpOrTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + RegularExpressionLiteral + TemplateSubstitutionTail + +InputElementTemplateTail :: + WhiteSpace + LineTerminator + Comment + CommonToken + DivPunctuator + TemplateSubstitutionTail + +@line 16226 + +WhiteSpace :: + + + + + + +@line 16303 + +LineTerminator :: + + + + + +LineTerminatorSequence :: + + [lookahead != ] + + + + +@line 16325 + +Comment :: + MultiLineComment + SingleLineComment + +MultiLineComment :: + `/*` MultiLineCommentChars? `*/` + +MultiLineCommentChars :: + MultiLineNotAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +PostAsteriskCommentChars :: + MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentChars? + `*` PostAsteriskCommentChars? + +MultiLineNotAsteriskChar :: + SourceCharacter but not `*` + +MultiLineNotForwardSlashOrAsteriskChar :: + SourceCharacter but not one of `/` or `*` + +SingleLineComment :: + `//` SingleLineCommentChars? + +SingleLineCommentChars :: + SingleLineCommentChar SingleLineCommentChars? + +SingleLineCommentChar :: + SourceCharacter but not LineTerminator + +@line 16362 + +CommonToken :: + IdentifierName + PrivateIdentifier + Punctuator + NumericLiteral + StringLiteral + Template + +@line 16383 + +PrivateIdentifier :: + `#` IdentifierName + +IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + +IdentifierStart :: + IdentifierStartChar + `\` UnicodeEscapeSequence + +IdentifierPart :: + IdentifierPartChar + `\` UnicodeEscapeSequence + +IdentifierStartChar :: + UnicodeIDStart + `$` + `_` + +IdentifierPartChar :: + UnicodeIDContinue + `$` + + + +UnicodeIDStart :: + > any Unicode code point with the Unicode property “ID_Start” + +UnicodeIDContinue :: + > any Unicode code point with the Unicode property “ID_Continue” + +@line 16509 + +// emu-format ignore +ReservedWord :: one of + `await` + `break` + `case` `catch` `class` `const` `continue` + `debugger` `default` `delete` `do` + `else` `enum` `export` `extends` + `false` `finally` `for` `function` + `if` `import` `in` `instanceof` + `new` `null` + `return` + `super` `switch` + `this` `throw` `true` `try` `typeof` + `var` `void` + `while` `with` + `yield` + +@line 16544 + +Punctuator :: + OptionalChainingPunctuator + OtherPunctuator + +OptionalChainingPunctuator :: + `?.` [lookahead ∉ DecimalDigit] + +// emu-format ignore +OtherPunctuator :: one of + `{` `(` `)` `[` `]` + `.` `...` `;` `,` + `<` `>` `<=` `>=` + `==` `!=` `===` `!==` + `+` `-` `*` `%` `**` + `++` `--` + `<<` `>>` `>>>` + `&` `|` `^` + `!` `~` + `&&` `||` `??` + `?` `:` + `=` `+=` `-=` `*=` `%=` `**=` `<<=` `>>=` `>>>=` `&=` `|=` `^=` + `&&=` `||=` `??=` + `=>` + +DivPunctuator :: + `/` + `/=` + +RightBracePunctuator :: + `}` + +@line 16584 + +NullLiteral :: + `null` + +@line 16593 + +BooleanLiteral :: + `true` + `false` + +@line 16603 + +NumericLiteralSeparator :: + `_` + +NumericLiteral :: + DecimalLiteral + DecimalBigIntegerLiteral + NonDecimalIntegerLiteral[+Sep] + NonDecimalIntegerLiteral[+Sep] BigIntLiteralSuffix + LegacyOctalIntegerLiteral + +DecimalBigIntegerLiteral :: + `0` BigIntLiteralSuffix + NonZeroDigit DecimalDigits[+Sep]? BigIntLiteralSuffix + NonZeroDigit NumericLiteralSeparator DecimalDigits[+Sep] BigIntLiteralSuffix + +NonDecimalIntegerLiteral[Sep] :: + BinaryIntegerLiteral[?Sep] + OctalIntegerLiteral[?Sep] + HexIntegerLiteral[?Sep] + +BigIntLiteralSuffix :: + `n` + +DecimalLiteral :: + DecimalIntegerLiteral `.` DecimalDigits[+Sep]? ExponentPart[+Sep]? + `.` DecimalDigits[+Sep] ExponentPart[+Sep]? + DecimalIntegerLiteral ExponentPart[+Sep]? + +DecimalIntegerLiteral :: + `0` + NonZeroDigit + NonZeroDigit NumericLiteralSeparator? DecimalDigits[+Sep] + NonOctalDecimalIntegerLiteral + +DecimalDigits[Sep] :: + DecimalDigit + DecimalDigits[?Sep] DecimalDigit + [+Sep] DecimalDigits[+Sep] NumericLiteralSeparator DecimalDigit + +DecimalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + +NonZeroDigit :: one of + `1` `2` `3` `4` `5` `6` `7` `8` `9` + +ExponentPart[Sep] :: + ExponentIndicator SignedInteger[?Sep] + +ExponentIndicator :: one of + `e` `E` + +SignedInteger[Sep] :: + DecimalDigits[?Sep] + `+` DecimalDigits[?Sep] + `-` DecimalDigits[?Sep] + +BinaryIntegerLiteral[Sep] :: + `0b` BinaryDigits[?Sep] + `0B` BinaryDigits[?Sep] + +BinaryDigits[Sep] :: + BinaryDigit + BinaryDigits[?Sep] BinaryDigit + [+Sep] BinaryDigits[+Sep] NumericLiteralSeparator BinaryDigit + +BinaryDigit :: one of + `0` `1` + +OctalIntegerLiteral[Sep] :: + `0o` OctalDigits[?Sep] + `0O` OctalDigits[?Sep] + +OctalDigits[Sep] :: + OctalDigit + OctalDigits[?Sep] OctalDigit + [+Sep] OctalDigits[+Sep] NumericLiteralSeparator OctalDigit + +LegacyOctalIntegerLiteral :: + `0` OctalDigit + LegacyOctalIntegerLiteral OctalDigit + +NonOctalDecimalIntegerLiteral :: + `0` NonOctalDigit + LegacyOctalLikeDecimalIntegerLiteral NonOctalDigit + NonOctalDecimalIntegerLiteral DecimalDigit + +LegacyOctalLikeDecimalIntegerLiteral :: + `0` OctalDigit + LegacyOctalLikeDecimalIntegerLiteral OctalDigit + +OctalDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` + +NonOctalDigit :: one of + `8` `9` + +HexIntegerLiteral[Sep] :: + `0x` HexDigits[?Sep] + `0X` HexDigits[?Sep] + +HexDigits[Sep] :: + HexDigit + HexDigits[?Sep] HexDigit + [+Sep] HexDigits[+Sep] NumericLiteralSeparator HexDigit + +// emu-format ignore +HexDigit :: one of + `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `a` `b` `c` `d` `e` `f` `A` `B` `C` `D` `E` `F` + +@line 16899 + +StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + +DoubleStringCharacters :: + DoubleStringCharacter DoubleStringCharacters? + +SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + +DoubleStringCharacter :: + SourceCharacter but not one of `"` or `\` or LineTerminator + + + `\` EscapeSequence + LineContinuation + +SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + + + `\` EscapeSequence + LineContinuation + +LineContinuation :: + `\` LineTerminatorSequence + +EscapeSequence :: + CharacterEscapeSequence + `0` [lookahead ∉ DecimalDigit] + LegacyOctalEscapeSequence + NonOctalDecimalEscapeSequence + HexEscapeSequence + UnicodeEscapeSequence + +CharacterEscapeSequence :: + SingleEscapeCharacter + NonEscapeCharacter + +SingleEscapeCharacter :: one of + `'` `"` `\` `b` `f` `n` `r` `t` `v` + +NonEscapeCharacter :: + SourceCharacter but not one of EscapeCharacter or LineTerminator + +EscapeCharacter :: + SingleEscapeCharacter + DecimalDigit + `x` + `u` + +LegacyOctalEscapeSequence :: + `0` [lookahead ∈ { `8`, `9` }] + NonZeroOctalDigit [lookahead ∉ OctalDigit] + ZeroToThree OctalDigit [lookahead ∉ OctalDigit] + FourToSeven OctalDigit + ZeroToThree OctalDigit OctalDigit + +NonZeroOctalDigit :: + OctalDigit but not `0` + +ZeroToThree :: one of + `0` `1` `2` `3` + +FourToSeven :: one of + `4` `5` `6` `7` + +NonOctalDecimalEscapeSequence :: one of + `8` `9` + +HexEscapeSequence :: + `x` HexDigit HexDigit + +UnicodeEscapeSequence :: + `u` Hex4Digits + `u{` CodePoint `}` + +Hex4Digits :: + HexDigit HexDigit HexDigit HexDigit + +@line 17282 + +RegularExpressionLiteral :: + `/` RegularExpressionBody `/` RegularExpressionFlags + +RegularExpressionBody :: + RegularExpressionFirstChar RegularExpressionChars + +RegularExpressionChars :: + [empty] + RegularExpressionChars RegularExpressionChar + +RegularExpressionFirstChar :: + RegularExpressionNonTerminator but not one of `*` or `\` or `/` or `[` + RegularExpressionBackslashSequence + RegularExpressionClass + +RegularExpressionChar :: + RegularExpressionNonTerminator but not one of `\` or `/` or `[` + RegularExpressionBackslashSequence + RegularExpressionClass + +RegularExpressionBackslashSequence :: + `\` RegularExpressionNonTerminator + +RegularExpressionNonTerminator :: + SourceCharacter but not LineTerminator + +RegularExpressionClass :: + `[` RegularExpressionClassChars `]` + +RegularExpressionClassChars :: + [empty] + RegularExpressionClassChars RegularExpressionClassChar + +RegularExpressionClassChar :: + RegularExpressionNonTerminator but not one of `]` or `\` + RegularExpressionBackslashSequence + +RegularExpressionFlags :: + [empty] + RegularExpressionFlags IdentifierPartChar + +@line 17352 + +Template :: + NoSubstitutionTemplate + TemplateHead + +NoSubstitutionTemplate :: + ``` TemplateCharacters? ``` + +TemplateHead :: + ``` TemplateCharacters? `${` + +TemplateSubstitutionTail :: + TemplateMiddle + TemplateTail + +TemplateMiddle :: + `}` TemplateCharacters? `${` + +TemplateTail :: + `}` TemplateCharacters? ``` + +TemplateCharacters :: + TemplateCharacter TemplateCharacters? + +TemplateCharacter :: + `$` [lookahead != `{`] + `\` TemplateEscapeSequence + `\` NotEscapeSequence + LineContinuation + LineTerminatorSequence + SourceCharacter but not one of ``` or `\` or `$` or LineTerminator + +TemplateEscapeSequence :: + CharacterEscapeSequence + `0` [lookahead ∉ DecimalDigit] + HexEscapeSequence + UnicodeEscapeSequence + +NotEscapeSequence :: + `0` DecimalDigit + DecimalDigit but not `0` + `x` [lookahead ∉ HexDigit] + `x` HexDigit [lookahead ∉ HexDigit] + `u` [lookahead ∉ HexDigit] [lookahead != `{`] + `u` HexDigit [lookahead ∉ HexDigit] + `u` HexDigit HexDigit [lookahead ∉ HexDigit] + `u` HexDigit HexDigit HexDigit [lookahead ∉ HexDigit] + `u` `{` [lookahead ∉ HexDigit] + `u` `{` NotCodePoint [lookahead ∉ HexDigit] + `u` `{` CodePoint [lookahead ∉ HexDigit] [lookahead != `}`] + +NotCodePoint :: + HexDigits[~Sep] [> but only if MV of |HexDigits| > 0x10FFFF] + +CodePoint :: + HexDigits[~Sep] [> but only if MV of |HexDigits| ≤ 0x10FFFF] + +@line 17817 + +IdentifierReference[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +BindingIdentifier[Yield, Await] : + Identifier + `yield` + `await` + +LabelIdentifier[Yield, Await] : + Identifier + [~Yield] `yield` + [~Await] `await` + +Identifier : + IdentifierName but not ReservedWord + +@line 18003 + +PrimaryExpression[Yield, Await] : + `this` + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `)` + `(` `)` + `(` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` `...` BindingPattern[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingPattern[?Yield, ?Await] `)` + +@line 18034 + +ParenthesizedExpression[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + +@line 18059 + +Literal : + NullLiteral + BooleanLiteral + NumericLiteral + StringLiteral + +@line 18096 + +ArrayLiteral[Yield, Await] : + `[` Elision? `]` + `[` ElementList[?Yield, ?Await] `]` + `[` ElementList[?Yield, ?Await] `,` Elision? `]` + +ElementList[Yield, Await] : + Elision? AssignmentExpression[+In, ?Yield, ?Await] + Elision? SpreadElement[?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? AssignmentExpression[+In, ?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? SpreadElement[?Yield, ?Await] + +Elision : + `,` + Elision `,` + +SpreadElement[Yield, Await] : + `...` AssignmentExpression[+In, ?Yield, ?Await] + +@line 18217 + +ObjectLiteral[Yield, Await] : + `{` `}` + `{` PropertyDefinitionList[?Yield, ?Await] `}` + `{` PropertyDefinitionList[?Yield, ?Await] `,` `}` + +PropertyDefinitionList[Yield, Await] : + PropertyDefinition[?Yield, ?Await] + PropertyDefinitionList[?Yield, ?Await] `,` PropertyDefinition[?Yield, ?Await] + +PropertyDefinition[Yield, Await] : + IdentifierReference[?Yield, ?Await] + CoverInitializedName[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` AssignmentExpression[+In, ?Yield, ?Await] + MethodDefinition[?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + +PropertyName[Yield, Await] : + LiteralPropertyName + ComputedPropertyName[?Yield, ?Await] + +LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + +ComputedPropertyName[Yield, Await] : + `[` AssignmentExpression[+In, ?Yield, ?Await] `]` + +CoverInitializedName[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await] + +Initializer[In, Yield, Await] : + `=` AssignmentExpression[?In, ?Yield, ?Await] + +@line 18487 + +TemplateLiteral[Yield, Await, Tagged] : + NoSubstitutionTemplate + SubstitutionTemplate[?Yield, ?Await, ?Tagged] + +SubstitutionTemplate[Yield, Await, Tagged] : + TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await, ?Tagged] + +TemplateSpans[Yield, Await, Tagged] : + TemplateTail + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateTail + +TemplateMiddleList[Yield, Await, Tagged] : + TemplateMiddle Expression[+In, ?Yield, ?Await] + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await] + +@line 18778 + +MemberExpression[Yield, Await] : + PrimaryExpression[?Yield, ?Await] + MemberExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + MemberExpression[?Yield, ?Await] `.` IdentifierName + MemberExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + SuperProperty[?Yield, ?Await] + MetaProperty + `new` MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + MemberExpression[?Yield, ?Await] `.` PrivateIdentifier + +SuperProperty[Yield, Await] : + `super` `[` Expression[+In, ?Yield, ?Await] `]` + `super` `.` IdentifierName + +MetaProperty : + NewTarget + ImportMeta + +NewTarget : + `new` `.` `target` + +ImportMeta : + `import` `.` `meta` + +NewExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] + `new` NewExpression[?Yield, ?Await] + +CallExpression[Yield, Await] : + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] #callcover + SuperCall[?Yield, ?Await] + ImportCall[?Yield, ?Await] + CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + CallExpression[?Yield, ?Await] `.` IdentifierName + CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + CallExpression[?Yield, ?Await] `.` PrivateIdentifier + +SuperCall[Yield, Await] : + `super` Arguments[?Yield, ?Await] + +ImportCall[Yield, Await] : + `import` `(` AssignmentExpression[+In, ?Yield, ?Await] `)` + +Arguments[Yield, Await] : + `(` `)` + `(` ArgumentList[?Yield, ?Await] `)` + `(` ArgumentList[?Yield, ?Await] `,` `)` + +ArgumentList[Yield, Await] : + AssignmentExpression[+In, ?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` `...` AssignmentExpression[+In, ?Yield, ?Await] + +OptionalExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + CallExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + OptionalExpression[?Yield, ?Await] OptionalChain[?Yield, ?Await] + +OptionalChain[Yield, Await] : + `?.` Arguments[?Yield, ?Await] + `?.` `[` Expression[+In, ?Yield, ?Await] `]` + `?.` IdentifierName + `?.` TemplateLiteral[?Yield, ?Await, +Tagged] + `?.` PrivateIdentifier + OptionalChain[?Yield, ?Await] Arguments[?Yield, ?Await] + OptionalChain[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + OptionalChain[?Yield, ?Await] `.` IdentifierName + OptionalChain[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + OptionalChain[?Yield, ?Await] `.` PrivateIdentifier + +LeftHandSideExpression[Yield, Await] : + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + OptionalExpression[?Yield, ?Await] + +@line 18862 + +CallMemberExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 19500 + +UpdateExpression[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++` + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--` + `++` UnaryExpression[?Yield, ?Await] + `--` UnaryExpression[?Yield, ?Await] + +@line 19618 + +UnaryExpression[Yield, Await] : + UpdateExpression[?Yield, ?Await] + `delete` UnaryExpression[?Yield, ?Await] + `void` UnaryExpression[?Yield, ?Await] + `typeof` UnaryExpression[?Yield, ?Await] + `+` UnaryExpression[?Yield, ?Await] + `-` UnaryExpression[?Yield, ?Await] + `~` UnaryExpression[?Yield, ?Await] + `!` UnaryExpression[?Yield, ?Await] + [+Await] AwaitExpression[?Yield] + +@line 19883 + +ExponentiationExpression[Yield, Await] : + UnaryExpression[?Yield, ?Await] + UpdateExpression[?Yield, ?Await] `**` ExponentiationExpression[?Yield, ?Await] + +@line 19903 + +MultiplicativeExpression[Yield, Await] : + ExponentiationExpression[?Yield, ?Await] + MultiplicativeExpression[?Yield, ?Await] MultiplicativeOperator ExponentiationExpression[?Yield, ?Await] + +MultiplicativeOperator : one of + `*` `/` `%` + +@line 19932 + +AdditiveExpression[Yield, Await] : + MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `+` MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `-` MultiplicativeExpression[?Yield, ?Await] + +@line 19973 + +ShiftExpression[Yield, Await] : + AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `<<` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>>` AdditiveExpression[?Yield, ?Await] + +@line 20033 + +RelationalExpression[In, Yield, Await] : + ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `instanceof` ShiftExpression[?Yield, ?Await] + [+In] RelationalExpression[+In, ?Yield, ?Await] `in` ShiftExpression[?Yield, ?Await] + [+In] PrivateIdentifier `in` ShiftExpression[?Yield, ?Await] + +@line 20147 + +EqualityExpression[In, Yield, Await] : + RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `==` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!=` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `===` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!==` RelationalExpression[?In, ?Yield, ?Await] + +@line 20237 + +BitwiseANDExpression[In, Yield, Await] : + EqualityExpression[?In, ?Yield, ?Await] + BitwiseANDExpression[?In, ?Yield, ?Await] `&` EqualityExpression[?In, ?Yield, ?Await] + +BitwiseXORExpression[In, Yield, Await] : + BitwiseANDExpression[?In, ?Yield, ?Await] + BitwiseXORExpression[?In, ?Yield, ?Await] `^` BitwiseANDExpression[?In, ?Yield, ?Await] + +BitwiseORExpression[In, Yield, Await] : + BitwiseXORExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] `|` BitwiseXORExpression[?In, ?Yield, ?Await] + +@line 20271 + +LogicalANDExpression[In, Yield, Await] : + BitwiseORExpression[?In, ?Yield, ?Await] + LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await] + +LogicalORExpression[In, Yield, Await] : + LogicalANDExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await] + +CoalesceExpression[In, Yield, Await] : + CoalesceExpressionHead[?In, ?Yield, ?Await] `??` BitwiseORExpression[?In, ?Yield, ?Await] + +CoalesceExpressionHead[In, Yield, Await] : + CoalesceExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] + +ShortCircuitExpression[In, Yield, Await] : + LogicalORExpression[?In, ?Yield, ?Await] + CoalesceExpression[?In, ?Yield, ?Await] + +@line 20330 + +ConditionalExpression[In, Yield, Await] : + ShortCircuitExpression[?In, ?Yield, ?Await] + ShortCircuitExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await] + +@line 20358 + +AssignmentExpression[In, Yield, Await] : + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield] YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `&&=` AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `||=` AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `??=` AssignmentExpression[?In, ?Yield, ?Await] + +// emu-format ignore +AssignmentOperator : one of + `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + +@line 20593 + +AssignmentPattern[Yield, Await] : + ObjectAssignmentPattern[?Yield, ?Await] + ArrayAssignmentPattern[?Yield, ?Await] + +ObjectAssignmentPattern[Yield, Await] : + `{` `}` + `{` AssignmentRestProperty[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `,` AssignmentRestProperty[?Yield, ?Await]? `}` + +ArrayAssignmentPattern[Yield, Await] : + `[` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + `[` AssignmentElementList[?Yield, ?Await] `]` + `[` AssignmentElementList[?Yield, ?Await] `,` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + +AssignmentRestProperty[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +AssignmentPropertyList[Yield, Await] : + AssignmentProperty[?Yield, ?Await] + AssignmentPropertyList[?Yield, ?Await] `,` AssignmentProperty[?Yield, ?Await] + +AssignmentElementList[Yield, Await] : + AssignmentElisionElement[?Yield, ?Await] + AssignmentElementList[?Yield, ?Await] `,` AssignmentElisionElement[?Yield, ?Await] + +AssignmentElisionElement[Yield, Await] : + Elision? AssignmentElement[?Yield, ?Await] + +AssignmentProperty[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + PropertyName[?Yield, ?Await] `:` AssignmentElement[?Yield, ?Await] + +AssignmentElement[Yield, Await] : + DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +AssignmentRestElement[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] + +DestructuringAssignmentTarget[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + +@line 20945 + +Expression[In, Yield, Await] : + AssignmentExpression[?In, ?Yield, ?Await] + Expression[?In, ?Yield, ?Await] `,` AssignmentExpression[?In, ?Yield, ?Await] + +@line 20970 + +Statement[Yield, Await, Return] : + BlockStatement[?Yield, ?Await, ?Return] + VariableStatement[?Yield, ?Await] + EmptyStatement + ExpressionStatement[?Yield, ?Await] + IfStatement[?Yield, ?Await, ?Return] + BreakableStatement[?Yield, ?Await, ?Return] + ContinueStatement[?Yield, ?Await] + BreakStatement[?Yield, ?Await] + [+Return] ReturnStatement[?Yield, ?Await] + WithStatement[?Yield, ?Await, ?Return] + LabelledStatement[?Yield, ?Await, ?Return] + ThrowStatement[?Yield, ?Await] + TryStatement[?Yield, ?Await, ?Return] + DebuggerStatement + +Declaration[Yield, Await] : + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + +HoistableDeclaration[Yield, Await, Default] : + FunctionDeclaration[?Yield, ?Await, ?Default] + GeneratorDeclaration[?Yield, ?Await, ?Default] + AsyncFunctionDeclaration[?Yield, ?Await, ?Default] + AsyncGeneratorDeclaration[?Yield, ?Await, ?Default] + +BreakableStatement[Yield, Await, Return] : + IterationStatement[?Yield, ?Await, ?Return] + SwitchStatement[?Yield, ?Await, ?Return] + +@line 21038 + +BlockStatement[Yield, Await, Return] : + Block[?Yield, ?Await, ?Return] + +Block[Yield, Await, Return] : + `{` StatementList[?Yield, ?Await, ?Return]? `}` + +StatementList[Yield, Await, Return] : + StatementListItem[?Yield, ?Await, ?Return] + StatementList[?Yield, ?Await, ?Return] StatementListItem[?Yield, ?Await, ?Return] + +StatementListItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + Declaration[?Yield, ?Await] + +@line 21150 + +LexicalDeclaration[In, Yield, Await] : + LetOrConst BindingList[?In, ?Yield, ?Await] `;` + +LetOrConst : + `let` + `const` + +BindingList[In, Yield, Await] : + LexicalBinding[?In, ?Yield, ?Await] + BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await] + +LexicalBinding[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 21237 + +VariableStatement[Yield, Await] : + `var` VariableDeclarationList[+In, ?Yield, ?Await] `;` + +VariableDeclarationList[In, Yield, Await] : + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] `,` VariableDeclaration[?In, ?Yield, ?Await] + +VariableDeclaration[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +@line 21295 + +BindingPattern[Yield, Await] : + ObjectBindingPattern[?Yield, ?Await] + ArrayBindingPattern[?Yield, ?Await] + +ObjectBindingPattern[Yield, Await] : + `{` `}` + `{` BindingRestProperty[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `,` BindingRestProperty[?Yield, ?Await]? `}` + +ArrayBindingPattern[Yield, Await] : + `[` Elision? BindingRestElement[?Yield, ?Await]? `]` + `[` BindingElementList[?Yield, ?Await] `]` + `[` BindingElementList[?Yield, ?Await] `,` Elision? BindingRestElement[?Yield, ?Await]? `]` + +BindingRestProperty[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + +BindingPropertyList[Yield, Await] : + BindingProperty[?Yield, ?Await] + BindingPropertyList[?Yield, ?Await] `,` BindingProperty[?Yield, ?Await] + +BindingElementList[Yield, Await] : + BindingElisionElement[?Yield, ?Await] + BindingElementList[?Yield, ?Await] `,` BindingElisionElement[?Yield, ?Await] + +BindingElisionElement[Yield, Await] : + Elision? BindingElement[?Yield, ?Await] + +BindingProperty[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` BindingElement[?Yield, ?Await] + +BindingElement[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + BindingPattern[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +SingleNameBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +BindingRestElement[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + `...` BindingPattern[?Yield, ?Await] + +@line 21437 + +EmptyStatement : + `;` + +@line 21454 + +ExpressionStatement[Yield, Await] : + [lookahead ∉ { `{`, `function`, `async` [no LineTerminator here] `function`, `class`, `let` `[` }] Expression[+In, ?Yield, ?Await] `;` + +@line 21475 + +IfStatement[Yield, Await, Return] : + `if` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `else` Statement[?Yield, ?Await, ?Return] + `if` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] [lookahead != `else`] + +@line 21532 + +IterationStatement[Yield, Await, Return] : + DoWhileStatement[?Yield, ?Await, ?Return] + WhileStatement[?Yield, ?Await, ?Return] + ForStatement[?Yield, ?Await, ?Return] + ForInOfStatement[?Yield, ?Await, ?Return] + +@line 21594 + +DoWhileStatement[Yield, Await, Return] : + `do` Statement[?Yield, ?Await, ?Return] `while` `(` Expression[+In, ?Yield, ?Await] `)` `;` + +@line 21637 + +WhileStatement[Yield, Await, Return] : + `while` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + +@line 21680 + +ForStatement[Yield, Await, Return] : + `for` `(` [lookahead != `let` `[`] Expression[~In, ?Yield, ?Await]? `;` Expression[+In, ?Yield, ?Await]? `;` Expression[+In, ?Yield, ?Await]? `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` VariableDeclarationList[~In, ?Yield, ?Await] `;` Expression[+In, ?Yield, ?Await]? `;` Expression[+In, ?Yield, ?Await]? `)` Statement[?Yield, ?Await, ?Return] + `for` `(` LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]? `;` Expression[+In, ?Yield, ?Await]? `)` Statement[?Yield, ?Await, ?Return] + +@line 21812 + +ForInOfStatement[Yield, Await, Return] : + `for` `(` [lookahead != `let` `[`] LeftHandSideExpression[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` ForBinding[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` ForDeclaration[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` [lookahead ∉ { `let`, `async` `of` }] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` ForBinding[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` ForDeclaration[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + [+Await] `for` `await` `(` [lookahead != `let`] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + [+Await] `for` `await` `(` `var` ForBinding[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + [+Await] `for` `await` `(` ForDeclaration[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + +ForDeclaration[Yield, Await] : + LetOrConst ForBinding[?Yield, ?Await] + +ForBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + BindingPattern[?Yield, ?Await] + +@line 22358 + +ContinueStatement[Yield, Await] : + `continue` `;` + `continue` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;` + +@line 22395 + +BreakStatement[Yield, Await] : + `break` `;` + `break` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;` + +@line 22428 + +ReturnStatement[Yield, Await] : + `return` `;` + `return` [no LineTerminator here] Expression[+In, ?Yield, ?Await] `;` + +@line 22460 + +WithStatement[Yield, Await, Return] : + `with` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + +@line 22506 + +SwitchStatement[Yield, Await, Return] : + `switch` `(` Expression[+In, ?Yield, ?Await] `)` CaseBlock[?Yield, ?Await, ?Return] + +CaseBlock[Yield, Await, Return] : + `{` CaseClauses[?Yield, ?Await, ?Return]? `}` + `{` CaseClauses[?Yield, ?Await, ?Return]? DefaultClause[?Yield, ?Await, ?Return] CaseClauses[?Yield, ?Await, ?Return]? `}` + +CaseClauses[Yield, Await, Return] : + CaseClause[?Yield, ?Await, ?Return] + CaseClauses[?Yield, ?Await, ?Return] CaseClause[?Yield, ?Await, ?Return] + +CaseClause[Yield, Await, Return] : + `case` Expression[+In, ?Yield, ?Await] `:` StatementList[?Yield, ?Await, ?Return]? + +DefaultClause[Yield, Await, Return] : + `default` `:` StatementList[?Yield, ?Await, ?Return]? + +@line 22666 + +LabelledStatement[Yield, Await, Return] : + LabelIdentifier[?Yield, ?Await] `:` LabelledItem[?Yield, ?Await, ?Return] + +LabelledItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + FunctionDeclaration[?Yield, ?Await, ~Default] + +@line 22785 + +ThrowStatement[Yield, Await] : + `throw` [no LineTerminator here] Expression[+In, ?Yield, ?Await] `;` + +@line 22804 + +TryStatement[Yield, Await, Return] : + `try` Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return] + `try` Block[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return] + `try` Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return] + +Catch[Yield, Await, Return] : + `catch` `(` CatchParameter[?Yield, ?Await] `)` Block[?Yield, ?Await, ?Return] + `catch` Block[?Yield, ?Await, ?Return] + +Finally[Yield, Await, Return] : + `finally` Block[?Yield, ?Await, ?Return] + +CatchParameter[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + BindingPattern[?Yield, ?Await] + +@line 22907 + +DebuggerStatement : + `debugger` `;` + +@line 22938 + +UniqueFormalParameters[Yield, Await] : + FormalParameters[?Yield, ?Await] + +FormalParameters[Yield, Await] : + [empty] + FunctionRestParameter[?Yield, ?Await] + FormalParameterList[?Yield, ?Await] + FormalParameterList[?Yield, ?Await] `,` + FormalParameterList[?Yield, ?Await] `,` FunctionRestParameter[?Yield, ?Await] + +FormalParameterList[Yield, Await] : + FormalParameter[?Yield, ?Await] + FormalParameterList[?Yield, ?Await] `,` FormalParameter[?Yield, ?Await] + +FunctionRestParameter[Yield, Await] : + BindingRestElement[?Yield, ?Await] + +FormalParameter[Yield, Await] : + BindingElement[?Yield, ?Await] + +@line 23234 + +FunctionDeclaration[Yield, Await, Default] : + `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + [+Default] `function` `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + +FunctionExpression : + `function` BindingIdentifier[~Yield, ~Await]? `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + +FunctionBody[Yield, Await] : + FunctionStatementList[?Yield, ?Await] + +FunctionStatementList[Yield, Await] : + StatementList[?Yield, ?Await, +Return]? + +@line 23436 + +ArrowFunction[In, Yield, Await] : + ArrowParameters[?Yield, ?Await] [no LineTerminator here] `=>` ConciseBody[?In] + +ArrowParameters[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + +ConciseBody[In] : + [lookahead != `{`] ExpressionBody[?In, ~Await] + `{` FunctionBody[~Yield, ~Await] `}` + +ExpressionBody[In, Await] : + AssignmentExpression[?In, ~Yield, ?Await] + +@line 23457 + +ArrowFormalParameters[Yield, Await] : + `(` UniqueFormalParameters[?Yield, ?Await] `)` + +@line 23558 + +MethodDefinition[Yield, Await] : + ClassElementName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + GeneratorMethod[?Yield, ?Await] + AsyncMethod[?Yield, ?Await] + AsyncGeneratorMethod[?Yield, ?Await] + `get` ClassElementName[?Yield, ?Await] `(` `)` `{` FunctionBody[~Yield, ~Await] `}` + `set` ClassElementName[?Yield, ?Await] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield, ~Await] `}` + +PropertySetParameterList : + FormalParameter[~Yield, ~Await] + +@line 23780 + +GeneratorDeclaration[Yield, Await, Default] : + `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorExpression : + `function` `*` BindingIdentifier[+Yield, ~Await]? `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorMethod[Yield, Await] : + `*` ClassElementName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` + +GeneratorBody : + FunctionBody[+Yield, ~Await] + +YieldExpression[In, Await] : + `yield` + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await] + +@line 24035 + +AsyncGeneratorDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + [+Default] `async` [no LineTerminator here] `function` `*` `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorExpression : + `async` [no LineTerminator here] `function` `*` BindingIdentifier[+Yield, +Await]? `(` FormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorMethod[Yield, Await] : + `async` [no LineTerminator here] `*` ClassElementName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, +Await] `)` `{` AsyncGeneratorBody `}` + +AsyncGeneratorBody : + FunctionBody[+Yield, +Await] + +@line 24205 + +ClassDeclaration[Yield, Await, Default] : + `class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] `class` ClassTail[?Yield, ?Await] + +ClassExpression[Yield, Await] : + `class` BindingIdentifier[?Yield, ?Await]? ClassTail[?Yield, ?Await] + +ClassTail[Yield, Await] : + ClassHeritage[?Yield, ?Await]? `{` ClassBody[?Yield, ?Await]? `}` + +ClassHeritage[Yield, Await] : + `extends` LeftHandSideExpression[?Yield, ?Await] + +ClassBody[Yield, Await] : + ClassElementList[?Yield, ?Await] + +ClassElementList[Yield, Await] : + ClassElement[?Yield, ?Await] + ClassElementList[?Yield, ?Await] ClassElement[?Yield, ?Await] + +ClassElement[Yield, Await] : + MethodDefinition[?Yield, ?Await] + `static` MethodDefinition[?Yield, ?Await] + FieldDefinition[?Yield, ?Await] `;` + `static` FieldDefinition[?Yield, ?Await] `;` + ClassStaticBlock + `;` + +FieldDefinition[Yield, Await] : + ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + +ClassElementName[Yield, Await] : + PropertyName[?Yield, ?Await] + PrivateIdentifier + +ClassStaticBlock : + `static` `{` ClassStaticBlockBody `}` + +ClassStaticBlockBody : + ClassStaticBlockStatementList + +ClassStaticBlockStatementList : + StatementList[~Yield, +Await, ~Return]? + +@line 24963 + +AsyncFunctionDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + [+Default] `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionExpression : + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await]? `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncMethod[Yield, Await] : + `async` [no LineTerminator here] ClassElementName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + +AsyncFunctionBody : + FunctionBody[~Yield, +Await] + +AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] + +@line 25148 + +AsyncArrowFunction[In, Yield, Await] : + `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + +AsyncConciseBody[In] : + [lookahead != `{`] ExpressionBody[?In, +Await] + `{` AsyncFunctionBody `}` + +AsyncArrowBindingIdentifier[Yield] : + BindingIdentifier[?Yield, +Await] + +CoverCallExpressionAndAsyncArrowHead[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +@line 25170 + +AsyncArrowHead : + `async` [no LineTerminator here] ArrowFormalParameters[~Yield, +Await] + +@line 25671 + +Script : + ScriptBody? + +ScriptBody : + StatementList[~Yield, ~Await, ~Return] + +@line 25925 + +Module : + ModuleBody? + +ModuleBody : + ModuleItemList + +ModuleItemList : + ModuleItem + ModuleItemList ModuleItem + +ModuleItem : + ImportDeclaration + ExportDeclaration + StatementListItem[~Yield, +Await, ~Return] + +ModuleExportName : + IdentifierName + StringLiteral + +@line 27973 + +ImportDeclaration : + `import` ImportClause FromClause `;` + `import` ModuleSpecifier `;` + +ImportClause : + ImportedDefaultBinding + NameSpaceImport + NamedImports + ImportedDefaultBinding `,` NameSpaceImport + ImportedDefaultBinding `,` NamedImports + +ImportedDefaultBinding : + ImportedBinding + +NameSpaceImport : + `*` `as` ImportedBinding + +NamedImports : + `{` `}` + `{` ImportsList `}` + `{` ImportsList `,` `}` + +FromClause : + `from` ModuleSpecifier + +ImportsList : + ImportSpecifier + ImportsList `,` ImportSpecifier + +ImportSpecifier : + ImportedBinding + ModuleExportName `as` ImportedBinding + +ModuleSpecifier : + StringLiteral + +ImportedBinding : + BindingIdentifier[~Yield, +Await] + +@line 28118 + +ExportDeclaration : + `export` ExportFromClause FromClause `;` + `export` NamedExports `;` + `export` VariableStatement[~Yield, +Await] + `export` Declaration[~Yield, +Await] + `export` `default` HoistableDeclaration[~Yield, +Await, +Default] + `export` `default` ClassDeclaration[~Yield, +Await, +Default] + `export` `default` [lookahead ∉ { `function`, `async` [no LineTerminator here] `function`, `class` }] AssignmentExpression[+In, ~Yield, +Await] `;` + +ExportFromClause : + `*` + `*` `as` ModuleExportName + NamedExports + +NamedExports : + `{` `}` + `{` ExportsList `}` + `{` ExportsList `,` `}` + +ExportsList : + ExportSpecifier + ExportsList `,` ExportSpecifier + +ExportSpecifier : + ModuleExportName + ModuleExportName `as` ModuleExportName + +@line 5012 + +StringNumericLiteral ::: + StrWhiteSpace? + StrWhiteSpace? StrNumericLiteral StrWhiteSpace? + +StrWhiteSpace ::: + StrWhiteSpaceChar StrWhiteSpace? + +StrWhiteSpaceChar ::: + WhiteSpace + LineTerminator + +StrNumericLiteral ::: + StrDecimalLiteral + NonDecimalIntegerLiteral[~Sep] + +StrDecimalLiteral ::: + StrUnsignedDecimalLiteral + `+` StrUnsignedDecimalLiteral + `-` StrUnsignedDecimalLiteral + +StrUnsignedDecimalLiteral ::: + `Infinity` + DecimalDigits[~Sep] `.` DecimalDigits[~Sep]? ExponentPart[~Sep]? + `.` DecimalDigits[~Sep] ExponentPart[~Sep]? + DecimalDigits[~Sep] ExponentPart[~Sep]? + +@line 28931 + +uri ::: + uriCharacters? + +uriCharacters ::: + uriCharacter uriCharacters? + +uriCharacter ::: + uriReserved + uriUnescaped + uriEscaped + +// emu-format ignore +uriReserved ::: one of + `;` `/` `?` `:` `@` `&` `=` `+` `$` `,` + +uriUnescaped ::: + uriAlpha + DecimalDigit + uriMark + +uriEscaped ::: + `%` HexDigit HexDigit + +// emu-format ignore +uriAlpha ::: one of + `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` + `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` + +uriMark ::: one of + `-` `_` `.` `!` `~` `*` `'` `(` `)` + +@line 30141 + +NativeFunction : + `function` NativeFunctionAccessor? PropertyName[~Yield, ~Await]? `(` FormalParameters[~Yield, ~Await] `)` `{` `[` `native` `code` `]` `}` + +NativeFunctionAccessor : + `get` + `set` + +@line 34434 + +Pattern[UnicodeMode, N] :: + Disjunction[?UnicodeMode, ?N] + +Disjunction[UnicodeMode, N] :: + Alternative[?UnicodeMode, ?N] + Alternative[?UnicodeMode, ?N] `|` Disjunction[?UnicodeMode, ?N] + +Alternative[UnicodeMode, N] :: + [empty] + Alternative[?UnicodeMode, ?N] Term[?UnicodeMode, ?N] + +Term[UnicodeMode, N] :: + Assertion[?UnicodeMode, ?N] + Atom[?UnicodeMode, ?N] + Atom[?UnicodeMode, ?N] Quantifier + +Assertion[UnicodeMode, N] :: + `^` + `$` + `\` `b` + `\` `B` + `(` `?` `=` Disjunction[?UnicodeMode, ?N] `)` + `(` `?` `!` Disjunction[?UnicodeMode, ?N] `)` + `(` `?` `<=` Disjunction[?UnicodeMode, ?N] `)` + `(` `?` `` + +RegExpIdentifierName[UnicodeMode] :: + RegExpIdentifierStart[?UnicodeMode] + RegExpIdentifierName[?UnicodeMode] RegExpIdentifierPart[?UnicodeMode] + +RegExpIdentifierStart[UnicodeMode] :: + IdentifierStartChar + `\` RegExpUnicodeEscapeSequence[+UnicodeMode] + [~UnicodeMode] UnicodeLeadSurrogate UnicodeTrailSurrogate + +RegExpIdentifierPart[UnicodeMode] :: + IdentifierPartChar + `\` RegExpUnicodeEscapeSequence[+UnicodeMode] + [~UnicodeMode] UnicodeLeadSurrogate UnicodeTrailSurrogate + +RegExpUnicodeEscapeSequence[UnicodeMode] :: + [+UnicodeMode] `u` HexLeadSurrogate `\u` HexTrailSurrogate + [+UnicodeMode] `u` HexLeadSurrogate + [+UnicodeMode] `u` HexTrailSurrogate + [+UnicodeMode] `u` HexNonSurrogate + [~UnicodeMode] `u` Hex4Digits + [+UnicodeMode] `u{` CodePoint `}` + +UnicodeLeadSurrogate :: + > any Unicode code point in the inclusive range 0xD800 to 0xDBFF + +UnicodeTrailSurrogate :: + > any Unicode code point in the inclusive range 0xDC00 to 0xDFFF + +@line 34545 + +HexLeadSurrogate :: + Hex4Digits [> but only if the MV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF] + +HexTrailSurrogate :: + Hex4Digits [> but only if the MV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF] + +HexNonSurrogate :: + Hex4Digits [> but only if the MV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] + +IdentityEscape[UnicodeMode] :: + [+UnicodeMode] SyntaxCharacter + [+UnicodeMode] `/` + [~UnicodeMode] SourceCharacter but not UnicodeIDContinue + +DecimalEscape :: + NonZeroDigit DecimalDigits[~Sep]? [lookahead ∉ DecimalDigit] + +CharacterClassEscape[UnicodeMode] :: + `d` + `D` + `s` + `S` + `w` + `W` + [+UnicodeMode] `p{` UnicodePropertyValueExpression `}` + [+UnicodeMode] `P{` UnicodePropertyValueExpression `}` + +UnicodePropertyValueExpression :: + UnicodePropertyName `=` UnicodePropertyValue + LoneUnicodePropertyNameOrValue + +UnicodePropertyName :: + UnicodePropertyNameCharacters + +UnicodePropertyNameCharacters :: + UnicodePropertyNameCharacter UnicodePropertyNameCharacters? + +UnicodePropertyValue :: + UnicodePropertyValueCharacters + +LoneUnicodePropertyNameOrValue :: + UnicodePropertyValueCharacters + +UnicodePropertyValueCharacters :: + UnicodePropertyValueCharacter UnicodePropertyValueCharacters? + +UnicodePropertyValueCharacter :: + UnicodePropertyNameCharacter + DecimalDigit + +UnicodePropertyNameCharacter :: + ControlLetter + `_` + +CharacterClass[UnicodeMode] :: + `[` [lookahead != `^`] ClassRanges[?UnicodeMode] `]` + `[` `^` ClassRanges[?UnicodeMode] `]` + +ClassRanges[UnicodeMode] :: + [empty] + NonemptyClassRanges[?UnicodeMode] + +NonemptyClassRanges[UnicodeMode] :: + ClassAtom[?UnicodeMode] + ClassAtom[?UnicodeMode] NonemptyClassRangesNoDash[?UnicodeMode] + ClassAtom[?UnicodeMode] `-` ClassAtom[?UnicodeMode] ClassRanges[?UnicodeMode] + +NonemptyClassRangesNoDash[UnicodeMode] :: + ClassAtom[?UnicodeMode] + ClassAtomNoDash[?UnicodeMode] NonemptyClassRangesNoDash[?UnicodeMode] + ClassAtomNoDash[?UnicodeMode] `-` ClassAtom[?UnicodeMode] ClassRanges[?UnicodeMode] + +ClassAtom[UnicodeMode] :: + `-` + ClassAtomNoDash[?UnicodeMode] + +ClassAtomNoDash[UnicodeMode] :: + SourceCharacter but not one of `\` or `]` or `-` + `\` ClassEscape[?UnicodeMode] + +ClassEscape[UnicodeMode] :: + `b` + [+UnicodeMode] `-` + CharacterClassEscape[?UnicodeMode] + CharacterEscape[?UnicodeMode] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 98e980ae..e91423b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,208 +1,273 @@ -lockfileVersion: 5.4 +lockfileVersion: '6.0' importers: .: - specifiers: - eslint: ^7.31.0 - eslint-config-google: ^0.14.0 - eslint-plugin-ava: ^12.0.0 - eslint-plugin-camelcase-ohm: ^0.2.1 - eslint-plugin-no-extension-in-require: ^0.2.0 - prettier: ^2.3.2 devDependencies: - eslint: 7.32.0 - eslint-config-google: 0.14.0_eslint@7.32.0 - eslint-plugin-ava: 12.0.0_eslint@7.32.0 - eslint-plugin-camelcase-ohm: 0.2.1_eslint@7.32.0 - eslint-plugin-no-extension-in-require: 0.2.0_eslint@7.32.0 - prettier: 2.8.4 + eslint: + specifier: ^7.31.0 + version: 7.32.0 + eslint-config-google: + specifier: ^0.14.0 + version: 0.14.0(eslint@7.32.0) + eslint-plugin-ava: + specifier: ^12.0.0 + version: 12.0.0(eslint@7.32.0) + eslint-plugin-camelcase-ohm: + specifier: ^0.2.1 + version: 0.2.1(eslint@7.32.0) + eslint-plugin-no-extension-in-require: + specifier: ^0.2.0 + version: 0.2.0(eslint@7.32.0) + prettier: + specifier: ^2.3.2 + version: 2.8.4 examples/ecmascript: - specifiers: - ava: ^4.3.3 - fast-glob: ^3.2.7 - ohm-js: ^17.0.0 + dependencies: + '@pkgjs/parseargs': + specifier: ^0.11.0 + version: 0.11.0 + jsdom: + specifier: ^21.1.1 + version: 21.1.2 devDependencies: - ava: 4.3.3 - fast-glob: 3.2.12 - ohm-js: link:../../packages/ohm-js + ava: + specifier: ^4.3.3 + version: 4.3.3 + fast-glob: + specifier: ^3.2.7 + version: 3.2.12 + ohm-js: + specifier: ^17.0.0 + version: link:../../packages/ohm-js examples/indentation-sensitive: - specifiers: - ohm-js: ^17.0.0 - uvu: ^0.5.6 - watchlist: ^0.3.1 dependencies: - ohm-js: link:../../packages/ohm-js + ohm-js: + specifier: ^17.0.0 + version: link:../../packages/ohm-js devDependencies: - uvu: 0.5.6 - watchlist: 0.3.1 + uvu: + specifier: ^0.5.6 + version: 0.5.6 + watchlist: + specifier: ^0.3.1 + version: 0.3.1 examples/markdown: - specifiers: - ava: ^4.3.3 - ohm-js: ^17.0.0 dependencies: - ohm-js: link:../../packages/ohm-js + ohm-js: + specifier: ^17.0.0 + version: link:../../packages/ohm-js devDependencies: - ava: 4.3.3 + ava: + specifier: ^4.3.3 + version: 4.3.3 examples/operators: - specifiers: - ava: ^4.3.3 - ava-spec: ^1.1.1 - ohm-js: ^17.0.0 dependencies: - ohm-js: link:../../packages/ohm-js + ohm-js: + specifier: ^17.0.0 + version: link:../../packages/ohm-js devDependencies: - ava: 4.3.3 - ava-spec: 1.1.1_ava@4.3.3 + ava: + specifier: ^4.3.3 + version: 4.3.3 + ava-spec: + specifier: ^1.1.1 + version: 1.1.1(ava@4.3.3) examples/simple-lisp: - specifiers: - ava: ^4.3.3 - ohm-js: ^17.0.0 dependencies: - ohm-js: link:../../packages/ohm-js + ohm-js: + specifier: ^17.0.0 + version: link:../../packages/ohm-js devDependencies: - ava: 4.3.3 + ava: + specifier: ^4.3.3 + version: 4.3.3 examples/typescript: - specifiers: - '@ohm-js/cli': ^2.0.0 - '@types/node': ^16.9.1 - ava: ^4.3.3 - ohm-js: ^17.0.0 - ts-node: ^10.9.1 - typescript: ^4.3.5 - uvu: ^0.5.6 - dependencies: - ohm-js: link:../../packages/ohm-js + dependencies: + ohm-js: + specifier: ^17.0.0 + version: link:../../packages/ohm-js devDependencies: - '@ohm-js/cli': link:../../packages/cli - '@types/node': 16.18.14 - ava: 4.3.3 - ts-node: 10.9.1_zix2iy4c4a7fivhrc3ey4gy2pu - typescript: 4.9.5 - uvu: 0.5.6 + '@ohm-js/cli': + specifier: ^2.0.0 + version: link:../../packages/cli + '@types/node': + specifier: ^16.9.1 + version: 16.18.14 + ava: + specifier: ^4.3.3 + version: 4.3.3 + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@types/node@16.18.14)(typescript@4.9.5) + typescript: + specifier: ^4.3.5 + version: 4.9.5 + uvu: + specifier: ^0.5.6 + version: 0.5.6 packages/cli: - specifiers: - '@types/node': ^16.9.1 - '@types/require-from-string': ^1.2.1 - ava: ^4.3.3 - commander: ^8.1.0 - fast-glob: ^3.2.7 - ohm-js: ^17.0.0 - require-from-string: ^2.0.2 - ts-dedent: ^2.2.0 - ts-morph: ^12.0.0 - typescript: ^4.3.5 - dependencies: - commander: 8.3.0 - fast-glob: 3.2.12 + dependencies: + commander: + specifier: ^8.1.0 + version: 8.3.0 + fast-glob: + specifier: ^3.2.7 + version: 3.2.12 devDependencies: - '@types/node': 16.18.14 - '@types/require-from-string': 1.2.1 - ava: 4.3.3 - ohm-js: link:../ohm-js - require-from-string: 2.0.2 - ts-dedent: 2.2.0 - ts-morph: 12.2.0 - typescript: 4.9.5 - - packages/lang-python: - specifiers: {} + '@types/node': + specifier: ^16.9.1 + version: 16.18.14 + '@types/require-from-string': + specifier: ^1.2.1 + version: 1.2.1 + ava: + specifier: ^4.3.3 + version: 4.3.3 + ohm-js: + specifier: ^17.0.0 + version: link:../ohm-js + require-from-string: + specifier: ^2.0.2 + version: 2.0.2 + ts-dedent: + specifier: ^2.2.0 + version: 2.2.0 + ts-morph: + specifier: ^12.0.0 + version: 12.2.0 + typescript: + specifier: ^4.3.5 + version: 4.9.5 + + packages/lang-python: {} packages/ohm-js: - specifiers: - '@rollup/plugin-commonjs': ^21.0.1 - '@rollup/plugin-json': ^4.1.0 - '@rollup/plugin-node-resolve': ^13.1.3 - ava: ^4.3.3 - ava-spec: ^1.1.1 - dedent: ^0.7.0 - eslint: ^7.31.0 - eslint-config-google: ^0.14.0 - eslint-plugin-ava: ^12.0.0 - eslint-plugin-camelcase-ohm: ^0.2.1 - eslint-plugin-no-extension-in-require: ^0.2.0 - husky: ^4.2.5 - jsdom: ^9.9.1 - json: ^9.0.6 - markscript: ^0.5.0 - node-static: ^0.7.11 - rollup: ^2.63.0 - terser: ^5.15.1 - uvu: ^0.5.6 - walk-sync: ^2.2.0 - watchlist: ^0.3.1 devDependencies: - '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 - '@rollup/plugin-json': 4.1.0_rollup@2.79.1 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 - ava: 4.3.3 - ava-spec: 1.1.1_ava@4.3.3 - dedent: 0.7.0 - eslint: 7.32.0 - eslint-config-google: 0.14.0_eslint@7.32.0 - eslint-plugin-ava: 12.0.0_eslint@7.32.0 - eslint-plugin-camelcase-ohm: 0.2.1_eslint@7.32.0 - eslint-plugin-no-extension-in-require: 0.2.0_eslint@7.32.0 - husky: 4.3.8 - jsdom: 9.12.0 - json: 9.0.6 - markscript: 0.5.0 - node-static: 0.7.11 - rollup: 2.79.1 - terser: 5.16.5 - uvu: 0.5.6 - walk-sync: 2.2.0 - watchlist: 0.3.1 + '@rollup/plugin-commonjs': + specifier: ^21.0.1 + version: 21.1.0(rollup@2.79.1) + '@rollup/plugin-json': + specifier: ^4.1.0 + version: 4.1.0(rollup@2.79.1) + '@rollup/plugin-node-resolve': + specifier: ^13.1.3 + version: 13.3.0(rollup@2.79.1) + ava: + specifier: ^4.3.3 + version: 4.3.3 + ava-spec: + specifier: ^1.1.1 + version: 1.1.1(ava@4.3.3) + dedent: + specifier: ^0.7.0 + version: 0.7.0 + eslint: + specifier: ^7.31.0 + version: 7.32.0 + eslint-config-google: + specifier: ^0.14.0 + version: 0.14.0(eslint@7.32.0) + eslint-plugin-ava: + specifier: ^12.0.0 + version: 12.0.0(eslint@7.32.0) + eslint-plugin-camelcase-ohm: + specifier: ^0.2.1 + version: 0.2.1(eslint@7.32.0) + eslint-plugin-no-extension-in-require: + specifier: ^0.2.0 + version: 0.2.0(eslint@7.32.0) + husky: + specifier: ^4.2.5 + version: 4.3.8 + jsdom: + specifier: ^9.9.1 + version: 9.12.0 + json: + specifier: ^9.0.6 + version: 9.0.6 + markscript: + specifier: ^0.5.0 + version: 0.5.0 + node-static: + specifier: ^0.7.11 + version: 0.7.11 + rollup: + specifier: ^2.63.0 + version: 2.79.1 + terser: + specifier: ^5.15.1 + version: 5.16.5 + uvu: + specifier: ^0.5.6 + version: 0.5.6 + walk-sync: + specifier: ^2.2.0 + version: 2.2.0 + watchlist: + specifier: ^0.3.1 + version: 0.3.1 packages/packaging-tests: - specifiers: - '@ohm-js/cli': ^2.0.0 - '@rollup/plugin-node-resolve': ^15.0.1 - '@types/node': ^16.9.1 - acorn: ^8.8.1 - ohm-js: ^17.0.0 - rollup: ^3.2.5 - ts-node: ^10.9.1 - typescript: ^4.3.5 - uvu: ^0.5.6 - watchlist: ^0.3.1 - webpack: ^5.74.0 - webpack-cli: ^4.10.0 devDependencies: - '@ohm-js/cli': link:../cli - '@rollup/plugin-node-resolve': 15.0.1_rollup@3.18.0 - '@types/node': 16.18.14 - acorn: 8.8.2 - ohm-js: link:../ohm-js - rollup: 3.18.0 - ts-node: 10.9.1_zix2iy4c4a7fivhrc3ey4gy2pu - typescript: 4.9.5 - uvu: 0.5.6 - watchlist: 0.3.1 - webpack: 5.75.0_webpack-cli@4.10.0 - webpack-cli: 4.10.0_webpack@5.75.0 + '@ohm-js/cli': + specifier: ^2.0.0 + version: link:../cli + '@rollup/plugin-node-resolve': + specifier: ^15.0.1 + version: 15.0.1(rollup@3.18.0) + '@types/node': + specifier: ^16.9.1 + version: 16.18.14 + acorn: + specifier: ^8.8.1 + version: 8.8.2 + ohm-js: + specifier: ^17.0.0 + version: link:../ohm-js + rollup: + specifier: ^3.2.5 + version: 3.18.0 + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@types/node@16.18.14)(typescript@4.9.5) + typescript: + specifier: ^4.3.5 + version: 4.9.5 + uvu: + specifier: ^0.5.6 + version: 0.5.6 + watchlist: + specifier: ^0.3.1 + version: 0.3.1 + webpack: + specifier: ^5.74.0 + version: 5.75.0(webpack-cli@4.10.0) + webpack-cli: + specifier: ^4.10.0 + version: 4.10.0(webpack@5.75.0) packages: - /@babel/code-frame/7.12.11: + /@babel/code-frame@7.12.11: resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} dependencies: '@babel/highlight': 7.18.6 dev: true - /@babel/helper-validator-identifier/7.19.1: + /@babel/helper-validator-identifier@7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} dev: true - /@babel/highlight/7.18.6: + /@babel/highlight@7.18.6: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} dependencies: @@ -211,19 +276,19 @@ packages: js-tokens: 4.0.0 dev: true - /@cspotcode/source-map-support/0.8.1: + /@cspotcode/source-map-support@0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} dependencies: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@discoveryjs/json-ext/0.5.7: + /@discoveryjs/json-ext@0.5.7: resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} engines: {node: '>=10.0.0'} dev: true - /@eslint/eslintrc/0.4.3: + /@eslint/eslintrc@0.4.3: resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: @@ -240,7 +305,7 @@ packages: - supports-color dev: true - /@humanwhocodes/config-array/0.5.0: + /@humanwhocodes/config-array@0.5.0: resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} engines: {node: '>=10.10.0'} dependencies: @@ -251,11 +316,11 @@ packages: - supports-color dev: true - /@humanwhocodes/object-schema/1.2.1: + /@humanwhocodes/object-schema@1.2.1: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true - /@jridgewell/gen-mapping/0.3.2: + /@jridgewell/gen-mapping@0.3.2: resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} engines: {node: '>=6.0.0'} dependencies: @@ -264,66 +329,71 @@ packages: '@jridgewell/trace-mapping': 0.3.17 dev: true - /@jridgewell/resolve-uri/3.1.0: + /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} dev: true - /@jridgewell/set-array/1.1.2: + /@jridgewell/set-array@1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} dev: true - /@jridgewell/source-map/0.3.2: + /@jridgewell/source-map@0.3.2: resolution: {integrity: sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==} dependencies: '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.17 dev: true - /@jridgewell/sourcemap-codec/1.4.14: + /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: true - /@jridgewell/trace-mapping/0.3.17: + /@jridgewell/trace-mapping@0.3.17: resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@jridgewell/trace-mapping/0.3.9: + /@jridgewell/trace-mapping@0.3.9: resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@nodelib/fs.scandir/2.1.5: + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - /@nodelib/fs.stat/2.0.5: + /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - /@nodelib/fs.walk/1.2.8: + /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@rollup/plugin-commonjs/21.1.0_rollup@2.79.1: + /@pkgjs/parseargs@0.11.0: + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + dev: false + + /@rollup/plugin-commonjs@21.1.0(rollup@2.79.1): resolution: {integrity: sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==} engines: {node: '>= 8.0.0'} peerDependencies: rollup: ^2.38.3 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 + '@rollup/pluginutils': 3.1.0(rollup@2.79.1) commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.3 @@ -333,22 +403,22 @@ packages: rollup: 2.79.1 dev: true - /@rollup/plugin-json/4.1.0_rollup@2.79.1: + /@rollup/plugin-json@4.1.0(rollup@2.79.1): resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 + '@rollup/pluginutils': 3.1.0(rollup@2.79.1) rollup: 2.79.1 dev: true - /@rollup/plugin-node-resolve/13.3.0_rollup@2.79.1: + /@rollup/plugin-node-resolve@13.3.0(rollup@2.79.1): resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} engines: {node: '>= 10.0.0'} peerDependencies: rollup: ^2.42.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 + '@rollup/pluginutils': 3.1.0(rollup@2.79.1) '@types/resolve': 1.17.1 deepmerge: 4.3.0 is-builtin-module: 3.2.1 @@ -357,7 +427,7 @@ packages: rollup: 2.79.1 dev: true - /@rollup/plugin-node-resolve/15.0.1_rollup@3.18.0: + /@rollup/plugin-node-resolve@15.0.1(rollup@3.18.0): resolution: {integrity: sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==} engines: {node: '>=14.0.0'} peerDependencies: @@ -366,7 +436,7 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2_rollup@3.18.0 + '@rollup/pluginutils': 5.0.2(rollup@3.18.0) '@types/resolve': 1.20.2 deepmerge: 4.3.0 is-builtin-module: 3.2.1 @@ -375,7 +445,7 @@ packages: rollup: 3.18.0 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.79.1: + /@rollup/pluginutils@3.1.0(rollup@2.79.1): resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -387,7 +457,7 @@ packages: rollup: 2.79.1 dev: true - /@rollup/pluginutils/5.0.2_rollup@3.18.0: + /@rollup/pluginutils@5.0.2(rollup@3.18.0): resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -402,7 +472,12 @@ packages: rollup: 3.18.0 dev: true - /@ts-morph/common/0.11.1: + /@tootallnate/once@2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: false + + /@ts-morph/common@0.11.1: resolution: {integrity: sha512-7hWZS0NRpEsNV8vWJzg7FEz6V8MaLNeJOmwmghqUXTpzk16V1LLZhdo+4QvE/+zv4cVci0OviuJFnqhEfoV3+g==} dependencies: fast-glob: 3.2.12 @@ -411,98 +486,98 @@ packages: path-browserify: 1.0.1 dev: true - /@tsconfig/node10/1.0.9: + /@tsconfig/node10@1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} dev: true - /@tsconfig/node12/1.0.11: + /@tsconfig/node12@1.0.11: resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} dev: true - /@tsconfig/node14/1.0.3: + /@tsconfig/node14@1.0.3: resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} dev: true - /@tsconfig/node16/1.0.3: + /@tsconfig/node16@1.0.3: resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} dev: true - /@types/eslint-scope/3.7.4: + /@types/eslint-scope@3.7.4: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: '@types/eslint': 8.21.1 '@types/estree': 0.0.51 dev: true - /@types/eslint/8.21.1: + /@types/eslint@8.21.1: resolution: {integrity: sha512-rc9K8ZpVjNcLs8Fp0dkozd5Pt2Apk1glO4Vgz8ix1u6yFByxfqo5Yavpy65o+93TAe24jr7v+eSBtFLvOQtCRQ==} dependencies: '@types/estree': 0.0.51 '@types/json-schema': 7.0.11 dev: true - /@types/estree/0.0.39: + /@types/estree@0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} dev: true - /@types/estree/0.0.51: + /@types/estree@0.0.51: resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==} dev: true - /@types/estree/1.0.0: + /@types/estree@1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: true - /@types/json-schema/7.0.11: + /@types/json-schema@7.0.11: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} dev: true - /@types/minimatch/3.0.5: + /@types/minimatch@3.0.5: resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} dev: true - /@types/node/16.18.14: + /@types/node@16.18.14: resolution: {integrity: sha512-wvzClDGQXOCVNU4APPopC2KtMYukaF1MN/W3xAmslx22Z4/IF1/izDMekuyoUlwfnDHYCIZGaj7jMwnJKBTxKw==} dev: true - /@types/parse-json/4.0.0: + /@types/parse-json@4.0.0: resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} dev: true - /@types/require-from-string/1.2.1: + /@types/require-from-string@1.2.1: resolution: {integrity: sha512-mIDK7lTHc0uW67SxPIqkwCrxmdKBV5aAET560hyZnT8c6Ekp9Aah3GPqe8Pl1Yzn/i2NMYmYv+HiMLwjGDCIAQ==} dev: true - /@types/resolve/1.17.1: + /@types/resolve@1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: '@types/node': 16.18.14 dev: true - /@types/resolve/1.20.2: + /@types/resolve@1.20.2: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} dev: true - /@webassemblyjs/ast/1.11.1: + /@webassemblyjs/ast@1.11.1: resolution: {integrity: sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==} dependencies: '@webassemblyjs/helper-numbers': 1.11.1 '@webassemblyjs/helper-wasm-bytecode': 1.11.1 dev: true - /@webassemblyjs/floating-point-hex-parser/1.11.1: + /@webassemblyjs/floating-point-hex-parser@1.11.1: resolution: {integrity: sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==} dev: true - /@webassemblyjs/helper-api-error/1.11.1: + /@webassemblyjs/helper-api-error@1.11.1: resolution: {integrity: sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==} dev: true - /@webassemblyjs/helper-buffer/1.11.1: + /@webassemblyjs/helper-buffer@1.11.1: resolution: {integrity: sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==} dev: true - /@webassemblyjs/helper-numbers/1.11.1: + /@webassemblyjs/helper-numbers@1.11.1: resolution: {integrity: sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==} dependencies: '@webassemblyjs/floating-point-hex-parser': 1.11.1 @@ -510,11 +585,11 @@ packages: '@xtuc/long': 4.2.2 dev: true - /@webassemblyjs/helper-wasm-bytecode/1.11.1: + /@webassemblyjs/helper-wasm-bytecode@1.11.1: resolution: {integrity: sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==} dev: true - /@webassemblyjs/helper-wasm-section/1.11.1: + /@webassemblyjs/helper-wasm-section@1.11.1: resolution: {integrity: sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==} dependencies: '@webassemblyjs/ast': 1.11.1 @@ -523,23 +598,23 @@ packages: '@webassemblyjs/wasm-gen': 1.11.1 dev: true - /@webassemblyjs/ieee754/1.11.1: + /@webassemblyjs/ieee754@1.11.1: resolution: {integrity: sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==} dependencies: '@xtuc/ieee754': 1.2.0 dev: true - /@webassemblyjs/leb128/1.11.1: + /@webassemblyjs/leb128@1.11.1: resolution: {integrity: sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==} dependencies: '@xtuc/long': 4.2.2 dev: true - /@webassemblyjs/utf8/1.11.1: + /@webassemblyjs/utf8@1.11.1: resolution: {integrity: sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==} dev: true - /@webassemblyjs/wasm-edit/1.11.1: + /@webassemblyjs/wasm-edit@1.11.1: resolution: {integrity: sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==} dependencies: '@webassemblyjs/ast': 1.11.1 @@ -552,7 +627,7 @@ packages: '@webassemblyjs/wast-printer': 1.11.1 dev: true - /@webassemblyjs/wasm-gen/1.11.1: + /@webassemblyjs/wasm-gen@1.11.1: resolution: {integrity: sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==} dependencies: '@webassemblyjs/ast': 1.11.1 @@ -562,7 +637,7 @@ packages: '@webassemblyjs/utf8': 1.11.1 dev: true - /@webassemblyjs/wasm-opt/1.11.1: + /@webassemblyjs/wasm-opt@1.11.1: resolution: {integrity: sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==} dependencies: '@webassemblyjs/ast': 1.11.1 @@ -571,7 +646,7 @@ packages: '@webassemblyjs/wasm-parser': 1.11.1 dev: true - /@webassemblyjs/wasm-parser/1.11.1: + /@webassemblyjs/wasm-parser@1.11.1: resolution: {integrity: sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==} dependencies: '@webassemblyjs/ast': 1.11.1 @@ -582,33 +657,33 @@ packages: '@webassemblyjs/utf8': 1.11.1 dev: true - /@webassemblyjs/wast-printer/1.11.1: + /@webassemblyjs/wast-printer@1.11.1: resolution: {integrity: sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==} dependencies: '@webassemblyjs/ast': 1.11.1 '@xtuc/long': 4.2.2 dev: true - /@webpack-cli/configtest/1.2.0_pda42hcaj7d62cr262fr632kue: + /@webpack-cli/configtest@1.2.0(webpack-cli@4.10.0)(webpack@5.75.0): resolution: {integrity: sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==} peerDependencies: webpack: 4.x.x || 5.x.x webpack-cli: 4.x.x dependencies: - webpack: 5.75.0_webpack-cli@4.10.0 - webpack-cli: 4.10.0_webpack@5.75.0 + webpack: 5.75.0(webpack-cli@4.10.0) + webpack-cli: 4.10.0(webpack@5.75.0) dev: true - /@webpack-cli/info/1.5.0_webpack-cli@4.10.0: + /@webpack-cli/info@1.5.0(webpack-cli@4.10.0): resolution: {integrity: sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==} peerDependencies: webpack-cli: 4.x.x dependencies: envinfo: 7.8.1 - webpack-cli: 4.10.0_webpack@5.75.0 + webpack-cli: 4.10.0(webpack@5.75.0) dev: true - /@webpack-cli/serve/1.7.0_webpack-cli@4.10.0: + /@webpack-cli/serve@1.7.0(webpack-cli@4.10.0): resolution: {integrity: sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==} peerDependencies: webpack-cli: 4.x.x @@ -617,28 +692,39 @@ packages: webpack-dev-server: optional: true dependencies: - webpack-cli: 4.10.0_webpack@5.75.0 + webpack-cli: 4.10.0(webpack@5.75.0) dev: true - /@xtuc/ieee754/1.2.0: + /@xtuc/ieee754@1.2.0: resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} dev: true - /@xtuc/long/4.2.2: + /@xtuc/long@4.2.2: resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} dev: true - /abab/1.0.4: + /abab@1.0.4: resolution: {integrity: sha512-I+Wi+qiE2kUXyrRhNsWv6XsjUTBJjSoVSctKNBfLG5zG/Xe7Rjbxf13+vqYHNTwHaFU+FtSlVxOCTiMEVtPv0A==} dev: true - /acorn-globals/3.1.0: + /abab@2.0.6: + resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} + dev: false + + /acorn-globals@3.1.0: resolution: {integrity: sha512-uWttZCk96+7itPxK8xCzY86PnxKTMrReKDqrHzv42VQY0K30PUO8WY13WMOuI+cOdX4EIdzdvQ8k6jkuGRFMYw==} dependencies: acorn: 4.0.13 dev: true - /acorn-import-assertions/1.8.0_acorn@8.8.2: + /acorn-globals@7.0.1: + resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} + dependencies: + acorn: 8.8.2 + acorn-walk: 8.2.0 + dev: false + + /acorn-import-assertions@1.8.0(acorn@8.8.2): resolution: {integrity: sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==} peerDependencies: acorn: ^8 @@ -646,7 +732,7 @@ packages: acorn: 8.8.2 dev: true - /acorn-jsx/5.3.2_acorn@7.4.1: + /acorn-jsx@5.3.2(acorn@7.4.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -654,30 +740,37 @@ packages: acorn: 7.4.1 dev: true - /acorn-walk/8.2.0: + /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} - dev: true - /acorn/4.0.13: + /acorn@4.0.13: resolution: {integrity: sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug==} engines: {node: '>=0.4.0'} hasBin: true dev: true - /acorn/7.4.1: + /acorn@7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} engines: {node: '>=0.4.0'} hasBin: true dev: true - /acorn/8.8.2: + /acorn@8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true - dev: true - /aggregate-error/3.1.0: + /agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /aggregate-error@3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} dependencies: @@ -685,7 +778,7 @@ packages: indent-string: 4.0.0 dev: true - /aggregate-error/4.0.1: + /aggregate-error@4.0.1: resolution: {integrity: sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==} engines: {node: '>=12'} dependencies: @@ -693,7 +786,7 @@ packages: indent-string: 5.0.0 dev: true - /ajv-keywords/3.5.2_ajv@6.12.6: + /ajv-keywords@3.5.2(ajv@6.12.6): resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==} peerDependencies: ajv: ^6.9.1 @@ -701,7 +794,7 @@ packages: ajv: 6.12.6 dev: true - /ajv/6.12.6: + /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: fast-deep-equal: 3.1.3 @@ -710,7 +803,7 @@ packages: uri-js: 4.4.1 dev: true - /ajv/8.12.0: + /ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} dependencies: fast-deep-equal: 3.1.3 @@ -719,41 +812,41 @@ packages: uri-js: 4.4.1 dev: true - /ansi-colors/4.1.3: + /ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} dev: true - /ansi-regex/5.0.1: + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} dev: true - /ansi-regex/6.0.1: + /ansi-regex@6.0.1: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} engines: {node: '>=12'} dev: true - /ansi-styles/3.2.1: + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} dependencies: color-convert: 1.9.3 dev: true - /ansi-styles/4.3.0: + /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} dependencies: color-convert: 2.0.1 dev: true - /ansi-styles/6.2.1: + /ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} dev: true - /anymatch/3.1.3: + /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} dependencies: @@ -761,61 +854,60 @@ packages: picomatch: 2.3.1 dev: true - /arg/4.1.3: + /arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} dev: true - /argparse/1.0.10: + /argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 dev: true - /array-equal/1.0.0: + /array-equal@1.0.0: resolution: {integrity: sha512-H3LU5RLiSsGXPhN+Nipar0iR0IofH+8r89G2y1tBKxQ/agagKyAjhkAFDRBfodP2caPrNKHpAWNIM/c9yeL7uA==} dev: true - /array-find-index/1.0.2: + /array-find-index@1.0.2: resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} engines: {node: '>=0.10.0'} dev: true - /array-union/2.1.0: + /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /arrgv/1.0.2: + /arrgv@1.0.2: resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} engines: {node: '>=8.0.0'} dev: true - /arrify/3.0.0: + /arrify@3.0.0: resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} engines: {node: '>=12'} dev: true - /asn1/0.2.6: + /asn1@0.2.6: resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} dependencies: safer-buffer: 2.1.2 dev: true - /assert-plus/1.0.0: + /assert-plus@1.0.0: resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} engines: {node: '>=0.8'} dev: true - /astral-regex/2.0.0: + /astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} dev: true - /asynckit/0.4.0: + /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - /ava-spec/1.1.1_ava@4.3.3: + /ava-spec@1.1.1(ava@4.3.3): resolution: {integrity: sha512-SfW9c63C9eQq6Hy1xcZej1fAfpWgDefbd5FEacn0XKoCOSJ8k0zrLzoFfAZNBl5vX7MaS49GwGUpX70Yyjr7QA==} engines: {node: '>=0.10.0'} peerDependencies: @@ -826,7 +918,7 @@ packages: option-chain: 0.1.1 dev: true - /ava/4.3.3: + /ava@4.3.3: resolution: {integrity: sha512-9Egq/d9R74ExrWohHeqUlexjDbgZJX5jA1Wq4KCTqc3wIfpGEK79zVy4rBtofJ9YKIxs4PzhJ8BgbW5PlAYe6w==} engines: {node: '>=12.22 <13 || >=14.17 <15 || >=16.4 <17 || >=18'} hasBin: true @@ -885,47 +977,47 @@ packages: - supports-color dev: true - /aws-sign2/0.7.0: + /aws-sign2@0.7.0: resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==} dev: true - /aws4/1.12.0: + /aws4@1.12.0: resolution: {integrity: sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==} dev: true - /balanced-match/1.0.2: + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true - /bcrypt-pbkdf/1.0.2: + /bcrypt-pbkdf@1.0.2: resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} dependencies: tweetnacl: 0.14.5 dev: true - /binary-extensions/2.2.0: + /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} dev: true - /blueimp-md5/2.19.0: + /blueimp-md5@2.19.0: resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} dev: true - /brace-expansion/1.1.11: + /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 dev: true - /braces/3.0.2: + /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} dependencies: fill-range: 7.0.1 - /browserslist/4.21.5: + /browserslist@4.21.5: resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -933,49 +1025,49 @@ packages: caniuse-lite: 1.0.30001460 electron-to-chromium: 1.4.317 node-releases: 2.0.10 - update-browserslist-db: 1.0.10_browserslist@4.21.5 + update-browserslist-db: 1.0.10(browserslist@4.21.5) dev: true - /buf-compare/1.0.1: + /buf-compare@1.0.1: resolution: {integrity: sha512-Bvx4xH00qweepGc43xFvMs5BKASXTbHaHm6+kDYIK9p/4iFwjATQkmPKHQSgJZzKbAymhztRbXUf1Nqhzl73/Q==} engines: {node: '>=0.10.0'} dev: true - /buffer-from/1.1.2: + /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /builtin-modules/3.3.0: + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} dev: true - /callsites/3.1.0: + /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} dev: true - /callsites/4.0.0: + /callsites@4.0.0: resolution: {integrity: sha512-y3jRROutgpKdz5vzEhWM34TidDU8vkJppF8dszITeb1PQmSqV3DTxyV8G/lyO/DNvtE1YTedehmw9MPZsCBHxQ==} engines: {node: '>=12.20'} dev: true - /caniuse-lite/1.0.30001460: + /caniuse-lite@1.0.30001460: resolution: {integrity: sha512-Bud7abqjvEjipUkpLs4D7gR0l8hBYBHoa+tGtKJHvT2AYzLp1z7EmVkUT4ERpVUfca8S2HGIVs883D8pUH1ZzQ==} dev: true - /caseless/0.12.0: + /caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} dev: true - /cbor/8.1.0: + /cbor@8.1.0: resolution: {integrity: sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==} engines: {node: '>=12.19'} dependencies: nofilter: 3.1.0 dev: true - /chalk/2.4.2: + /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} dependencies: @@ -984,7 +1076,7 @@ packages: supports-color: 5.5.0 dev: true - /chalk/4.1.2: + /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} dependencies: @@ -992,12 +1084,12 @@ packages: supports-color: 7.2.0 dev: true - /chalk/5.2.0: + /chalk@5.2.0: resolution: {integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true - /chokidar/3.5.3: + /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} dependencies: @@ -1012,46 +1104,46 @@ packages: fsevents: 2.3.2 dev: true - /chrome-trace-event/1.0.3: + /chrome-trace-event@1.0.3: resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} engines: {node: '>=6.0'} dev: true - /chunkd/2.0.1: + /chunkd@2.0.1: resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} dev: true - /ci-info/2.0.0: + /ci-info@2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} dev: true - /ci-info/3.8.0: + /ci-info@3.8.0: resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} engines: {node: '>=8'} dev: true - /ci-parallel-vars/1.0.1: + /ci-parallel-vars@1.0.1: resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} dev: true - /clean-stack/2.2.0: + /clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} dev: true - /clean-stack/4.2.0: + /clean-stack@4.2.0: resolution: {integrity: sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==} engines: {node: '>=12'} dependencies: escape-string-regexp: 5.0.0 dev: true - /clean-yaml-object/0.1.0: + /clean-yaml-object@0.1.0: resolution: {integrity: sha512-3yONmlN9CSAkzNwnRCiJQ7Q2xK5mWuEfL3PuTZcAUzhObbXsfsnMptJzXwz93nc5zn9V9TwCVMmV7w4xsm43dw==} engines: {node: '>=0.10.0'} dev: true - /cli-truncate/3.1.0: + /cli-truncate@3.1.0: resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: @@ -1059,7 +1151,7 @@ packages: string-width: 5.1.2 dev: true - /cliui/8.0.1: + /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} dependencies: @@ -1068,7 +1160,7 @@ packages: wrap-ansi: 7.0.0 dev: true - /clone-deep/4.0.1: + /clone-deep@4.0.1: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} engines: {node: '>=6'} dependencies: @@ -1077,85 +1169,84 @@ packages: shallow-clone: 3.0.1 dev: true - /code-block-writer/10.1.1: + /code-block-writer@10.1.1: resolution: {integrity: sha512-67ueh2IRGst/51p0n6FvPrnRjAGHY5F8xdjkgrYE7DDzpJe6qA07RYQ9VcoUeo5ATOjSOiWpSL3SWBRRbempMw==} dev: true - /code-excerpt/4.0.0: + /code-excerpt@4.0.0: resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: convert-to-spaces: 2.0.1 dev: true - /color-convert/1.9.3: + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: color-name: 1.1.3 dev: true - /color-convert/2.0.1: + /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} dependencies: color-name: 1.1.4 dev: true - /color-name/1.1.3: + /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} dev: true - /color-name/1.1.4: + /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true - /colorette/2.0.19: + /colorette@2.0.19: resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==} dev: true - /colors/1.4.0: + /colors@1.4.0: resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} engines: {node: '>=0.1.90'} dev: true - /combined-stream/1.0.8: + /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 - dev: true - /commander/2.20.3: + /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: true - /commander/7.2.0: + /commander@7.2.0: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} dev: true - /commander/8.3.0: + /commander@8.3.0: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} dev: false - /common-path-prefix/3.0.0: + /common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} dev: true - /commondir/1.0.1: + /commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} dev: true - /compare-versions/3.6.0: + /compare-versions@3.6.0: resolution: {integrity: sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==} dev: true - /concat-map/0.0.1: + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true - /concordance/5.0.4: + /concordance@5.0.4: resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} dependencies: @@ -1169,16 +1260,16 @@ packages: well-known-symbols: 2.0.0 dev: true - /content-type-parser/1.0.2: + /content-type-parser@1.0.2: resolution: {integrity: sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==} dev: true - /convert-to-spaces/2.0.1: + /convert-to-spaces@2.0.1: resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /core-assert/0.2.1: + /core-assert@0.2.1: resolution: {integrity: sha512-IG97qShIP+nrJCXMCgkNZgH7jZQ4n8RpPyPeXX++T6avR/KhLhgLiHKoEn5Rc1KjfycSfA9DMa6m+4C4eguHhw==} engines: {node: '>=0.10.0'} dependencies: @@ -1186,11 +1277,11 @@ packages: is-error: 2.2.2 dev: true - /core-util-is/1.0.2: + /core-util-is@1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} dev: true - /cosmiconfig/7.1.0: + /cosmiconfig@7.1.0: resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} engines: {node: '>=10'} dependencies: @@ -1201,11 +1292,11 @@ packages: yaml: 1.10.2 dev: true - /create-require/1.1.1: + /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true - /cross-spawn/7.0.3: + /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} dependencies: @@ -1214,38 +1305,54 @@ packages: which: 2.0.2 dev: true - /cssom/0.3.8: + /cssom@0.3.8: resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==} dev: true - /cssstyle/0.2.37: + /cssstyle@0.2.37: resolution: {integrity: sha512-FUpKc+1FNBsHUr9IsfSGCovr8VuGOiiuzlgCyppKBjJi2jYTOFLN3oiiNRMIvYqbFzF38mqKj4BgcevzU5/kIA==} dependencies: cssom: 0.3.8 dev: true - /currently-unhandled/0.4.1: + /cssstyle@3.0.0: + resolution: {integrity: sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==} + engines: {node: '>=14'} + dependencies: + rrweb-cssom: 0.6.0 + dev: false + + /currently-unhandled@0.4.1: resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} engines: {node: '>=0.10.0'} dependencies: array-find-index: 1.0.2 dev: true - /dashdash/1.14.1: + /dashdash@1.14.1: resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} engines: {node: '>=0.10'} dependencies: assert-plus: 1.0.0 dev: true - /date-time/3.1.0: + /data-urls@4.0.0: + resolution: {integrity: sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==} + engines: {node: '>=14'} + dependencies: + abab: 2.0.6 + whatwg-mimetype: 3.0.0 + whatwg-url: 12.0.1 + dev: false + + /date-time@3.1.0: resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} engines: {node: '>=6'} dependencies: time-zone: 1.0.0 dev: true - /debug/4.3.4: + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -1255,29 +1362,31 @@ packages: optional: true dependencies: ms: 2.1.2 - dev: true - /dedent/0.7.0: + /decimal.js@10.4.3: + resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} + dev: false + + /dedent@0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true - /deep-is/0.1.4: + /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true - /deep-strict-equal/0.2.0: + /deep-strict-equal@0.2.0: resolution: {integrity: sha512-3daSWyvZ/zwJvuMGlzG1O+Ow0YSadGfb3jsh9xoCutv2tWyB9dA4YvR9L9/fSdDZa2dByYQe+TqapSGUrjnkoA==} engines: {node: '>=0.10.0'} dependencies: core-assert: 0.2.1 dev: true - /deepmerge/4.3.0: + /deepmerge@4.3.0: resolution: {integrity: sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==} engines: {node: '>=0.10.0'} dev: true - /del/6.1.1: + /del@6.1.1: resolution: {integrity: sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==} engines: {node: '>=10'} dependencies: @@ -1291,76 +1400,82 @@ packages: slash: 3.0.0 dev: true - /delayed-stream/1.0.0: + /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} - dev: true - /dequal/2.0.3: + /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} dev: true - /diff/4.0.2: + /diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} dev: true - /diff/5.1.0: + /diff@5.1.0: resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} engines: {node: '>=0.3.1'} dev: true - /dir-glob/3.0.1: + /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} dependencies: path-type: 4.0.0 dev: true - /doctrine/3.0.0: + /doctrine@3.0.0: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} dependencies: esutils: 2.0.3 dev: true - /eastasianwidth/0.2.0: + /domexception@4.0.0: + resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} + engines: {node: '>=12'} + dependencies: + webidl-conversions: 7.0.0 + dev: false + + /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /ecc-jsbn/0.1.2: + /ecc-jsbn@0.1.2: resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==} dependencies: jsbn: 0.1.1 safer-buffer: 2.1.2 dev: true - /electron-to-chromium/1.4.317: + /electron-to-chromium@1.4.317: resolution: {integrity: sha512-JhCRm9v30FMNzQSsjl4kXaygU+qHBD0Yh7mKxyjmF0V8VwYVB6qpBRX28GyAucrM9wDCpSUctT6FpMUQxbyKuA==} dev: true - /emittery/0.11.0: + /emittery@0.11.0: resolution: {integrity: sha512-S/7tzL6v5i+4iJd627Nhv9cLFIo5weAIlGccqJFpnBoDB8U1TF2k5tez4J/QNuxyyhWuFqHg1L84Kd3m7iXg6g==} engines: {node: '>=12'} dev: true - /emoji-regex/8.0.0: + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true - /emoji-regex/9.2.2: + /emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} dev: true - /enhance-visitors/1.0.0: + /enhance-visitors@1.0.0: resolution: {integrity: sha512-+29eJLiUixTEDRaZ35Vu8jP3gPLNcQQkQkOQjLp2X+6cZGGPDD/uasbFzvLsJKnGZnvmyZ0srxudwOtskHeIDA==} engines: {node: '>=4.0.0'} dependencies: lodash: 4.17.21 dev: true - /enhanced-resolve/5.12.0: + /enhanced-resolve@5.12.0: resolution: {integrity: sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==} engines: {node: '>=10.13.0'} dependencies: @@ -1368,59 +1483,64 @@ packages: tapable: 2.2.1 dev: true - /enquirer/2.3.6: + /enquirer@2.3.6: resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} engines: {node: '>=8.6'} dependencies: ansi-colors: 4.1.3 dev: true - /ensure-posix-path/1.1.1: + /ensure-posix-path@1.1.1: resolution: {integrity: sha512-VWU0/zXzVbeJNXvME/5EmLuEj2TauvoaTz6aFYK1Z92JCBlDlZ3Gu0tuGR42kpW1754ywTs+QB0g5TP0oj9Zaw==} dev: true - /envinfo/7.8.1: + /entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + dev: false + + /envinfo@7.8.1: resolution: {integrity: sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==} engines: {node: '>=4'} hasBin: true dev: true - /error-ex/1.3.2: + /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: is-arrayish: 0.2.1 dev: true - /es-module-lexer/0.9.3: + /es-module-lexer@0.9.3: resolution: {integrity: sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==} dev: true - /escalade/3.1.1: + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} dev: true - /escape-string-regexp/1.0.5: + /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} dev: true - /escape-string-regexp/2.0.0: + /escape-string-regexp@2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} engines: {node: '>=8'} dev: true - /escape-string-regexp/4.0.0: + /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} dev: true - /escape-string-regexp/5.0.0: + /escape-string-regexp@5.0.0: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} dev: true - /escodegen/1.14.3: + /escodegen@1.14.3: resolution: {integrity: sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==} engines: {node: '>=4.0'} hasBin: true @@ -1433,7 +1553,20 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-google/0.14.0_eslint@7.32.0: + /escodegen@2.0.0: + resolution: {integrity: sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==} + engines: {node: '>=6.0'} + hasBin: true + dependencies: + esprima: 4.0.1 + estraverse: 5.3.0 + esutils: 2.0.3 + optionator: 0.8.3 + optionalDependencies: + source-map: 0.6.1 + dev: false + + /eslint-config-google@0.14.0(eslint@7.32.0): resolution: {integrity: sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==} engines: {node: '>=0.10.0'} peerDependencies: @@ -1442,7 +1575,7 @@ packages: eslint: 7.32.0 dev: true - /eslint-plugin-ava/12.0.0_eslint@7.32.0: + /eslint-plugin-ava@12.0.0(eslint@7.32.0): resolution: {integrity: sha512-v8/GY1IWQn2nOBdVtD/6e0Y6A9PRFjY86a1m5r5FUel+C7iyoQVt7gKqaAc1iRXcQkZq2DDG0aTiQptgnq51cA==} engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} peerDependencies: @@ -1460,7 +1593,7 @@ packages: resolve-from: 5.0.0 dev: true - /eslint-plugin-camelcase-ohm/0.2.1_eslint@7.32.0: + /eslint-plugin-camelcase-ohm@0.2.1(eslint@7.32.0): resolution: {integrity: sha512-RJf2RxSQXcDxVX4yZGY/8Lm6e8ckaCP8FZVfpfBcTkGFw57cvEzAzYzf6WP1GVoghrfy8jeEbTf/61xpvqEQ+g==} peerDependencies: eslint: '>=0.8.0' @@ -1468,7 +1601,7 @@ packages: eslint: 7.32.0 dev: true - /eslint-plugin-no-extension-in-require/0.2.0_eslint@7.32.0: + /eslint-plugin-no-extension-in-require@0.2.0(eslint@7.32.0): resolution: {integrity: sha512-2fFBGh5PJTce9FfLKekY8xxsipXMFwdozpId3mq+Nj1ERgeq/C9VSMxS4LEheAkao5ktBsYH5ww+pSoOHtD2rw==} peerDependencies: eslint: '>=0.8.0' @@ -1476,7 +1609,7 @@ packages: eslint: 7.32.0 dev: true - /eslint-scope/5.1.1: + /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} dependencies: @@ -1484,24 +1617,24 @@ packages: estraverse: 4.3.0 dev: true - /eslint-utils/2.1.0: + /eslint-utils@2.1.0: resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} engines: {node: '>=6'} dependencies: eslint-visitor-keys: 1.3.0 dev: true - /eslint-visitor-keys/1.3.0: + /eslint-visitor-keys@1.3.0: resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} engines: {node: '>=4'} dev: true - /eslint-visitor-keys/2.1.0: + /eslint-visitor-keys@2.1.0: resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} engines: {node: '>=10'} dev: true - /eslint/7.32.0: + /eslint@7.32.0: resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} engines: {node: ^10.12.0 || >=12.0.0} hasBin: true @@ -1550,85 +1683,82 @@ packages: - supports-color dev: true - /espree/7.3.1: + /espree@7.3.1: resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: acorn: 7.4.1 - acorn-jsx: 5.3.2_acorn@7.4.1 + acorn-jsx: 5.3.2(acorn@7.4.1) eslint-visitor-keys: 1.3.0 dev: true - /esprima/4.0.1: + /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - dev: true - /espurify/2.1.1: + /espurify@2.1.1: resolution: {integrity: sha512-zttWvnkhcDyGOhSH4vO2qCBILpdCMv/MX8lp4cqgRkQoDRGK2oZxi2GfWhlP2dIXmk7BaKeOTuzbHhyC68o8XQ==} dev: true - /esquery/1.5.0: + /esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} engines: {node: '>=0.10'} dependencies: estraverse: 5.3.0 dev: true - /esrecurse/4.3.0: + /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} dependencies: estraverse: 5.3.0 dev: true - /estraverse/4.3.0: + /estraverse@4.3.0: resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} engines: {node: '>=4.0'} dev: true - /estraverse/5.3.0: + /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} - dev: true - /estree-walker/1.0.1: + /estree-walker@1.0.1: resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} dev: true - /estree-walker/2.0.2: + /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true - /esutils/2.0.3: + /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - dev: true - /events/3.3.0: + /events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} dev: true - /extend/3.0.2: + /extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} dev: true - /extsprintf/1.3.0: + /extsprintf@1.3.0: resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} engines: {'0': node >=0.6.0} dev: true - /fast-deep-equal/3.1.3: + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-diff/1.2.0: + /fast-diff@1.2.0: resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} dev: true - /fast-glob/3.2.12: + /fast-glob@3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} dependencies: @@ -1638,25 +1768,24 @@ packages: merge2: 1.4.1 micromatch: 4.0.5 - /fast-json-stable-stringify/2.1.0: + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true - /fast-levenshtein/2.0.6: + /fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true - /fastest-levenshtein/1.0.16: + /fastest-levenshtein@1.0.16: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} engines: {node: '>= 4.9.1'} dev: true - /fastq/1.15.0: + /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 - /figures/4.0.1: + /figures@4.0.1: resolution: {integrity: sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==} engines: {node: '>=12'} dependencies: @@ -1664,20 +1793,20 @@ packages: is-unicode-supported: 1.3.0 dev: true - /file-entry-cache/6.0.1: + /file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: flat-cache: 3.0.4 dev: true - /fill-range/7.0.1: + /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - /find-up/4.1.0: + /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} dependencies: @@ -1685,7 +1814,7 @@ packages: path-exists: 4.0.0 dev: true - /find-up/5.0.0: + /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} dependencies: @@ -1693,7 +1822,7 @@ packages: path-exists: 4.0.0 dev: true - /find-up/6.3.0: + /find-up@6.3.0: resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: @@ -1701,14 +1830,14 @@ packages: path-exists: 5.0.0 dev: true - /find-versions/4.0.0: + /find-versions@4.0.0: resolution: {integrity: sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==} engines: {node: '>=10'} dependencies: semver-regex: 3.1.4 dev: true - /flat-cache/3.0.4: + /flat-cache@3.0.4: resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: @@ -1716,20 +1845,20 @@ packages: rimraf: 3.0.2 dev: true - /flatted/3.2.7: + /flatted@3.2.7: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true - /fn-name/2.0.1: + /fn-name@2.0.1: resolution: {integrity: sha512-oIDB1rXf3BUnn00bh2jVM0byuqr94rBh6g7ZfdKcbmp1we2GQtPzKdloyvBXHs+q3fvxB8EqX5ecFba3RwCSjA==} engines: {node: '>=0.10.0'} dev: true - /forever-agent/0.6.1: + /forever-agent@0.6.1: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} dev: true - /form-data/2.3.3: + /form-data@2.3.3: resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} engines: {node: '>= 0.12'} dependencies: @@ -1738,11 +1867,20 @@ packages: mime-types: 2.1.35 dev: true - /fs.realpath/1.0.0: + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + + /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true - /fsevents/2.3.2: + /fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] @@ -1750,36 +1888,36 @@ packages: dev: true optional: true - /function-bind/1.1.1: + /function-bind@1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true - /functional-red-black-tree/1.0.1: + /functional-red-black-tree@1.0.1: resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} dev: true - /get-caller-file/2.0.5: + /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} dev: true - /getpass/0.1.7: + /getpass@0.1.7: resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} dependencies: assert-plus: 1.0.0 dev: true - /glob-parent/5.1.2: + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 - /glob-to-regexp/0.4.1: + /glob-to-regexp@0.4.1: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} dev: true - /glob/7.2.3: + /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: fs.realpath: 1.0.0 @@ -1790,14 +1928,14 @@ packages: path-is-absolute: 1.0.1 dev: true - /globals/13.20.0: + /globals@13.20.0: resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 dev: true - /globby/11.1.0: + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} dependencies: @@ -1809,7 +1947,7 @@ packages: slash: 3.0.0 dev: true - /globby/13.1.3: + /globby@13.1.3: resolution: {integrity: sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: @@ -1820,16 +1958,16 @@ packages: slash: 4.0.0 dev: true - /graceful-fs/4.2.10: + /graceful-fs@4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true - /har-schema/2.0.0: + /har-schema@2.0.0: resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==} engines: {node: '>=4'} dev: true - /har-validator/5.1.5: + /har-validator@5.1.5: resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==} engines: {node: '>=6'} deprecated: this library is no longer supported @@ -1838,30 +1976,48 @@ packages: har-schema: 2.0.0 dev: true - /has-flag/3.0.0: + /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} dev: true - /has-flag/4.0.0: + /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} dev: true - /has/1.0.3: + /has@1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 dev: true - /html-encoding-sniffer/1.0.2: + /html-encoding-sniffer@1.0.2: resolution: {integrity: sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==} dependencies: whatwg-encoding: 1.0.5 dev: true - /http-signature/1.2.0: + /html-encoding-sniffer@3.0.0: + resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} + engines: {node: '>=12'} + dependencies: + whatwg-encoding: 2.0.0 + dev: false + + /http-proxy-agent@5.0.0: + resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 2.0.0 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /http-signature@1.2.0: resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==} engines: {node: '>=0.8', npm: '>=1.3.7'} dependencies: @@ -1870,7 +2026,17 @@ packages: sshpk: 1.17.0 dev: true - /husky/4.3.8: + /https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /husky@4.3.8: resolution: {integrity: sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==} engines: {node: '>=10'} hasBin: true @@ -1888,29 +2054,36 @@ packages: which-pm-runs: 1.1.0 dev: true - /iconv-lite/0.4.24: + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 dev: true - /ignore-by-default/2.1.0: + /iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: false + + /ignore-by-default@2.1.0: resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} engines: {node: '>=10 <11 || >=12 <13 || >=14'} dev: true - /ignore/4.0.6: + /ignore@4.0.6: resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} engines: {node: '>= 4'} dev: true - /ignore/5.2.4: + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} dev: true - /import-fresh/3.3.0: + /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} dependencies: @@ -1918,7 +2091,7 @@ packages: resolve-from: 4.0.0 dev: true - /import-local/3.1.0: + /import-local@3.1.0: resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} engines: {node: '>=8'} hasBin: true @@ -1927,158 +2100,162 @@ packages: resolve-cwd: 3.0.0 dev: true - /import-modules/2.1.0: + /import-modules@2.1.0: resolution: {integrity: sha512-8HEWcnkbGpovH9yInoisxaSoIg9Brbul+Ju3Kqe2UsYDUBJD/iQjSgEj0zPcTDPKfPp2fs5xlv1i+JSye/m1/A==} engines: {node: '>=8'} dev: true - /imurmurhash/0.1.4: + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} dev: true - /indent-string/4.0.0: + /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} dev: true - /indent-string/5.0.0: + /indent-string@5.0.0: resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} engines: {node: '>=12'} dev: true - /inflight/1.0.6: + /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} dependencies: once: 1.4.0 wrappy: 1.0.2 dev: true - /inherits/2.0.4: + /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true - /interpret/2.2.0: + /interpret@2.2.0: resolution: {integrity: sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==} engines: {node: '>= 0.10'} dev: true - /irregular-plurals/3.4.1: + /irregular-plurals@3.4.1: resolution: {integrity: sha512-JR7VL+1Kd9z79bE+2uSgifpzrTwLWmTvyeUewhxZCHVtpPImAsLk4adfRxg86uvdsJ8etYYrpzN7vRT30gGnOA==} engines: {node: '>=8'} dev: true - /is-arrayish/0.2.1: + /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true - /is-binary-path/2.1.0: + /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} dependencies: binary-extensions: 2.2.0 dev: true - /is-builtin-module/3.2.1: + /is-builtin-module@3.2.1: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} engines: {node: '>=6'} dependencies: builtin-modules: 3.3.0 dev: true - /is-core-module/2.11.0: + /is-core-module@2.11.0: resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} dependencies: has: 1.0.3 dev: true - /is-error/2.2.2: + /is-error@2.2.2: resolution: {integrity: sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==} dev: true - /is-extglob/2.1.1: + /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - /is-fullwidth-code-point/3.0.0: + /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} dev: true - /is-fullwidth-code-point/4.0.0: + /is-fullwidth-code-point@4.0.0: resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} engines: {node: '>=12'} dev: true - /is-glob/4.0.3: + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 - /is-module/1.0.0: + /is-module@1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} dev: true - /is-number/7.0.0: + /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - /is-path-cwd/2.2.0: + /is-path-cwd@2.2.0: resolution: {integrity: sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==} engines: {node: '>=6'} dev: true - /is-path-inside/3.0.3: + /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} dev: true - /is-plain-object/2.0.4: + /is-plain-object@2.0.4: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} dependencies: isobject: 3.0.1 dev: true - /is-plain-object/5.0.0: + /is-plain-object@5.0.0: resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} engines: {node: '>=0.10.0'} dev: true - /is-promise/4.0.0: + /is-potential-custom-element-name@1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + dev: false + + /is-promise@4.0.0: resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} dev: true - /is-reference/1.2.1: + /is-reference@1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: '@types/estree': 1.0.0 dev: true - /is-typedarray/1.0.0: + /is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} dev: true - /is-unicode-supported/1.3.0: + /is-unicode-supported@1.3.0: resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} engines: {node: '>=12'} dev: true - /isexe/2.0.0: + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true - /isobject/3.0.1: + /isobject@3.0.1: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} dev: true - /isstream/0.1.2: + /isstream@0.1.2: resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} dev: true - /jest-worker/27.5.1: + /jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: @@ -2087,16 +2264,16 @@ packages: supports-color: 8.1.1 dev: true - /js-string-escape/1.0.1: + /js-string-escape@1.0.1: resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} engines: {node: '>= 0.8'} dev: true - /js-tokens/4.0.0: + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true - /js-yaml/3.14.1: + /js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true dependencies: @@ -2104,11 +2281,52 @@ packages: esprima: 4.0.1 dev: true - /jsbn/0.1.1: + /jsbn@0.1.1: resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} dev: true - /jsdom/9.12.0: + /jsdom@21.1.2: + resolution: {integrity: sha512-sCpFmK2jv+1sjff4u7fzft+pUh2KSUbUrEHYHyfSIbGTIcmnjyp83qg6qLwdJ/I3LpTXx33ACxeRL7Lsyc6lGQ==} + engines: {node: '>=14'} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + abab: 2.0.6 + acorn: 8.8.2 + acorn-globals: 7.0.1 + cssstyle: 3.0.0 + data-urls: 4.0.0 + decimal.js: 10.4.3 + domexception: 4.0.0 + escodegen: 2.0.0 + form-data: 4.0.0 + html-encoding-sniffer: 3.0.0 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.4 + parse5: 7.1.2 + rrweb-cssom: 0.6.0 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 4.1.2 + w3c-xmlserializer: 4.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 2.0.0 + whatwg-mimetype: 3.0.0 + whatwg-url: 12.0.1 + ws: 8.13.0 + xml-name-validator: 4.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + + /jsdom@9.12.0: resolution: {integrity: sha512-Qw4oqNxo4LyzkSqVIyCnEltTc4xV3g1GBaI88AvYTesWzmWHUSoMNmhBjUBa+6ldXIBJS9xoeLNJPfUAykTyxw==} dependencies: abab: 1.0.4 @@ -2132,37 +2350,37 @@ packages: xml-name-validator: 2.0.1 dev: true - /json-parse-even-better-errors/2.3.1: + /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true - /json-schema-traverse/0.4.1: + /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} dev: true - /json-schema-traverse/1.0.0: + /json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} dev: true - /json-schema/0.4.0: + /json-schema@0.4.0: resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} dev: true - /json-stable-stringify-without-jsonify/1.0.1: + /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true - /json-stringify-safe/5.0.1: + /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} dev: true - /json/9.0.6: + /json@9.0.6: resolution: {integrity: sha512-Nx+4WwMM1xadgqjjteOVEyjoIVq7fGH1hAlRDoxoq2tFzYsBYZDIKwYbyxolkTYwxsSOgAZD2ACLkeGjhFW2Jw==} engines: {node: '>=0.10.0'} hasBin: true dev: true - /jsprim/1.4.2: + /jsprim@1.4.2: resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==} engines: {node: '>=0.6.0'} dependencies: @@ -2172,25 +2390,24 @@ packages: verror: 1.10.0 dev: true - /kind-of/6.0.3: + /kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} dev: true - /kleur/4.1.5: + /kleur@4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} dev: true - /levn/0.3.0: + /levn@0.3.0: resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==} engines: {node: '>= 0.8.0'} dependencies: prelude-ls: 1.1.2 type-check: 0.3.2 - dev: true - /levn/0.4.1: + /levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} dependencies: @@ -2198,82 +2415,82 @@ packages: type-check: 0.4.0 dev: true - /lines-and-columns/1.2.4: + /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /load-json-file/7.0.1: + /load-json-file@7.0.1: resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /loader-runner/4.3.0: + /loader-runner@4.3.0: resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} engines: {node: '>=6.11.5'} dev: true - /locate-path/5.0.0: + /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} dependencies: p-locate: 4.1.0 dev: true - /locate-path/6.0.0: + /locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} dependencies: p-locate: 5.0.0 dev: true - /locate-path/7.2.0: + /locate-path@7.2.0: resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: p-locate: 6.0.0 dev: true - /lodash.merge/4.6.2: + /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true - /lodash.truncate/4.4.2: + /lodash.truncate@4.4.2: resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} dev: true - /lodash/4.17.21: + /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true - /lru-cache/6.0.0: + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} dependencies: yallist: 4.0.0 dev: true - /magic-string/0.25.9: + /magic-string@0.25.9: resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} dependencies: sourcemap-codec: 1.4.8 dev: true - /make-error/1.3.6: + /make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true - /map-age-cleaner/0.1.3: + /map-age-cleaner@0.1.3: resolution: {integrity: sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==} engines: {node: '>=6'} dependencies: p-defer: 1.0.0 dev: true - /marked-ast/0.2.2: + /marked-ast@0.2.2: resolution: {integrity: sha512-Yu7pvs6YJ68HfIM/Iv42BzjZ89sT6QbyDWfYdrQvwzlNqDCZeTijWMMVfFTqeZuHY5dC48UuILq3QpW7x2kF3g==} dev: true - /markscript/0.5.0: + /markscript@0.5.0: resolution: {integrity: sha512-uKC9m/21NeEBT53nRGqQ6m+4P4/ZbtQ85MAOl9rNbJiJoyna7YTSU0ChAdA69fEwDpXOGnx5ECy6Wf0FFC8gHA==} hasBin: true dependencies: @@ -2281,7 +2498,7 @@ packages: marked-ast: 0.2.2 dev: true - /matcher-collection/2.0.1: + /matcher-collection@2.0.1: resolution: {integrity: sha512-daE62nS2ZQsDg9raM0IlZzLmI2u+7ZapXBwdoeBUKAYERPDDIc0qNqA8E0Rp2D+gspKR7BgIFP52GeujaGXWeQ==} engines: {node: 6.* || 8.* || >= 10.*} dependencies: @@ -2289,21 +2506,21 @@ packages: minimatch: 3.1.2 dev: true - /matcher/5.0.0: + /matcher@5.0.0: resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: escape-string-regexp: 5.0.0 dev: true - /md5-hex/3.0.1: + /md5-hex@3.0.1: resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} engines: {node: '>=8'} dependencies: blueimp-md5: 2.19.0 dev: true - /mem/9.0.2: + /mem@9.0.2: resolution: {integrity: sha512-F2t4YIv9XQUBHt6AOJ0y7lSmP1+cY7Fm1DRh9GClTGzKST7UWLMx6ly9WZdLH/G/ppM5RL4MlQfRT71ri9t19A==} engines: {node: '>=12.20'} dependencies: @@ -2311,90 +2528,87 @@ packages: mimic-fn: 4.0.0 dev: true - /merge-stream/2.0.0: + /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true - /merge2/1.4.1: + /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - /micro-spelling-correcter/1.1.1: + /micro-spelling-correcter@1.1.1: resolution: {integrity: sha512-lkJ3Rj/mtjlRcHk6YyCbvZhyWTOzdBvTHsxMmZSk5jxN1YyVSQ+JETAom55mdzfcyDrY/49Z7UCW760BK30crg==} dev: true - /micromatch/4.0.5: + /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} dependencies: braces: 3.0.2 picomatch: 2.3.1 - /mime-db/1.52.0: + /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} - dev: true - /mime-types/2.1.35: + /mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.52.0 - dev: true - /mime/1.6.0: + /mime@1.6.0: resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} engines: {node: '>=4'} hasBin: true dev: true - /mimic-fn/4.0.0: + /mimic-fn@4.0.0: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} dev: true - /minimatch/3.1.2: + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 dev: true - /minimist/0.0.10: + /minimist@0.0.10: resolution: {integrity: sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==} dev: true - /mkdirp/1.0.4: + /mkdirp@1.0.4: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} hasBin: true dev: true - /mri/1.2.0: + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} dev: true - /ms/2.1.2: + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true - /ms/2.1.3: + /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: true - /natural-compare/1.4.0: + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true - /neo-async/2.6.2: + /neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true - /node-releases/2.0.10: + /node-releases@2.0.10: resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} dev: true - /node-static/0.7.11: + /node-static@0.7.11: resolution: {integrity: sha512-zfWC/gICcqb74D9ndyvxZWaI1jzcoHmf4UTHWQchBNuNMxdBLJMDiUgZ1tjGLEIe/BMhj2DxKD8HOuc2062pDQ==} engines: {node: '>= 0.4.1'} hasBin: true @@ -2404,55 +2618,59 @@ packages: optimist: 0.6.1 dev: true - /nofilter/3.1.0: + /nofilter@3.1.0: resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} engines: {node: '>=12.19'} dev: true - /normalize-path/3.0.0: + /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} dev: true - /nwmatcher/1.4.4: + /nwmatcher@1.4.4: resolution: {integrity: sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==} dev: true - /oauth-sign/0.9.0: + /nwsapi@2.2.4: + resolution: {integrity: sha512-NHj4rzRo0tQdijE9ZqAx6kYDcoRwYwSYzCA8MY3JzfxlrvEU0jhnhJT9BhqhJs7I/dKcrDm6TyulaRqZPIhN5g==} + dev: false + + /oauth-sign@0.9.0: resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} dev: true - /object-assign/4.1.1: + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} dev: true - /once/1.4.0: + /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 dev: true - /opencollective-postinstall/2.0.3: + /opencollective-postinstall@2.0.3: resolution: {integrity: sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==} hasBin: true dev: true - /optimist/0.6.1: + /optimist@0.6.1: resolution: {integrity: sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==} dependencies: minimist: 0.0.10 wordwrap: 0.0.3 dev: true - /option-chain/0.1.1: + /option-chain@0.1.1: resolution: {integrity: sha512-UsON6bnN9BuNmFV7odYf9XSKmUoaRfq/5ru5zCPK5vIzo23dtyhoWnHUBQ3cra8/W8+D33hkn/9OgKcWi2F+yg==} engines: {node: '>=0.10.0'} dependencies: object-assign: 4.1.1 dev: true - /optionator/0.8.3: + /optionator@0.8.3: resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} engines: {node: '>= 0.8.0'} dependencies: @@ -2462,9 +2680,8 @@ packages: prelude-ls: 1.1.2 type-check: 0.3.2 word-wrap: 1.2.3 - dev: true - /optionator/0.9.1: + /optionator@0.9.1: resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} engines: {node: '>= 0.8.0'} dependencies: @@ -2476,92 +2693,92 @@ packages: word-wrap: 1.2.3 dev: true - /p-defer/1.0.0: + /p-defer@1.0.0: resolution: {integrity: sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==} engines: {node: '>=4'} dev: true - /p-event/5.0.1: + /p-event@5.0.1: resolution: {integrity: sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: p-timeout: 5.1.0 dev: true - /p-limit/2.3.0: + /p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} dependencies: p-try: 2.2.0 dev: true - /p-limit/3.1.0: + /p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 dev: true - /p-limit/4.0.0: + /p-limit@4.0.0: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: yocto-queue: 1.0.0 dev: true - /p-locate/4.1.0: + /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} dependencies: p-limit: 2.3.0 dev: true - /p-locate/5.0.0: + /p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} dependencies: p-limit: 3.1.0 dev: true - /p-locate/6.0.0: + /p-locate@6.0.0: resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: p-limit: 4.0.0 dev: true - /p-map/4.0.0: + /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} dependencies: aggregate-error: 3.1.0 dev: true - /p-map/5.5.0: + /p-map@5.5.0: resolution: {integrity: sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==} engines: {node: '>=12'} dependencies: aggregate-error: 4.0.1 dev: true - /p-timeout/5.1.0: + /p-timeout@5.1.0: resolution: {integrity: sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==} engines: {node: '>=12'} dev: true - /p-try/2.2.0: + /p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} dev: true - /parent-module/1.0.1: + /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} dependencies: callsites: 3.1.0 dev: true - /parse-json/5.2.0: + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: @@ -2571,61 +2788,67 @@ packages: lines-and-columns: 1.2.4 dev: true - /parse-ms/2.1.0: + /parse-ms@2.1.0: resolution: {integrity: sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==} engines: {node: '>=6'} dev: true - /parse5/1.5.1: + /parse5@1.5.1: resolution: {integrity: sha512-w2jx/0tJzvgKwZa58sj2vAYq/S/K1QJfIB3cWYea/Iu1scFPDQQ3IQiVZTHWtRBwAjv2Yd7S/xeZf3XqLDb3bA==} dev: true - /path-browserify/1.0.1: + /parse5@7.1.2: + resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} + dependencies: + entities: 4.5.0 + dev: false + + /path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} dev: true - /path-exists/4.0.0: + /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} dev: true - /path-exists/5.0.0: + /path-exists@5.0.0: resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /path-is-absolute/1.0.1: + /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} dev: true - /path-key/3.1.1: + /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} dev: true - /path-parse/1.0.7: + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true - /path-type/4.0.0: + /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} dev: true - /performance-now/2.1.0: + /performance-now@2.1.0: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} dev: true - /picocolors/1.0.0: + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true - /picomatch/2.3.1: + /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - /pkg-conf/4.0.0: + /pkg-conf@4.0.0: resolution: {integrity: sha512-7dmgi4UY4qk+4mj5Cd8v/GExPo0K+SlY+hulOSdfZ/T6jVH6//y7NtzZo5WrfhDBxuQ0jCa7fLZmNaNh7EWL/w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: @@ -2633,104 +2856,105 @@ packages: load-json-file: 7.0.1 dev: true - /pkg-dir/4.2.0: + /pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} dependencies: find-up: 4.1.0 dev: true - /pkg-dir/5.0.0: + /pkg-dir@5.0.0: resolution: {integrity: sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==} engines: {node: '>=10'} dependencies: find-up: 5.0.0 dev: true - /please-upgrade-node/3.2.0: + /please-upgrade-node@3.2.0: resolution: {integrity: sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==} dependencies: semver-compare: 1.0.0 dev: true - /plur/5.1.0: + /plur@5.1.0: resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: irregular-plurals: 3.4.1 dev: true - /prelude-ls/1.1.2: + /prelude-ls@1.1.2: resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} engines: {node: '>= 0.8.0'} - dev: true - /prelude-ls/1.2.1: + /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} dev: true - /prettier/2.8.4: + /prettier@2.8.4: resolution: {integrity: sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==} engines: {node: '>=10.13.0'} hasBin: true dev: true - /pretty-ms/7.0.1: + /pretty-ms@7.0.1: resolution: {integrity: sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==} engines: {node: '>=10'} dependencies: parse-ms: 2.1.0 dev: true - /progress/2.0.3: + /progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} dev: true - /psl/1.9.0: + /psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} - dev: true - /punycode/2.3.0: + /punycode@2.3.0: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} - dev: true - /qs/6.5.3: + /qs@6.5.3: resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} engines: {node: '>=0.6'} dev: true - /queue-microtask/1.2.3: + /querystringify@2.2.0: + resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} + dev: false + + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - /randombytes/2.1.0: + /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: safe-buffer: 5.2.1 dev: true - /readdirp/3.6.0: + /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} dependencies: picomatch: 2.3.1 dev: true - /rechoir/0.7.1: + /rechoir@0.7.1: resolution: {integrity: sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==} engines: {node: '>= 0.10'} dependencies: resolve: 1.22.1 dev: true - /regexpp/3.2.0: + /regexpp@3.2.0: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} engines: {node: '>=8'} dev: true - /request/2.88.2: + /request@2.88.2: resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==} engines: {node: '>= 6'} deprecated: request has been deprecated, see https://github.com/request/request/issues/3142 @@ -2757,34 +2981,38 @@ packages: uuid: 3.4.0 dev: true - /require-directory/2.1.1: + /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} dev: true - /require-from-string/2.0.2: + /require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} dev: true - /resolve-cwd/3.0.0: + /requires-port@1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: false + + /resolve-cwd@3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} engines: {node: '>=8'} dependencies: resolve-from: 5.0.0 dev: true - /resolve-from/4.0.0: + /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} dev: true - /resolve-from/5.0.0: + /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} dev: true - /resolve/1.22.1: + /resolve@1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true dependencies: @@ -2793,18 +3021,18 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /reusify/1.0.4: + /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - /rimraf/3.0.2: + /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} hasBin: true dependencies: glob: 7.2.3 dev: true - /rollup/2.79.1: + /rollup@2.79.1: resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} engines: {node: '>=10.0.0'} hasBin: true @@ -2812,7 +3040,7 @@ packages: fsevents: 2.3.2 dev: true - /rollup/3.18.0: + /rollup@3.18.0: resolution: {integrity: sha512-J8C6VfEBjkvYPESMQYxKHxNOh4A5a3FlP+0BETGo34HEcE4eTlgCrO2+eWzlu2a/sHs2QUkZco+wscH7jhhgWg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true @@ -2820,49 +3048,59 @@ packages: fsevents: 2.3.2 dev: true - /run-parallel/1.2.0: + /rrweb-cssom@0.6.0: + resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==} + dev: false + + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - /sade/1.8.1: + /sade@1.8.1: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} dependencies: mri: 1.2.0 dev: true - /safe-buffer/5.2.1: + /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true - /safer-buffer/2.1.2: + /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: true - /sax/1.2.4: + /sax@1.2.4: resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} dev: true - /schema-utils/3.1.1: + /saxes@6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + dependencies: + xmlchars: 2.2.0 + dev: false + + /schema-utils@3.1.1: resolution: {integrity: sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==} engines: {node: '>= 10.13.0'} dependencies: '@types/json-schema': 7.0.11 ajv: 6.12.6 - ajv-keywords: 3.5.2_ajv@6.12.6 + ajv-keywords: 3.5.2(ajv@6.12.6) dev: true - /semver-compare/1.0.0: + /semver-compare@1.0.0: resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==} dev: true - /semver-regex/3.1.4: + /semver-regex@3.1.4: resolution: {integrity: sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==} engines: {node: '>=8'} dev: true - /semver/7.3.8: + /semver@7.3.8: resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} engines: {node: '>=10'} hasBin: true @@ -2870,53 +3108,53 @@ packages: lru-cache: 6.0.0 dev: true - /serialize-error/7.0.1: + /serialize-error@7.0.1: resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} engines: {node: '>=10'} dependencies: type-fest: 0.13.1 dev: true - /serialize-javascript/6.0.1: + /serialize-javascript@6.0.1: resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} dependencies: randombytes: 2.1.0 dev: true - /shallow-clone/3.0.1: + /shallow-clone@3.0.1: resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} engines: {node: '>=8'} dependencies: kind-of: 6.0.3 dev: true - /shebang-command/2.0.0: + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 dev: true - /shebang-regex/3.0.0: + /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} dev: true - /signal-exit/3.0.7: + /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true - /slash/3.0.0: + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} dev: true - /slash/4.0.0: + /slash@4.0.0: resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} engines: {node: '>=12'} dev: true - /slice-ansi/4.0.0: + /slice-ansi@4.0.0: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} dependencies: @@ -2925,7 +3163,7 @@ packages: is-fullwidth-code-point: 3.0.0 dev: true - /slice-ansi/5.0.0: + /slice-ansi@5.0.0: resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} engines: {node: '>=12'} dependencies: @@ -2933,28 +3171,27 @@ packages: is-fullwidth-code-point: 4.0.0 dev: true - /source-map-support/0.5.21: + /source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} dependencies: buffer-from: 1.1.2 source-map: 0.6.1 dev: true - /source-map/0.6.1: + /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - dev: true - /sourcemap-codec/1.4.8: + /sourcemap-codec@1.4.8: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} deprecated: Please use @jridgewell/sourcemap-codec instead dev: true - /sprintf-js/1.0.3: + /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true - /sshpk/1.17.0: + /sshpk@1.17.0: resolution: {integrity: sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==} engines: {node: '>=0.10.0'} hasBin: true @@ -2970,14 +3207,14 @@ packages: tweetnacl: 0.14.5 dev: true - /stack-utils/2.0.6: + /stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} dependencies: escape-string-regexp: 2.0.0 dev: true - /string-width/4.2.3: + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} dependencies: @@ -2986,7 +3223,7 @@ packages: strip-ansi: 6.0.1 dev: true - /string-width/5.1.2: + /string-width@5.1.2: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} dependencies: @@ -2995,26 +3232,26 @@ packages: strip-ansi: 7.0.1 dev: true - /strip-ansi/6.0.1: + /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 dev: true - /strip-ansi/7.0.1: + /strip-ansi@7.0.1: resolution: {integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==} engines: {node: '>=12'} dependencies: ansi-regex: 6.0.1 dev: true - /strip-json-comments/3.1.1: + /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} dev: true - /supertap/3.0.1: + /supertap@3.0.1: resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: @@ -3024,37 +3261,36 @@ packages: strip-ansi: 7.0.1 dev: true - /supports-color/5.5.0: + /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} dependencies: has-flag: 3.0.0 dev: true - /supports-color/7.2.0: + /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} dependencies: has-flag: 4.0.0 dev: true - /supports-color/8.1.1: + /supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} dependencies: has-flag: 4.0.0 dev: true - /supports-preserve-symlinks-flag/1.0.0: + /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} dev: true - /symbol-tree/3.2.4: + /symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - dev: true - /table/6.8.1: + /table@6.8.1: resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==} engines: {node: '>=10.0.0'} dependencies: @@ -3065,17 +3301,17 @@ packages: strip-ansi: 6.0.1 dev: true - /tapable/2.2.1: + /tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} dev: true - /temp-dir/2.0.0: + /temp-dir@2.0.0: resolution: {integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==} engines: {node: '>=8'} dev: true - /terser-webpack-plugin/5.3.6_webpack@5.75.0: + /terser-webpack-plugin@5.3.6(webpack@5.75.0): resolution: {integrity: sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -3096,10 +3332,10 @@ packages: schema-utils: 3.1.1 serialize-javascript: 6.0.1 terser: 5.16.5 - webpack: 5.75.0_webpack-cli@4.10.0 + webpack: 5.75.0(webpack-cli@4.10.0) dev: true - /terser/5.16.5: + /terser@5.16.5: resolution: {integrity: sha512-qcwfg4+RZa3YvlFh0qjifnzBHjKGNbtDo9yivMqMFDy9Q6FSaQWSB/j1xKhsoUFJIqDOM3TsN6D5xbrMrFcHbg==} engines: {node: '>=10'} hasBin: true @@ -3110,22 +3346,22 @@ packages: source-map-support: 0.5.21 dev: true - /text-table/0.2.0: + /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /time-zone/1.0.0: + /time-zone@1.0.0: resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} engines: {node: '>=4'} dev: true - /to-regex-range/5.0.1: + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 - /tough-cookie/2.5.0: + /tough-cookie@2.5.0: resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==} engines: {node: '>=0.8'} dependencies: @@ -3133,23 +3369,40 @@ packages: punycode: 2.3.0 dev: true - /tr46/0.0.3: + /tough-cookie@4.1.2: + resolution: {integrity: sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==} + engines: {node: '>=6'} + dependencies: + psl: 1.9.0 + punycode: 2.3.0 + universalify: 0.2.0 + url-parse: 1.5.10 + dev: false + + /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true - /ts-dedent/2.2.0: + /tr46@4.1.1: + resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==} + engines: {node: '>=14'} + dependencies: + punycode: 2.3.0 + dev: false + + /ts-dedent@2.2.0: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} engines: {node: '>=6.10'} dev: true - /ts-morph/12.2.0: + /ts-morph@12.2.0: resolution: {integrity: sha512-WHXLtFDcIRwoqaiu0elAoZ/AmI+SwwDafnPKjgJmdwJ2gRVO0jMKBt88rV2liT/c6MTsXyuWbGFiHe9MRddWJw==} dependencies: '@ts-morph/common': 0.11.1 code-block-writer: 10.1.1 dev: true - /ts-node/10.9.1_zix2iy4c4a7fivhrc3ey4gy2pu: + /ts-node@10.9.1(@types/node@16.18.14)(typescript@4.9.5): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -3180,47 +3433,51 @@ packages: yn: 3.1.1 dev: true - /tunnel-agent/0.6.0: + /tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} dependencies: safe-buffer: 5.2.1 dev: true - /tweetnacl/0.14.5: + /tweetnacl@0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} dev: true - /type-check/0.3.2: + /type-check@0.3.2: resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} engines: {node: '>= 0.8.0'} dependencies: prelude-ls: 1.1.2 - dev: true - /type-check/0.4.0: + /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} dependencies: prelude-ls: 1.2.1 dev: true - /type-fest/0.13.1: + /type-fest@0.13.1: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} dev: true - /type-fest/0.20.2: + /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} dev: true - /typescript/4.9.5: + /typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} hasBin: true dev: true - /update-browserslist-db/1.0.10_browserslist@4.21.5: + /universalify@0.2.0: + resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} + engines: {node: '>= 4.0.0'} + dev: false + + /update-browserslist-db@1.0.10(browserslist@4.21.5): resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} hasBin: true peerDependencies: @@ -3231,19 +3488,26 @@ packages: picocolors: 1.0.0 dev: true - /uri-js/4.4.1: + /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.0 dev: true - /uuid/3.4.0: + /url-parse@1.5.10: + resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + dependencies: + querystringify: 2.2.0 + requires-port: 1.0.0 + dev: false + + /uuid@3.4.0: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. hasBin: true dev: true - /uvu/0.5.6: + /uvu@0.5.6: resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} engines: {node: '>=8'} hasBin: true @@ -3254,15 +3518,15 @@ packages: sade: 1.8.1 dev: true - /v8-compile-cache-lib/3.0.1: + /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /v8-compile-cache/2.3.0: + /v8-compile-cache@2.3.0: resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} dev: true - /verror/1.10.0: + /verror@1.10.0: resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} engines: {'0': node >=0.6.0} dependencies: @@ -3271,7 +3535,14 @@ packages: extsprintf: 1.3.0 dev: true - /walk-sync/2.2.0: + /w3c-xmlserializer@4.0.0: + resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} + engines: {node: '>=14'} + dependencies: + xml-name-validator: 4.0.0 + dev: false + + /walk-sync@2.2.0: resolution: {integrity: sha512-IC8sL7aB4/ZgFcGI2T1LczZeFWZ06b3zoHH7jBPyHxOtIIz1jppWHjjEXkOFvFojBVAK9pV7g47xOZ4LW3QLfg==} engines: {node: 8.* || >= 10.*} dependencies: @@ -3281,7 +3552,7 @@ packages: minimatch: 3.1.2 dev: true - /watchlist/0.3.1: + /watchlist@0.3.1: resolution: {integrity: sha512-m5r4bzxJ9eg07TT/O0Q49imFPD45ZTuQ3kaHwSpUJj1QwVd3pzit4UYOmySdmAP5Egkz6mB6hcAPuPfhIbNo0g==} engines: {node: '>=8'} hasBin: true @@ -3289,7 +3560,7 @@ packages: mri: 1.2.0 dev: true - /watchpack/2.4.0: + /watchpack@2.4.0: resolution: {integrity: sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==} engines: {node: '>=10.13.0'} dependencies: @@ -3297,15 +3568,20 @@ packages: graceful-fs: 4.2.10 dev: true - /webidl-conversions/3.0.1: + /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: true - /webidl-conversions/4.0.2: + /webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true - /webpack-cli/4.10.0_webpack@5.75.0: + /webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + dev: false + + /webpack-cli@4.10.0(webpack@5.75.0): resolution: {integrity: sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==} engines: {node: '>=10.13.0'} hasBin: true @@ -3326,9 +3602,9 @@ packages: optional: true dependencies: '@discoveryjs/json-ext': 0.5.7 - '@webpack-cli/configtest': 1.2.0_pda42hcaj7d62cr262fr632kue - '@webpack-cli/info': 1.5.0_webpack-cli@4.10.0 - '@webpack-cli/serve': 1.7.0_webpack-cli@4.10.0 + '@webpack-cli/configtest': 1.2.0(webpack-cli@4.10.0)(webpack@5.75.0) + '@webpack-cli/info': 1.5.0(webpack-cli@4.10.0) + '@webpack-cli/serve': 1.7.0(webpack-cli@4.10.0) colorette: 2.0.19 commander: 7.2.0 cross-spawn: 7.0.3 @@ -3336,11 +3612,11 @@ packages: import-local: 3.1.0 interpret: 2.2.0 rechoir: 0.7.1 - webpack: 5.75.0_webpack-cli@4.10.0 + webpack: 5.75.0(webpack-cli@4.10.0) webpack-merge: 5.8.0 dev: true - /webpack-merge/5.8.0: + /webpack-merge@5.8.0: resolution: {integrity: sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==} engines: {node: '>=10.0.0'} dependencies: @@ -3348,12 +3624,12 @@ packages: wildcard: 2.0.0 dev: true - /webpack-sources/3.2.3: + /webpack-sources@3.2.3: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} dev: true - /webpack/5.75.0_webpack-cli@4.10.0: + /webpack@5.75.0(webpack-cli@4.10.0): resolution: {integrity: sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==} engines: {node: '>=10.13.0'} hasBin: true @@ -3369,7 +3645,7 @@ packages: '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 acorn: 8.8.2 - acorn-import-assertions: 1.8.0_acorn@8.8.2 + acorn-import-assertions: 1.8.0(acorn@8.8.2) browserslist: 4.21.5 chrome-trace-event: 1.0.3 enhanced-resolve: 5.12.0 @@ -3384,9 +3660,9 @@ packages: neo-async: 2.6.2 schema-utils: 3.1.1 tapable: 2.2.1 - terser-webpack-plugin: 5.3.6_webpack@5.75.0 + terser-webpack-plugin: 5.3.6(webpack@5.75.0) watchpack: 2.4.0 - webpack-cli: 4.10.0_webpack@5.75.0 + webpack-cli: 4.10.0(webpack@5.75.0) webpack-sources: 3.2.3 transitivePeerDependencies: - '@swc/core' @@ -3394,30 +3670,50 @@ packages: - uglify-js dev: true - /well-known-symbols/2.0.0: + /well-known-symbols@2.0.0: resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} engines: {node: '>=6'} dev: true - /whatwg-encoding/1.0.5: + /whatwg-encoding@1.0.5: resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==} dependencies: iconv-lite: 0.4.24 dev: true - /whatwg-url/4.8.0: + /whatwg-encoding@2.0.0: + resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} + engines: {node: '>=12'} + dependencies: + iconv-lite: 0.6.3 + dev: false + + /whatwg-mimetype@3.0.0: + resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} + engines: {node: '>=12'} + dev: false + + /whatwg-url@12.0.1: + resolution: {integrity: sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==} + engines: {node: '>=14'} + dependencies: + tr46: 4.1.1 + webidl-conversions: 7.0.0 + dev: false + + /whatwg-url@4.8.0: resolution: {integrity: sha512-nUvUPuenPFtPfy/X+dAYh/TfRbTBlnXTM5iIfLseJFkkQewmpG9pGR6i87E9qL+lZaJzv+99kkQWoGOtLfkZQQ==} dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 dev: true - /which-pm-runs/1.1.0: + /which-pm-runs@1.1.0: resolution: {integrity: sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==} engines: {node: '>=4'} dev: true - /which/2.0.2: + /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} hasBin: true @@ -3425,21 +3721,20 @@ packages: isexe: 2.0.0 dev: true - /wildcard/2.0.0: + /wildcard@2.0.0: resolution: {integrity: sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==} dev: true - /word-wrap/1.2.3: + /word-wrap@1.2.3: resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} engines: {node: '>=0.10.0'} - dev: true - /wordwrap/0.0.3: + /wordwrap@0.0.3: resolution: {integrity: sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==} engines: {node: '>=0.4.0'} dev: true - /wrap-ansi/7.0.0: + /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} dependencies: @@ -3448,11 +3743,11 @@ packages: strip-ansi: 6.0.1 dev: true - /wrappy/1.0.2: + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true - /write-file-atomic/4.0.2: + /write-file-atomic@4.0.2: resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} dependencies: @@ -3460,30 +3755,52 @@ packages: signal-exit: 3.0.7 dev: true - /xml-name-validator/2.0.1: + /ws@8.13.0: + resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false + + /xml-name-validator@2.0.1: resolution: {integrity: sha512-jRKe/iQYMyVJpzPH+3HL97Lgu5HrCfii+qSo+TfjKHtOnvbnvdVfMYrn9Q34YV81M2e5sviJlI6Ko9y+nByzvA==} dev: true - /y18n/5.0.8: + /xml-name-validator@4.0.0: + resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} + engines: {node: '>=12'} + dev: false + + /xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + dev: false + + /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} dev: true - /yallist/4.0.0: + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true - /yaml/1.10.2: + /yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} dev: true - /yargs-parser/21.1.1: + /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} dev: true - /yargs/17.7.1: + /yargs@17.7.1: resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} engines: {node: '>=12'} dependencies: @@ -3496,17 +3813,17 @@ packages: yargs-parser: 21.1.1 dev: true - /yn/3.1.1: + /yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} dev: true - /yocto-queue/0.1.0: + /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true - /yocto-queue/1.0.0: + /yocto-queue@1.0.0: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} engines: {node: '>=12.20'} dev: true