Skip to content
Merged
Prev Previous commit
Next Next commit
Correct Quantifiability of {1 in Annex B
  • Loading branch information
graphemecluster committed Apr 27, 2024
commit 8facb0a78691bc92e1bce34aec287037557b07f0
15 changes: 9 additions & 6 deletions src/compiler/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2667,13 +2667,16 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean
isPreviousTermQuantifiable = true;
break;
}
if (!annexB) {
scanExpectedChar(CharacterCodes.closeBrace);
}
else if (text.charCodeAt(pos) === CharacterCodes.closeBrace) {
pos++;
if (text.charCodeAt(pos) !== CharacterCodes.closeBrace) {
if (annexB) {
isPreviousTermQuantifiable = true;
break;
}
else {
error(Diagnostics._0_expected, pos, 0, String.fromCharCode(CharacterCodes.closeBrace));
pos--;
}
}
pos--;
// falls through
case CharacterCodes.asterisk:
case CharacterCodes.plus:
Expand Down