-
Bug
-
Resolution: Fixed
-
P4
-
18
JLS18 defines Identifier to exclude every Keyword:
Identifier:
IdentifierChars but not a Keyword or BooleanLiteral or NullLiteral
which makes TypeIdentifier's exclusion of certain keywords rather redundant:
TypeIdentifier:
Identifier but not permits, record, sealed, var, or yield
3.5's tokenization rules are clear that identifiers are exclusive with, specifically, _reserved_ keywords: "A sequence of input characters that could be reduced to either an identifier token or a reserved keyword token (§3.9) is always reduced to a reserved keyword token."
Therefore, Identifier should exclude ReservedKeyword, not Keyword:
Identifier:
IdentifierChars but not a ***ReservedKeyword*** or BooleanLiteral or NullLiteral
Identifier:
IdentifierChars but not a Keyword or BooleanLiteral or NullLiteral
which makes TypeIdentifier's exclusion of certain keywords rather redundant:
TypeIdentifier:
Identifier but not permits, record, sealed, var, or yield
3.5's tokenization rules are clear that identifiers are exclusive with, specifically, _reserved_ keywords: "A sequence of input characters that could be reduced to either an identifier token or a reserved keyword token (§3.9) is always reduced to a reserved keyword token."
Therefore, Identifier should exclude ReservedKeyword, not Keyword:
Identifier:
IdentifierChars but not a ***ReservedKeyword*** or BooleanLiteral or NullLiteral