SourceCharacter ::
> any Unicode code point
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 :: one of
<TAB> <VT> <FF> <SP> <NBSP> <ZWNBSP> <USP>
LineTerminator :: one of
<LF> <CR> <LS> <PS>
LineTerminatorSequence ::
<LF>
<CR> [lookahead != <LF> ]
<LS>
<PS>
<CR> <LF>
Comment ::
MultiLineComment
SingleLineComment
Comment ::
MultiLineComment
SingleLineComment
SingleLineHTMLOpenComment
SingleLineHTMLCloseComment
SingleLineDelimitedComment
MultiLineComment ::
`/*` MultiLineCommentChars? `*/`
MultiLineComment ::
`/*` FirstCommentLine? LineTerminator MultiLineCommentChars? `*/` HTMLCloseComment?
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
CommonToken ::
IdentifierName
Punctuator
NumericLiteral
StringLiteral
Template
IdentifierName ::
IdentifierStart
IdentifierName IdentifierPart
IdentifierStart ::
UnicodeIDStart
`$`
`_`
`\` UnicodeEscapeSequence
IdentifierPart ::
UnicodeIDContinue
`$`
`\` UnicodeEscapeSequence
<ZWNJ>
<ZWJ>
UnicodeIDStart ::
> any Unicode code point with the Unicode property “ID_Start”
UnicodeIDContinue ::
> any Unicode code point with the Unicode property “ID_Continue”
ReservedWord ::
Keyword
FutureReservedWord
NullLiteral
BooleanLiteral
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`
FutureReservedWord ::
`enum`
The following tokens are also considered to be |FutureReservedWord|s when parsing strict mode code:
Punctuator :: one of
`{` `(` `)` `[` `]`
`.` `...` `;` `,`
`<` `>` `<=` `>=`
`==` `!=` `===` `!==`
`+` `-` `*` `%` `**`
`++` `--`
`<<` `>>` `>>>`
`&` `|` `^`
`!` `~`
`&&` `||`
`?` `:`
`=` `+=` `-=` `*=` `%=` `**=` `<<=` `>>=` `>>>=` `&=` `|=` `^=`
`=>`
DivPunctuator :: one of
`/` `/=`
RightBracePunctuator ::
`}`
NullLiteral ::
`null`
BooleanLiteral :: one of
`true` `false`
NumericLiteral ::
DecimalLiteral
BinaryIntegerLiteral
OctalIntegerLiteral
HexIntegerLiteral
NumericLiteral ::
DecimalLiteral
BinaryIntegerLiteral
OctalIntegerLiteral
HexIntegerLiteral
LegacyOctalIntegerLiteral
DecimalLiteral ::
DecimalIntegerLiteral `.` DecimalDigits? ExponentPart?
`.` DecimalDigits ExponentPart?
DecimalIntegerLiteral ExponentPart?
DecimalIntegerLiteral ::
`0`
NonZeroDigit DecimalDigits?
DecimalIntegerLiteral ::
`0`
NonZeroDigit DecimalDigits?
NonOctalDecimalIntegerLiteral
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
DoubleStringCharacter ::
SourceCharacter but not one of `"` or `\` or U+0000 through U+001F
`\` EscapeSequence
SingleStringCharacter ::
SourceCharacter but not one of `'` or `\` or LineTerminator
`\` EscapeSequence
LineContinuation
LineContinuation ::
`\` LineTerminatorSequence
EscapeSequence ::
CharacterEscapeSequence
`0` [lookahead <! DecimalDigit]
HexEscapeSequence
UnicodeEscapeSequence
EscapeSequence ::
CharacterEscapeSequence
LegacyOctalEscapeSequence
HexEscapeSequence
UnicodeEscapeSequence
CharacterEscapeSequence ::
SingleEscapeCharacter
NonEscapeCharacter
SingleEscapeCharacter :: one of
`'` `"` `\` `b` `f` `n` `r` `t` `v`
NonEscapeCharacter ::
SourceCharacter but not one of EscapeCharacter or LineTerminator
EscapeCharacter :: one of
`'` `"` `\` `b` `f` `n` `r` `t` `v`
HexEscapeSequence ::
`x` HexDigit HexDigit
UnicodeEscapeSequence ::
`u` Hex4Digits
`u{` CodePoint `}`
Hex4Digits ::
HexDigit HexDigit HexDigit HexDigit
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 IdentifierPart
Template ::
NoSubstitutionTemplate
TemplateHead
NoSubstitutionTemplate ::
` `` TemplateCharacters? ` ``
TemplateHead ::
` `` TemplateCharacters? `${`
TemplateSubstitutionTail ::
TemplateMiddle
TemplateTail
TemplateMiddle ::
`}` TemplateCharacters? `${`
TemplateTail ::
`}` TemplateCharacters? ` ``
TemplateCharacters ::
TemplateCharacter TemplateCharacters?
TemplateCharacter ::
`$` [lookahead != `{` ]
`\` EscapeSequence
`\` NotEscapeSequence
LineContinuation
LineTerminatorSequence
SourceCharacter but not one of ` `` or `\` or `$` or LineTerminator
IdentifierReference[Yield, Await] :
Identifier
[~Yield] `yield`
[~Await] `await`
IdentifierReference : `yield`
IdentifierReference : `await`
IdentifierReference[Yield, Await] : Identifier
BindingIdentifier[Yield, Await] :
Identifier
`yield`
`await`
BindingIdentifier : `yield`
BindingIdentifier : `await`
BindingIdentifier[Yield, Await] : Identifier
BindingIdentifier :
Identifier
`yield`
`await`
Identifier ::
IdentifierName but not ReservedWord
Identifier[Yield, Await] :
Identifier
`yield`
`await`
AsyncArrowBindingIdentifier[Yield] :
BindingIdentifier[?Yield, +Await]
AsyncArrowBindingIdentifier : BindingIdentifier
AsyncArrowBindingIdentifier[Yield] : BindingIdentifier[?Yield, +Await]
LabelIdentifier[Yield, Await] :
Identifier
[~Yield] `yield`
[~Await] `await`
LabelIdentifier : `yield`
LabelIdentifier : `await`
LabelIdentifier[Yield, Await] : Identifier
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
PrimaryExpression :
`this`
IdentifierReference
Literal
ArrayLiteral
ObjectLiteral
RegularExpressionLiteral
TemplateLiteral
PrimaryExpression :
`this`
Literal
ArrayLiteral
ObjectLiteral
FunctionExpression
ClassExpression
GeneratorExpression
AsyncFunctionExpression
AsyncGeneratorExpression
RegularExpressionLiteral
TemplateLiteral
CoverParenthesizedExpressionAndArrowParameterList
PrimaryExpression :
`this`
Literal
ArrayLiteral
ObjectLiteral
FunctionExpression
ClassExpression
GeneratorExpression
AsyncFunctionExpression
AsyncGeneratorExpression
RegularExpressionLiteral
TemplateLiteral
PrimaryExpression :
`this`
IdentifierReference
Literal
ArrayLiteral
ObjectLiteral
FunctionExpression
ClassExpression
GeneratorExpression
AsyncFunctionExpression
AsyncGeneratorExpression
RegularExpressionLiteral
TemplateLiteral
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] `)`
CoverParenthesizedExpressionAndArrowParameterList :
`(` Expression `)`
`(` `)`
`(` `...` BindingIdentifier `)`
`(` `...` BindingPattern `)`
`(` Expression `,` `...` BindingIdentifier `)`
`(` Expression `,` `...` BindingPattern `)`
When processing an instance of the production |PrimaryExpression| the interpretation of |CoverParenthesizedExpressionAndArrowParameterList| is refined using the following grammar:
ParenthesizedExpression[Yield, Await] :
`(` Expression[+In, ?Yield, ?Await] `)`
ParenthesizedExpression :
`(` Expression `)`
Literal :
NullLiteral
BooleanLiteral
NumericLiteral
StringLiteral
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]
ObjectLiteral[Yield, Await] :
`{` `}`
`{` PropertyDefinitionList[?Yield, ?Await] `}`
`{` PropertyDefinitionList[?Yield, ?Await] `,` `}`
ObjectLiteral :
`{` PropertyDefinitionList `}`
`{` PropertyDefinitionList `,` `}`
ObjectLiteral : `{` PropertyDefinitionList `}`
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]
TemplateLiteral[Yield, Await, Tagged] :
NoSubstitutionTemplate
SubstitutionTemplate[?Yield, ?Await, ?Tagged]
TemplateLiteral[Yield, Await, Tagged] : NoSubstitutionTemplate
TemplateSpans[Yield, Await, Tagged] :
TemplateTail
TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateTail
TemplateSpans[Yield, Await, Tagged] : TemplateTail
TemplateMiddleList[Yield, Await, Tagged] :
TemplateMiddle Expression[+In, ?Yield, ?Await]
TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await]
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 :
MemberExpression `[` Expression `]`
MemberExpression `.` IdentifierName
MemberExpression TemplateLiteral
SuperProperty
MetaProperty
`new` MemberExpression Arguments
MemberExpression :
MemberExpression `[` Expression `]`
MemberExpression `.` IdentifierName
SuperProperty
MemberExpression :
MemberExpression TemplateLiteral
`new` MemberExpression Arguments
MemberExpression :
MemberExpression `[` Expression `]`
MemberExpression `.` IdentifierName
SuperProperty
MetaProperty
`new` MemberExpression Arguments
MemberExpression :
MemberExpression TemplateLiteral
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]
NewExpression :
`new` NewExpression
NewExpression : `new` NewExpression
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]
CallExpression : CoverCallExpressionAndAsyncArrowHead
CallExpression :
CallExpression `[` Expression `]`
CallExpression `.` IdentifierName
CallExpression :
CoverCallExpressionAndAsyncArrowHead
SuperCall
CallExpression Arguments
CallExpression TemplateLiteral
CallExpression :
SuperCall
CallExpression `[` Expression `]`
CallExpression `.` IdentifierName
CallExpression :
CoverCallExpressionAndAsyncArrowHead
CallExpression Arguments
CallExpression TemplateLiteral
CoverCallExpressionAndAsyncArrowHead[Yield, Await] :
MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
When processing an instance of the production |CallExpression| the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:
CallMemberExpression[Yield, Await] :
MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
SuperCall[Yield, Await] :
`super` Arguments[?Yield, ?Await]
Arguments[Yield, Await] :
`(` `)`
`(` ArgumentList[?Yield, ?Await] `)`
`(` ArgumentList[?Yield, ?Await] `,` `)`
ArgumentList :
AssignmentExpression
ArgumentList `,` AssignmentExpression
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]
LeftHandSideExpression :
CallExpression
UpdateExpression[Yield, Await] :
LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++`
LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--`
UpdateExpression[Yield, Await] :
LeftHandSideExpression[?Yield, ?Await]
LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++`
LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--`
`++` UnaryExpression[?Yield, ?Await]
`--` UnaryExpression[?Yield, ?Await]
UpdateExpression :
LeftHandSideExpression `++`
LeftHandSideExpression `--`
UpdateExpression :
`++` UnaryExpression
`--` UnaryExpression
UpdateExpression :
LeftHandSideExpression `++`
LeftHandSideExpression `--`
`++` UnaryExpression
`--` UnaryExpression
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]
UnaryExpression :
`delete` UnaryExpression
`void` UnaryExpression
`typeof` UnaryExpression
`+` UnaryExpression
`-` UnaryExpression
`~` UnaryExpression
`!` UnaryExpression
AwaitExpression
ExponentiationExpression[Yield, Await] :
UnaryExpression[?Yield, ?Await]
UpdateExpression[?Yield, ?Await] `**` ExponentiationExpression[?Yield, ?Await]
ExponentiationExpression :
UpdateExpression `**` ExponentiationExpression
ExponentiationExpression : UpdateExpression `**` ExponentiationExpression
MultiplicativeExpression[Yield, Await] :
ExponentiationExpression[?Yield, ?Await]
MultiplicativeExpression[?Yield, ?Await] MultiplicativeOperator ExponentiationExpression[?Yield, ?Await]
MultiplicativeExpression :
MultiplicativeExpression MultiplicativeOperator ExponentiationExpression
MultiplicativeOperator : one of
`*` `/` `%`
AdditiveExpression[Yield, Await] :
MultiplicativeExpression[?Yield, ?Await]
AdditiveExpression[?Yield, ?Await] `+` MultiplicativeExpression[?Yield, ?Await]
AdditiveExpression[?Yield, ?Await] `-` MultiplicativeExpression[?Yield, ?Await]
AdditiveExpression :
AdditiveExpression `+` MultiplicativeExpression
AdditiveExpression `-` MultiplicativeExpression
ShiftExpression[Yield, Await] :
AdditiveExpression[?Yield, ?Await]
ShiftExpression[?Yield, ?Await] `<<` AdditiveExpression[?Yield, ?Await]
ShiftExpression[?Yield, ?Await] `>>` AdditiveExpression[?Yield, ?Await]
ShiftExpression[?Yield, ?Await] `>>>` AdditiveExpression[?Yield, ?Await]
ShiftExpression :
ShiftExpression `<<` AdditiveExpression
ShiftExpression `>>` AdditiveExpression
ShiftExpression `>>>` AdditiveExpression
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]
RelationalExpression :
RelationalExpression `<` ShiftExpression
RelationalExpression `>` ShiftExpression
RelationalExpression `<=` ShiftExpression
RelationalExpression `>=` ShiftExpression
RelationalExpression `instanceof` ShiftExpression
RelationalExpression `in` ShiftExpression
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]
EqualityExpression :
EqualityExpression `==` RelationalExpression
EqualityExpression `!=` RelationalExpression
EqualityExpression `===` RelationalExpression
EqualityExpression `!==` RelationalExpression
BitwiseANDExpression[In, Yield, Await] :
EqualityExpression[?In, ?Yield, ?Await]
BitwiseANDExpression[?In, ?Yield, ?Await] `&` EqualityExpression[?In, ?Yield, ?Await]
BitwiseANDExpression : BitwiseANDExpression `&` EqualityExpression
BitwiseXORExpression[In, Yield, Await] :
BitwiseANDExpression[?In, ?Yield, ?Await]
BitwiseXORExpression[?In, ?Yield, ?Await] `^` BitwiseANDExpression[?In, ?Yield, ?Await]
BitwiseXORExpression : BitwiseXORExpression `^` BitwiseANDExpression
BitwiseORExpression[In, Yield, Await] :
BitwiseXORExpression[?In, ?Yield, ?Await]
BitwiseORExpression[?In, ?Yield, ?Await] `|` BitwiseXORExpression[?In, ?Yield, ?Await]
BitwiseORExpression : BitwiseORExpression `|` BitwiseXORExpression
LogicalANDExpression[In, Yield, Await] :
BitwiseORExpression[?In, ?Yield, ?Await]
LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await]
LogicalANDExpression : LogicalANDExpression `&&` BitwiseORExpression
LogicalORExpression[In, Yield, Await] :
LogicalANDExpression[?In, ?Yield, ?Await]
LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await]
LogicalORExpression : LogicalORExpression `||` LogicalANDExpression
ConditionalExpression[In, Yield, Await] :
LogicalORExpression[?In, ?Yield, ?Await]
LogicalORExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await]
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]
AssignmentExpression :
ArrowFunction
AsyncArrowFunction
AssignmentExpression :
YieldExpression
LeftHandSideExpression `=` AssignmentExpression
LeftHandSideExpression AssignmentOperator AssignmentExpression
AssignmentExpression :
YieldExpression
ArrowFunction
AsyncArrowFunction
LeftHandSideExpression `=` AssignmentExpression
LeftHandSideExpression AssignmentOperator AssignmentExpression
In certain circumstances when processing an instance of the production |AssignmentExpression| the following grammar is used to refine the interpretation of |LeftHandSideExpression|:
AssignmentPattern[Yield, Await] :
ObjectAssignmentPattern[?Yield, ?Await]
ArrayAssignmentPattern[?Yield, ?Await]
ObjectAssignmentPattern[Yield, Await] :
`{` `}`
`{` AssignmentRestProperty[?Yield, ?Await] `}`
`{` AssignmentPropertyList[?Yield, ?Await] `}`
`{` AssignmentPropertyList[?Yield, ?Await] `,` AssignmentRestProperty[?Yield, ?Await]? `}`
ObjectAssignmentPattern :
`{` AssignmentPropertyList `}`
`{` AssignmentPropertyList `,` `}`
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]
AssignmentOperator : one of
`*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=`
Expression[In, Yield, Await] :
AssignmentExpression[?In, ?Yield, ?Await]
Expression[?In, ?Yield, ?Await] `,` AssignmentExpression[?In, ?Yield, ?Await]
Expression :
AssignmentExpression
Expression `,` AssignmentExpression
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
Statement :
VariableStatement
EmptyStatement
ExpressionStatement
ContinueStatement
BreakStatement
ReturnStatement
ThrowStatement
DebuggerStatement
Statement :
VariableStatement
EmptyStatement
ExpressionStatement
ContinueStatement
ReturnStatement
ThrowStatement
DebuggerStatement
Statement :
VariableStatement
EmptyStatement
ExpressionStatement
BreakStatement
ReturnStatement
ThrowStatement
DebuggerStatement
Statement :
EmptyStatement
ExpressionStatement
ContinueStatement
BreakStatement
ReturnStatement
ThrowStatement
DebuggerStatement
Statement :
VariableStatement
EmptyStatement
ExpressionStatement
ContinueStatement
BreakStatement
ThrowStatement
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]
HoistableDeclaration :
GeneratorDeclaration
AsyncFunctionDeclaration
AsyncGeneratorDeclaration
HoistableDeclaration : FunctionDeclaration
BreakableStatement[Yield, Await, Return] :
IterationStatement[?Yield, ?Await, ?Return]
SwitchStatement[?Yield, ?Await, ?Return]
BreakableStatement :
IterationStatement
SwitchStatement
BlockStatement[Yield, Await, Return] :
Block[?Yield, ?Await, ?Return]
Block :
`{` StatementList `}`
Block[Yield, Await, Return] :
`{` StatementList[?Yield, ?Await, ?Return]? `}`
Block : `{` `}`
StatementList[Return] :
ReturnStatement
ExpressionStatement
StatementList :
ReturnStatement
ExpressionStatement
StatementList[Return, In] :
ReturnStatement
ExpressionStatement
StatementList :
ReturnStatement
ExpressionStatement[+In]
StatementList :
ReturnStatement
ExpressionStatement_In
StatementList :
ReturnStatement
ExpressionStatement[~In]
StatementList[Return] :
[+Return] ReturnStatement
ExpressionStatement
StatementList :
ExpressionStatement
StatementList[Return] :
[~Return] ReturnStatement
ExpressionStatement
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]
StatementListItem : Declaration
LexicalDeclaration[In, Yield, Await] :
LetOrConst BindingList[?In, ?Yield, ?Await] `;`
LetOrConst : one of
`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]
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 :
BindingIdentifier Initializer?
VariableDeclaration :
BindingIdentifier
BindingIdentifier Initializer
VariableDeclaration :
BindingIdentifier Initializer[+In]?
VariableDeclaration :
BindingIdentifier
BindingIdentifier Initializer_In
VariableDeclaration[In] :
BindingIdentifier Initializer[?In]
VariableDeclaration :
BindingIdentifier Initializer
VariableDeclaration[In, Yield, Await] :
BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]?
BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]
BindingPattern[Yield, Await] :
ObjectBindingPattern[?Yield, ?Await]
ArrayBindingPattern[?Yield, ?Await]
ObjectBindingPattern[Yield, Await] :
`{` `}`
`{` BindingRestProperty[?Yield, ?Await] `}`
`{` BindingPropertyList[?Yield, ?Await] `}`
`{` BindingPropertyList[?Yield, ?Await] `,` BindingRestProperty[?Yield, ?Await]? `}`
ObjectBindingPattern :
`{` BindingPropertyList `}`
`{` BindingPropertyList `,` `}`
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]
EmptyStatement :
`;`
ExpressionStatement[Yield, Await] :
[lookahead <! {`{`, `function`, `async` [no |LineTerminator| here] `function`, `class`, `let [`}] Expression[+In, ?Yield, ?Await] `;`
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]
IfStatement :
`if` `(` Expression `)` Statement `else` Statement
`if` `(` Expression `)` Statement
IfStatement : `if` `(` Expression `)` Statement
IfStatement[Yield, Await, Return] :
`if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default] `else` Statement[?Yield, ?Await, ?Return]
`if` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `else` FunctionDeclaration[?Yield, ?Await, ~Default]
`if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default] `else` FunctionDeclaration[?Yield, ?Await, ~Default]
`if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default]
IterationStatement :
`for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement
IterationStatement :
`for` `(` LexicalDeclaration `;` Expression? `)` Statement
`for` `(` LexicalDeclaration Expression `;` Expression? `)` Statement
IterationStatement :
`for` `(` LexicalDeclaration `;` `)` Statement
`for` `(` LexicalDeclaration `;` Expression `)` Statement
`for` `(` LexicalDeclaration Expression `;` `)` Statement
`for` `(` LexicalDeclaration Expression `;` Expression `)` Statement
IterationStatement[Yield, Await, Return] :
`do` Statement[?Yield, ?Await, ?Return] `while` `(` Expression[+In, ?Yield, ?Await] `)` `;`
`while` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?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]
`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` ] 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]
IterationStatement :
`do` Statement `while` `(` Expression `)` `;`
`while` `(` Expression `)` Statement
`for` `(` Expression? `;` Expression? `;` Expression? `)` Statement
`for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement
`for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement
`for` `(` LeftHandSideExpression `in` Expression `)` Statement
`for` `(` `var` ForBinding `in` Expression `)` Statement
`for` `(` ForDeclaration `in` Expression `)` Statement
`for` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
`for` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
`for` `(` ForDeclaration `of` AssignmentExpression `)` Statement
`for` `await` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
`for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
`for` `await` `(` ForDeclaration `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` Expression? `;` Expression? `;` Expression? `)` Statement
`for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement
`for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement
IterationStatement :
`for` `(` LeftHandSideExpression `in` Expression `)` Statement
`for` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
`for` `await` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` ForDeclaration `in` Expression `)` Statement
`for` `(` ForDeclaration `of` AssignmentExpression `)` Statement
`for` `await` `(` ForDeclaration `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` LeftHandSideExpression `in` Expression `)` Statement
`for` `(` `var` ForBinding `in` Expression `)` Statement
`for` `(` ForDeclaration `in` Expression `)` Statement
`for` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
`for` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
`for` `(` ForDeclaration `of` AssignmentExpression `)` Statement
`for` `await` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
`for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
`for` `await` `(` ForDeclaration `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
`for` `await` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
`for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` ForDeclaration `of` AssignmentExpression `)` Statement
`for` `await` `(` ForDeclaration `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` ForDeclaration `in` Expression `)` Statement
`for` `await` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
`for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
IterationStatement : `for` `await` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
IterationStatement : `for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
IterationStatement : `for` `await` `(` ForDeclaration `of` AssignmentExpression `)` Statement
IterationStatement :
`for` `(` LeftHandSideExpression `of` AssignmentExpression `)` Statement
`for` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
`for` `(` ForDeclaration `of` AssignmentExpression `)` Statement
IterationStatement :
`do` Statement `while` `(` Expression `)` `;`
`while` `(` Expression `)` Statement
`for` `(` Expression? `;` Expression? `;` Expression? `)` Statement
`for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement
`for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement
`for` `(` LeftHandSideExpression `in` Expression `)` Statement
`for` `(` `var` ForBinding `in` Expression `)` Statement
`for` `(` ForDeclaration `in` Expression `)` Statement
IterationStatement[Yield, Await, Return] :
`for` `(` `var` BindingIdentifier[?Yield, ?Await] Initializer[~In, ?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
ForDeclaration[Yield, Await] :
LetOrConst ForBinding[?Yield, ?Await]
ForBinding[Yield, Await] :
BindingIdentifier[?Yield, ?Await]
BindingPattern[?Yield, ?Await]
ContinueStatement[Yield, Await] :
`continue` `;`
`continue` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;`
ContinueStatement : `continue` `;`
BreakStatement[Yield, Await] :
`break` `;`
`break` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;`
ReturnStatement[Yield, Await] :
`return` `;`
`return` [no LineTerminator here] Expression[+In, ?Yield, ?Await] `;`
ReturnStatement : `return` `;`
WithStatement[Yield, Await, Return] :
`with` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
WithStatement : `with` `(` Expression `)` Statement
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]? `}`
CaseBlock : `{` `}`
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]?
CaseClause : `case` Expression `:` StatementList?
DefaultClause[Yield, Await, Return] :
`default` `:` StatementList[?Yield, ?Await, ?Return]?
DefaultClause : `default` `:` StatementList?
LabelledStatement[Yield, Await, Return] :
LabelIdentifier[?Yield, ?Await] `:` LabelledItem[?Yield, ?Await, ?Return]
LabelledStatement :
LabelIdentifier `:` LabelledItem
LabelledItem[Yield, Await, Return] :
Statement[?Yield, ?Await, ?Return]
FunctionDeclaration[?Yield, ?Await, ~Default]
LabelledItem : FunctionDeclaration
ThrowStatement :
`throw` [no LineTerminator here] Expression `;`
ThrowStatement[Yield, Await] :
`throw` [no LineTerminator here] Expression[+In, ?Yield, ?Await] `;`
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]
TryStatement : `try` Block Finally
Catch[Yield, Await, Return] :
`catch` `(` CatchParameter[?Yield, ?Await] `)` Block[?Yield, ?Await, ?Return]
Finally[Yield, Await, Return] :
`finally` Block[?Yield, ?Await, ?Return]
CatchParameter[Yield, Await] :
BindingIdentifier[?Yield, ?Await]
BindingPattern[?Yield, ?Await]
DebuggerStatement :
`debugger` `;`
FunctionDeclaration[Yield, Await, Default] :
`function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}`
[+Default] `function` `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}`
FunctionDeclaration : `function` BindingIdentifier `(` FormalParameters `)` `{` FunctionBody `}`
FunctionExpression :
`function` BindingIdentifier[~Yield, ~Await]? `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}`
FunctionExpression : `function` BindingIdentifier? `(` FormalParameters `)` `{` FunctionBody `}`
UniqueFormalParameters[Yield, Await] :
FormalParameters[?Yield, ?Await]
FormalParameters[Yield, Await] :
FormalParameters[?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]
FunctionBody[Yield, Await] :
FunctionStatementList[?Yield, ?Await]
FunctionStatementList[Yield, Await] :
StatementList[?Yield, ?Await, +Return]?
FunctionStatementList : [empty]
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 != `{` ] AssignmentExpression[?In, ~Yield, ~Await]
`{` FunctionBody[~Yield, ~Await] `}`
When the production |ArrowParameters| is recognized the following grammar is used to refine the interpretation of |CoverParenthesizedExpressionAndArrowParameterList|:
ArrowFormalParameters[Yield, Await] :
`(` UniqueFormalParameters[?Yield, ?Await] `)`
AsyncArrowFunction[In, Yield, Await] :
`async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In]
CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover
AsyncArrowFunction : `async` [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] `=>` AsyncConciseBody
AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody
AsyncConciseBody[In] :
[lookahead != `{`] AssignmentExpression[?In, ~Yield, +Await]
`{` AsyncFunctionBody `}`
AsyncConciseBody : [lookahead != `{`] AssignmentExpression
AsyncConciseBody : `{` AsyncFunctionBody `}`
When the production |AsyncArrowFunction| is recognized the following grammar is used to refine the interpretation of |CoverParenthesizedExpressionAndArrowParameterList|:
AsyncArrowHead :
`async` [no LineTerminator here] ArrowFormalParameters[~Yield, +Await]
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] `}`
MethodDefinition :
PropertyName `(` UniqueFormalParameters `)` `{` FunctionBody `}`
`get` PropertyName `(` `)` `{` FunctionBody `}`
`set` PropertyName `(` PropertySetParameterList `)` `{` FunctionBody `}`
MethodDefinition :
GeneratorMethod
AsyncMethod
AsyncGeneratorMethod
`get` PropertyName `(` `)` `{` FunctionBody `}`
`set` PropertyName `(` PropertySetParameterList `)` `{` FunctionBody `}`
PropertySetParameterList :
FormalParameter[~Yield, ~Await]
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 `}`
GeneratorDeclaration : `function` `*` BindingIdentifier `(` FormalParameters `)` `{` GeneratorBody `}`
GeneratorExpression :
`function` `*` BindingIdentifier[+Yield, ~Await]? `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}`
GeneratorExpression : `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` GeneratorBody `}`
GeneratorBody :
FunctionBody[+Yield, ~Await]
YieldExpression[In, Await] :
`yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await]
`yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await]
YieldExpression[In, Await] :
`yield`
`yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await]
`yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await]
AsyncMethod[Yield, Await] :
`async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}`
AsyncMethod : `async` [no LineTerminator here] PropertyName `(` UniqueFormalParameters `)` `{` AsyncFunctionBody `}`
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 `}`
AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`
AsyncFunctionExpression :
`async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}`
`async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}`
AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`
AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
AsyncFunctionBody :
FunctionBody[~Yield, +Await]
AsyncFunctionBody : FunctionBody
AwaitExpression[Yield] :
`await` UnaryExpression[?Yield, +Await]
AwaitExpression : `await` UnaryExpression
ClassDeclaration[Yield, Await, Default] :
`class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await]
[+Default] `class` ClassTail[?Yield, ?Await]
ClassDeclaration : `class` BindingIdentifier ClassTail
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]
`;`
Script :
ScriptBody?
ScriptBody :
StatementList[~Yield, ~Await, ~Return]
Module :
ModuleBody?
ModuleBody :
ModuleItemList
ModuleItemList :
ModuleItem
ModuleItemList ModuleItem
ModuleItem :
ImportDeclaration
ExportDeclaration
StatementListItem[~Yield, ~Await, ~Return]
ModuleItem :
ImportDeclaration
ExportDeclaration
ModuleItem :
ImportDeclaration
StatementListItem
ModuleItem :
ExportDeclaration
StatementListItem
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]
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 <! {`function`, `async` [no |LineTerminator| here] `function`, `class`}] AssignmentExpression[+In, ~Yield, ~Await] `;`
ExportDeclaration :
`export` `*` FromClause `;`
`export` ExportClause FromClause `;`
`export` ExportClause `;`
ExportDeclaration :
`export` ExportClause FromClause `;`
`export` `*` FromClause `;`
ExportDeclaration : `export` `default` HoistableDeclaration
ExportDeclaration : `export` ExportClause FromClause `;`
ExportDeclaration :
`export` `*` FromClause `;`
`export` ExportClause FromClause `;`
`export` ExportClause `;`
`export` `default` AssignmentExpression `;`
ExportDeclaration :
`export` `*` FromClause `;`
`export` ExportClause FromClause `;`
`export` ExportClause `;`
`export` VariableStatement
ExportDeclaration : `export` `*` FromClause `;`
ExportDeclaration :
`export` ExportClause `;`
`export` VariableStatement
`export` Declaration
`export` `default` HoistableDeclaration
`export` `default` ClassDeclaration
`export` `default` AssignmentExpression `;`
ExportClause :
`{` `}`
`{` ExportsList `}`
`{` ExportsList `,` `}`
ExportsList :
ExportSpecifier
ExportsList `,` ExportSpecifier
ExportSpecifier :
IdentifierName
IdentifierName `as` IdentifierName
StringNumericLiteral :::
StrWhiteSpace?
StrWhiteSpace? StrNumericLiteral StrWhiteSpace?
StrWhiteSpace :::
StrWhiteSpaceChar StrWhiteSpace?
StrWhiteSpaceChar :::
WhiteSpace
LineTerminator
StrNumericLiteral :::
StrDecimalLiteral
BinaryIntegerLiteral
OctalIntegerLiteral
HexIntegerLiteral
StrDecimalLiteral :::
StrUnsignedDecimalLiteral
`+` StrUnsignedDecimalLiteral
`-` StrUnsignedDecimalLiteral
StrUnsignedDecimalLiteral :::
`Infinity`
DecimalDigits `.` DecimalDigits? ExponentPart?
`.` DecimalDigits ExponentPart?
DecimalDigits ExponentPart?
DecimalDigits ::
DecimalDigit
DecimalDigits DecimalDigit
DecimalDigit :: one of
`0` `1` `2` `3` `4` `5` `6` `7` `8` `9`
ExponentPart ::
ExponentIndicator SignedInteger
ExponentIndicator :: one of
`e` `E`
SignedInteger ::
DecimalDigits
`+` DecimalDigits
`-` DecimalDigits
HexIntegerLiteral ::
`0x` HexDigits
`0X` HexDigits
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`
All grammar symbols not explicitly defined by the |StringNumericLiteral| grammar have the definitions used in the
uri :::
uriCharacters?
uriCharacters :::
uriCharacter uriCharacters?
uriCharacter :::
uriReserved
uriUnescaped
uriEscaped
uriReserved ::: one of
`;` `/` `?` `:` `@` `&` `=` `+` `$` `,`
uriUnescaped :::
uriAlpha
DecimalDigit
uriMark
uriEscaped :::
`%` HexDigit HexDigit
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
`-` `_` `.` `!` `~` `*` `'` `(` `)`
Pattern[U, N] ::
Disjunction[?U, ?N]
Disjunction[U, N] ::
Alternative[?U, ?N]
Alternative[?U, ?N] `|` Disjunction[?U, ?N]
Alternative[U, N] ::
[empty]
Alternative[?U, ?N] Term[?U, ?N]
Term[U, N] ::
Assertion[?U, ?N]
Atom[?U, ?N]
Atom[?U, ?N] Quantifier
Term[U, N] ::
[+U] Assertion[+U, ?N]
[+U] Atom[+U, ?N]
[+U] Atom[+U, ?N] Quantifier
[~U] QuantifiableAssertion[?N] Quantifier
[~U] Assertion[~U, ?N]
[~U] ExtendedAtom[?N] Quantifier
[~U] ExtendedAtom[?N]
Assertion[U, N] ::
`^`
`$`
`\` `b`
`\` `B`
`(` `?` `=` Disjunction[?U, ?N] `)`
`(` `?` `!` Disjunction[?U, ?N] `)`
`(` `?` `<=` Disjunction[?U, ?N] `)`
`(` `?` `<!` Disjunction[?U, ?N] `)`
Assertion[U, N] ::
`^`
`$`
`\` `b`
`\` `B`
[+U] `(` `?` `=` Disjunction[+U, ?N] `)`
[+U] `(` `?` `!` Disjunction[+U, ?N] `)`
[~U] QuantifiableAssertion[?N]
Quantifier ::
QuantifierPrefix
QuantifierPrefix `?`
QuantifierPrefix ::
`*`
`+`
`?`
`{` DecimalDigits `}`
`{` DecimalDigits `,` `}`
`{` DecimalDigits `,` DecimalDigits `}`
Atom[U, N] ::
PatternCharacter
`.`
`\` AtomEscape[?U, ?N]
CharacterClass[?U]
`(` GroupSpecifier[?U] Disjunction[?U, ?N] `)`
`(` `?` `:` Disjunction[?U, ?N] `)`
SyntaxCharacter :: one of
`^` `$` `\` `.` `*` `+` `?` `(` `)` `[` `]` `{` `}` `|`
PatternCharacter ::
SourceCharacter but not SyntaxCharacter
AtomEscape[U, N] ::
DecimalEscape
CharacterClassEscape[?U]
CharacterEscape[?U]
[+N] `k` GroupName[?U]
AtomEscape[U, N] ::
[+U] DecimalEscape
[~U] DecimalEscape [> but only if the CapturingGroupNumber of |DecimalEscape| is <= _NcapturingParens_]
CharacterClassEscape[?U]
CharacterEscape[~U, ?N]
[+N] `k` GroupName[?U]
CharacterEscape[U] ::
ControlEscape
`c` ControlLetter
`0` [lookahead <! DecimalDigit]
HexEscapeSequence
RegExpUnicodeEscapeSequence[?U]
IdentityEscape[?U]
CharacterEscape ::
ControlEscape
`c` ControlLetter
`0` [lookahead <! DecimalDigit]
HexEscapeSequence
RegExpUnicodeEscapeSequence
IdentityEscape
CharacterEscape[U, N] ::
ControlEscape
`c` ControlLetter
`0` [lookahead <! DecimalDigit]
HexEscapeSequence
RegExpUnicodeEscapeSequence[?U]
[~U] LegacyOctalEscapeSequence
IdentityEscape[?U, ?N]
ControlEscape :: one of
`f` `n` `r` `t` `v`
ControlLetter :: 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`
RegExpUnicodeEscapeSequence[U] ::
[+U] `u` LeadSurrogate `\u` TrailSurrogate
[+U] `u` LeadSurrogate
[+U] `u` TrailSurrogate
[+U] `u` NonSurrogate
[~U] `u` Hex4Digits
[+U] `u{` CodePoint `}`
Each `\\u` |TrailSurrogate| for which the choice of associated `u` |LeadSurrogate| is ambiguous shall be associated with the nearest possible `u` |LeadSurrogate| that would otherwise have no corresponding `\\u` |TrailSurrogate|.
LeadSurrogate ::
Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xD800 to 0xDBFF]
LeadSurrogate :: Hex4Digits
TrailSurrogate ::
Hex4Digits [> but only if the SV of |Hex4Digits| is in the inclusive range 0xDC00 to 0xDFFF]
TrailSurrogate :: Hex4Digits
NonSurrogate ::
Hex4Digits [> but only if the SV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF]
NonSurrogate :: Hex4Digits
IdentityEscape[U] ::
[+U] SyntaxCharacter
[+U] `/`
[~U] SourceCharacter but not UnicodeIDContinue
IdentityEscape[U, N] ::
[+U] SyntaxCharacter
[+U] `/`
[~U] SourceCharacterIdentityEscape[?N]
DecimalEscape ::
NonZeroDigit DecimalDigits? [lookahead <! DecimalDigit]
CharacterClassEscape[U] ::
`d`
`D`
`s`
`S`
`w`
`W`
[+U] `p{` UnicodePropertyValueExpression `}`
[+U] `P{` UnicodePropertyValueExpression `}`
CharacterClass[U] ::
`[` [lookahead <! {`^`}] ClassRanges[?U] `]`
`[` `^` ClassRanges[?U] `]`
ClassRanges[U] ::
[empty]
NonemptyClassRanges[?U]
NonemptyClassRanges[U] ::
ClassAtom[?U]
ClassAtom[?U] NonemptyClassRangesNoDash[?U]
ClassAtom[?U] `-` ClassAtom[?U] ClassRanges[?U]
NonemptyClassRangesNoDash[U] ::
ClassAtom[?U]
ClassAtomNoDash[?U] NonemptyClassRangesNoDash[?U]
ClassAtomNoDash[?U] `-` ClassAtom[?U] ClassRanges[?U]
ClassAtom[U] ::
`-`
ClassAtomNoDash[?U]
ClassAtom :: `-`
ClassAtomNoDash[U] ::
SourceCharacter but not one of `\` or `]` or `-`
`\` ClassEscape[?U]
ClassAtomNoDash :: SourceCharacter but not one of `\` or `]` or `-`
ClassAtomNoDash[U, N] ::
SourceCharacter but not one of `\` or `]` or `-`
`\` ClassEscape[?U, ?N]
`\` [lookahead == `c`]
ClassAtomNoDash :: `\` [lookahead == `c`]
ClassEscape[U] ::
`d`
`D`
`s`
`S`
`w`
`W`
[+U] `p{` UnicodePropertyValueExpression `}`
[+U] `P{` UnicodePropertyValueExpression `}`
ClassEscape :: `b`
ClassEscape :: `-`
ClassEscape :: CharacterClassEscape
ClassEscape[U, N] ::
`b`
[+U] `-`
[~U] `c` ClassControlLetter
CharacterClassEscape[?U]
CharacterEscape[?U, ?N]