forked from tc39/ecma262
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Make B.1.2 "String Literals" normative (tc39#1867)
(Part of Annex B reform, see PR tc39#1595.) B.1.2 makes 2 changes to the EscapeSequence production: (1) It adds the rhs `NonOctalDecimalEscapeSequence`. (2) It replaces the rhs: `0` [lookahead <! DecimalDigit] with: LegacyOctalEscapeSequence where the latter nonterminal generates `0` among lots of other things. Change 1 is straightforward, but change 2 is tricky. In the EscapeSequence production, we can't simply replace the `0` alternative with LegacyOctalEscapeSequence (as B.1.2 does), because the `0` alternative must be treated differently from everything else that LegacyOctalEscapeSequence derives. (The `0` alternative is allowed in contexts where everything else that LegacyOctalEscapeSequence derives is forbidden.) So instead, we redefine LegacyOctalEscapeSequence to exclude the `0` alternative. Specifically, the 'overlap' comes from: LegacyOctalEscapeSequence :: OctalDigit [lookahead ∉ OctalDigit] so we replace that with: LegacyOctalEscapeSequence :: `0` [lookahead ∈ {`8`, `9`}] NonZeroOctalDigit [lookahead ∉ OctalDigit] (See Issue tc39#1975 for more details.) Resolves tc39#1975.
- Loading branch information
Showing
1 changed file
with
94 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters