diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 752eefc7b57..ee8deaae161 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: - windows-latest - macos-14 node-version: + - '22' - '20' - '18' - '16' diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0e45abf9373..6bb0efc2c83 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -102,6 +102,7 @@ import { countWhere, createBinaryExpressionTrampoline, createCompilerDiagnostic, + createDetachedDiagnostic, createDiagnosticCollection, createDiagnosticForFileFromMessageChain, createDiagnosticForNode, @@ -123,6 +124,7 @@ import { createPrinterWithRemoveCommentsNeverAsciiEscape, createPrinterWithRemoveCommentsOmitTrailingSemicolon, createPropertyNameNodeForIdentifierOrLiteral, + createScanner, createSymbolTable, createSyntacticTypeNodeBuilder, createTextWriter, @@ -937,6 +939,7 @@ import { rangeOfTypeParameters, ReadonlyKeyword, reduceLeft, + RegularExpressionLiteral, RelationComparisonResult, relativeComplement, removeExtension, @@ -953,6 +956,7 @@ import { ReverseMappedType, sameMap, SatisfiesExpression, + Scanner, scanTokenAtPosition, ScriptKind, ScriptTarget, @@ -1446,6 +1450,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { var requestedExternalEmitHelperNames = new Set(); var requestedExternalEmitHelpers: ExternalEmitHelpers; var externalHelpersModule: Symbol; + var scanner: Scanner | undefined; var Symbol = objectAllocator.getSymbolConstructor(); var Type = objectAllocator.getTypeConstructor(); @@ -6689,7 +6694,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) { return node; } - return setTextRange(context, factory.cloneNode(visitEachChild(node, deepCloneOrReuseNode, /*context*/ undefined, deepCloneOrReuseNodes)), node); + return setTextRange(context, factory.cloneNode(visitEachChild(node, deepCloneOrReuseNode, /*context*/ undefined, deepCloneOrReuseNodes, deepCloneOrReuseNode)), node); } function deepCloneOrReuseNodes( @@ -31353,6 +31358,48 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } + function checkGrammarRegularExpressionLiteral(node: RegularExpressionLiteral) { + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + let lastError: DiagnosticWithLocation | undefined; + scanner ??= createScanner(ScriptTarget.ESNext, /*skipTrivia*/ true); + scanner.setScriptTarget(sourceFile.languageVersion); + scanner.setLanguageVariant(sourceFile.languageVariant); + scanner.setOnError((message, length, arg0) => { + // emulate `parseErrorAtPosition` from parser.ts + const start = scanner!.getTokenEnd(); + if (message.category === DiagnosticCategory.Message && lastError && start === lastError.start && length === lastError.length) { + const error = createDetachedDiagnostic(sourceFile.fileName, sourceFile.text, start, length, message, arg0); + addRelatedInfo(lastError, error); + } + else if (!lastError || start !== lastError.start) { + lastError = createFileDiagnostic(sourceFile, start, length, message, arg0); + diagnostics.add(lastError); + } + }); + scanner.setText(sourceFile.text, node.pos, node.end - node.pos); + try { + scanner.scan(); + Debug.assert(scanner.reScanSlashToken(/*reportErrors*/ true) === SyntaxKind.RegularExpressionLiteral, "Expected scanner to rescan RegularExpressionLiteral"); + return !!lastError; + } + finally { + scanner.setText(""); + scanner.setOnError(/*onError*/ undefined); + } + } + return false; + } + + function checkRegularExpressionLiteral(node: RegularExpressionLiteral) { + const nodeLinks = getNodeLinks(node); + if (!(nodeLinks.flags & NodeCheckFlags.TypeChecked)) { + nodeLinks.flags |= NodeCheckFlags.TypeChecked; + addLazyDiagnostic(() => checkGrammarRegularExpressionLiteral(node)); + } + return globalRegExpType; + } + function checkSpreadExpression(node: SpreadElement, checkMode?: CheckMode): Type { if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) { checkExternalEmitHelpers(node, compilerOptions.downlevelIteration ? ExternalEmitHelpers.SpreadIncludes : ExternalEmitHelpers.SpreadArray); @@ -38493,7 +38540,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { parent = parent.parent; } if (operator === SyntaxKind.AmpersandAmpersandToken || isIfStatement(parent)) { - checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent) ? parent.thenStatement : undefined); + checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.left, leftType, isIfStatement(parent) ? parent.thenStatement : undefined); } checkTruthinessOfType(leftType, node.left); } @@ -39127,7 +39174,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function checkConditionalExpression(node: ConditionalExpression, checkMode?: CheckMode): Type { const type = checkTruthinessExpression(node.condition, checkMode); - checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue); + checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.condition, type, node.whenTrue); const type1 = checkExpression(node.whenTrue, checkMode); const type2 = checkExpression(node.whenFalse, checkMode); return getUnionType([type1, type2], UnionReduction.Subtype); @@ -39662,7 +39709,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { case SyntaxKind.TemplateExpression: return checkTemplateExpression(node as TemplateExpression); case SyntaxKind.RegularExpressionLiteral: - return globalRegExpType; + return checkRegularExpressionLiteral(node as RegularExpressionLiteral); case SyntaxKind.ArrayLiteralExpression: return checkArrayLiteral(node as ArrayLiteralExpression, checkMode, forceTuple); case SyntaxKind.ObjectLiteralExpression: @@ -43101,7 +43148,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // Grammar checking checkGrammarStatementInAmbientContext(node); const type = checkTruthinessExpression(node.expression); - checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type, node.thenStatement); + checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.expression, type, node.thenStatement); checkSourceElement(node.thenStatement); if (node.thenStatement.kind === SyntaxKind.EmptyStatement) { @@ -43111,7 +43158,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { checkSourceElement(node.elseStatement); } - function checkTestingKnownTruthyCallableOrAwaitableType(condExpr: Expression, condType: Type, body?: Statement | Expression) { + function checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(condExpr: Expression, condType: Type, body?: Statement | Expression) { if (!strictNullChecks) return; bothHelper(condExpr, body); @@ -43136,6 +43183,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return; } const type = location === condExpr ? condType : checkTruthinessExpression(location); + if (type.flags & TypeFlags.EnumLiteral && isPropertyAccessExpression(location) && (getNodeLinks(location.expression).resolvedSymbol ?? unknownSymbol).flags & SymbolFlags.Enum) { + // EnumLiteral type at condition with known value is always truthy or always falsy, likely an error + error(location, Diagnostics.This_condition_will_always_return_0, !!(type as LiteralType).value ? "true" : "false"); + return; + } const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression); if (!hasTypeFacts(type, TypeFacts.Truthy) || isPropertyExpressionCast) return; @@ -46279,7 +46331,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors. return; } - if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { + if (!checkGrammarModifiers(node) && node.modifiers) { grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 7cddcaaa779..058dc8c8c23 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1785,11 +1785,11 @@ "category": "Error", "code": 1532 }, - "A decimal escape must refer to an existent capturing group. There are only {0} capturing groups in this regular expression.": { + "This backreference refers to a group that does not exist. There are only {0} capturing groups in this regular expression.": { "category": "Error", "code": 1533 }, - "Decimal escapes are invalid when there are no capturing groups in a regular expression.": { + "This backreference is invalid because the containing regular expression contains no capturing groups.": { "category": "Error", "code": 1534 }, diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 01dc3b1b314..f8a8c52debf 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -76,6 +76,8 @@ export interface Scanner { getTokenFlags(): TokenFlags; reScanGreaterToken(): SyntaxKind; reScanSlashToken(): SyntaxKind; + /** @internal */ + reScanSlashToken(reportErrors?: boolean): SyntaxKind; // eslint-disable-line @typescript-eslint/unified-signatures reScanAsteriskEqualsToken(): SyntaxKind; reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; /** @deprecated use {@link reScanTemplateToken}(false) */ @@ -1484,7 +1486,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean // | [0-3] [0-7] [0-7]? // | [4-7] [0-7] // NonOctalDecimalEscapeSequence ::= [89] - function scanEscapeSequence(shouldEmitInvalidEscapeError: boolean, isRegularExpression: boolean): string { + function scanEscapeSequence(shouldEmitInvalidEscapeError: boolean, isRegularExpression: boolean | "annex-b"): string { const start = pos; pos++; if (pos >= end) { @@ -1523,7 +1525,9 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean tokenFlags |= TokenFlags.ContainsInvalidEscape; if (isRegularExpression || shouldEmitInvalidEscapeError) { const code = parseInt(text.substring(start + 1, pos), 8); - error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start, pos - start, "\\x" + code.toString(16).padStart(2, "0")); + if (isRegularExpression !== "annex-b") { + error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start, pos - start, "\\x" + code.toString(16).padStart(2, "0")); + } return String.fromCharCode(code); } return text.substring(start, pos); @@ -1559,7 +1563,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean ) { // '\u{DDDDDD}' pos -= 2; - return scanExtendedUnicodeEscape(isRegularExpression || shouldEmitInvalidEscapeError); + return scanExtendedUnicodeEscape(!!isRegularExpression || shouldEmitInvalidEscapeError); } // '\uDDDD' for (; pos < start + 6; pos++) { @@ -1623,7 +1627,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean case CharacterCodes.paragraphSeparator: return ""; default: - if (isRegularExpression && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) { + if (isRegularExpression === true && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) { error(Diagnostics.This_character_cannot_be_escaped_in_a_regular_expression, pos - 2, 2); } return String.fromCharCode(ch); @@ -2386,7 +2390,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean return token = SyntaxKind.EqualsToken; } - function reScanSlashToken(): SyntaxKind { + function reScanSlashToken(reportErrors?: boolean): SyntaxKind { if (token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) { // Quickly get to the end of regex such that we know the flags let p = tokenStart + 1; @@ -2444,44 +2448,57 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean if (!isIdentifierPart(ch, languageVersion)) { break; } - const flag = characterToRegularExpressionFlag(String.fromCharCode(ch)); - if (flag === undefined) { - error(Diagnostics.Unknown_regular_expression_flag, p, 1); - } - else if (regExpFlags & flag) { - error(Diagnostics.Duplicate_regular_expression_flag, p, 1); - } - else if (((regExpFlags | flag) & RegularExpressionFlags.UnicodeMode) === RegularExpressionFlags.UnicodeMode) { - error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1); - } - else { - regExpFlags |= flag; - const availableFrom = regExpFlagToFirstAvailableLanguageVersion.get(flag)!; - if (languageVersion < availableFrom) { - error(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, getNameOfScriptTarget(availableFrom)); + if (reportErrors) { + const flag = characterToRegularExpressionFlag(String.fromCharCode(ch)); + if (flag === undefined) { + error(Diagnostics.Unknown_regular_expression_flag, p, 1); + } + else if (regExpFlags & flag) { + error(Diagnostics.Duplicate_regular_expression_flag, p, 1); + } + else if (((regExpFlags | flag) & RegularExpressionFlags.UnicodeMode) === RegularExpressionFlags.UnicodeMode) { + error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1); + } + else { + regExpFlags |= flag; + const availableFrom = regExpFlagToFirstAvailableLanguageVersion.get(flag)!; + if (languageVersion < availableFrom) { + error(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, getNameOfScriptTarget(availableFrom)); + } } } p++; } - pos = tokenStart + 1; - const saveTokenPos = tokenStart; - const saveTokenFlags = tokenFlags; - scanRegularExpressionWorker(text, endOfBody, regExpFlags, isUnterminated); - if (!isUnterminated) { + if (reportErrors) { + pos = tokenStart + 1; + const saveTokenPos = tokenStart; + const saveTokenFlags = tokenFlags; + scanRegularExpressionWorker(text, endOfBody, regExpFlags, isUnterminated, /*annexB*/ true); + if (!isUnterminated) { + pos = p; + } + tokenStart = saveTokenPos; + tokenFlags = saveTokenFlags; + } + else { pos = p; } - tokenStart = saveTokenPos; - tokenFlags = saveTokenFlags; tokenValue = text.substring(tokenStart, pos); token = SyntaxKind.RegularExpressionLiteral; } return token; - function scanRegularExpressionWorker(text: string, end: number, regExpFlags: RegularExpressionFlags, isUnterminated: boolean) { - /** Grammar parameter */ - const unicodeMode = !!(regExpFlags & RegularExpressionFlags.UnicodeMode); + function scanRegularExpressionWorker(text: string, end: number, regExpFlags: RegularExpressionFlags, isUnterminated: boolean, annexB: boolean) { /** Grammar parameter */ const unicodeSetsMode = !!(regExpFlags & RegularExpressionFlags.UnicodeSets); + /** Grammar parameter */ + const unicodeMode = !!(regExpFlags & RegularExpressionFlags.UnicodeMode); + + if (unicodeMode) { + // Annex B treats any unicode mode as the strict syntax. + annexB = false; + } + /** @see {scanClassSetExpression} */ let mayContainStrings = false; @@ -2571,7 +2588,8 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean case CharacterCodes.equals: case CharacterCodes.exclamation: pos++; - isPreviousTermQuantifiable = false; + // In Annex B, `(?=Disjunction)` and `(?!Disjunction)` are quantifiable + isPreviousTermQuantifiable = annexB; break; case CharacterCodes.lessThan: const groupNameStart = pos; @@ -2763,7 +2781,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean default: // The scanEscapeSequence call in scanCharacterEscape must return non-empty strings // since there must not be line breaks in a regex literal - Debug.assert(scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape()); + Debug.assert(scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape(/*atomEscape*/ true)); break; } } @@ -2788,7 +2806,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean // IdentityEscape ::= // | '^' | '$' | '/' | '\' | '.' | '*' | '+' | '?' | '(' | ')' | '[' | ']' | '{' | '}' | '|' // | [~UnicodeMode] (any other non-identifier characters) - function scanCharacterEscape(): string { + function scanCharacterEscape(atomEscape: boolean): string { Debug.assertEqual(text.charCodeAt(pos - 1), CharacterCodes.backslash); let ch = text.charCodeAt(pos); switch (ch) { @@ -2802,6 +2820,15 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean if (unicodeMode) { error(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2); } + else if (atomEscape && annexB) { + // Annex B treats + // + // ExtendedAtom : `\` [lookahead = `c`] + // + // as the single character `\` when `c` isn't followed by a valid control character + pos--; + return "\\"; + } return String.fromCharCode(ch); case CharacterCodes.caret: case CharacterCodes.$: @@ -2826,7 +2853,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean return "\\"; } pos--; - return scanEscapeSequence(/*shouldEmitInvalidEscapeError*/ unicodeMode, /*isRegularExpression*/ true); + return scanEscapeSequence(/*shouldEmitInvalidEscapeError*/ unicodeMode, /*isRegularExpression*/ annexB ? "annex-b" : true); } } @@ -2873,12 +2900,12 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean if (isClassContentExit(ch)) { return; } - if (!minCharacter) { + if (!minCharacter && !annexB) { error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart); } const maxStart = pos; const maxCharacter = scanClassAtom(); - if (!maxCharacter) { + if (!maxCharacter && !annexB) { error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart); continue; } @@ -3208,7 +3235,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean pos++; return String.fromCharCode(ch); default: - return scanCharacterEscape(); + return scanCharacterEscape(/*atomEscape*/ false); } } else if (ch === text.charCodeAt(pos + 1)) { @@ -3275,7 +3302,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean if (scanCharacterClassEscape()) { return ""; } - return scanCharacterEscape(); + return scanCharacterEscape(/*atomEscape*/ false); } } else { @@ -3407,12 +3434,14 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean } }); forEach(decimalEscapes, escape => { - if (escape.value > numberOfCapturingGroups) { + // in AnnexB, if a DecimalEscape is greater than the number of capturing groups then it is treated as + // either a LegacyOctalEscapeSequence or IdentityEscape + if (!annexB && escape.value > numberOfCapturingGroups) { if (numberOfCapturingGroups) { - error(Diagnostics.A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_regular_expression, escape.pos, escape.end - escape.pos, numberOfCapturingGroups); + error(Diagnostics.This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression, escape.pos, escape.end - escape.pos, numberOfCapturingGroups); } else { - error(Diagnostics.Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression, escape.pos, escape.end - escape.pos); + error(Diagnostics.This_backreference_is_invalid_because_the_containing_regular_expression_contains_no_capturing_groups, escape.pos, escape.end - escape.pos); } } }); diff --git a/src/testRunner/unittests/incrementalParser.ts b/src/testRunner/unittests/incrementalParser.ts index 52c3f16e0c0..a42044d0a67 100644 --- a/src/testRunner/unittests/incrementalParser.ts +++ b/src/testRunner/unittests/incrementalParser.ts @@ -160,7 +160,7 @@ describe("unittests:: Incremental Parser", () => { const oldText = ts.ScriptSnapshot.fromString(source); const newTextAndChange = withInsert(oldText, semicolonIndex, "/"); - compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 4); + compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 0); }); it("Regular expression 2", () => { diff --git a/tests/baselines/reference/errorOnEnumReferenceInCondition.errors.txt b/tests/baselines/reference/errorOnEnumReferenceInCondition.errors.txt new file mode 100644 index 00000000000..eadbe3fb9f5 --- /dev/null +++ b/tests/baselines/reference/errorOnEnumReferenceInCondition.errors.txt @@ -0,0 +1,73 @@ +errorOnEnumReferenceInCondition.ts(6,11): error TS2845: This condition will always return 'false'. +errorOnEnumReferenceInCondition.ts(7,11): error TS2845: This condition will always return 'true'. +errorOnEnumReferenceInCondition.ts(9,5): error TS2845: This condition will always return 'false'. +errorOnEnumReferenceInCondition.ts(17,5): error TS2845: This condition will always return 'true'. +errorOnEnumReferenceInCondition.ts(30,11): error TS2845: This condition will always return 'false'. +errorOnEnumReferenceInCondition.ts(31,11): error TS2845: This condition will always return 'true'. +errorOnEnumReferenceInCondition.ts(33,5): error TS2845: This condition will always return 'false'. +errorOnEnumReferenceInCondition.ts(41,5): error TS2845: This condition will always return 'true'. + + +==== errorOnEnumReferenceInCondition.ts (8 errors) ==== + enum Nums { + Zero = 0, + One = 1, + } + + const a = Nums.Zero ? "a" : "b"; + ~~~~~~~~~ +!!! error TS2845: This condition will always return 'false'. + const b = Nums.One ? "a" : "b"; + ~~~~~~~~ +!!! error TS2845: This condition will always return 'true'. + + if (Nums.Zero) { + ~~~~~~~~~ +!!! error TS2845: This condition will always return 'false'. + Nums; + } + else { + Nums; + } + + + if (Nums.One) { + ~~~~~~~~ +!!! error TS2845: This condition will always return 'true'. + Nums; + } + else { + Nums; + } + + + enum Strs { + Empty = "", + A = "A", + } + + const c = Strs.Empty ? "a" : "b"; + ~~~~~~~~~~ +!!! error TS2845: This condition will always return 'false'. + const d = Strs.A ? "a" : "b"; + ~~~~~~ +!!! error TS2845: This condition will always return 'true'. + + if (Strs.Empty) { + ~~~~~~~~~~ +!!! error TS2845: This condition will always return 'false'. + Strs; + } + else { + Strs; + } + + + if (Strs.A) { + ~~~~~~ +!!! error TS2845: This condition will always return 'true'. + Strs; + } + else { + Strs; + } \ No newline at end of file diff --git a/tests/baselines/reference/errorOnEnumReferenceInCondition.js b/tests/baselines/reference/errorOnEnumReferenceInCondition.js new file mode 100644 index 00000000000..f47d995e06b --- /dev/null +++ b/tests/baselines/reference/errorOnEnumReferenceInCondition.js @@ -0,0 +1,90 @@ +//// [tests/cases/compiler/errorOnEnumReferenceInCondition.ts] //// + +//// [errorOnEnumReferenceInCondition.ts] +enum Nums { + Zero = 0, + One = 1, +} + +const a = Nums.Zero ? "a" : "b"; +const b = Nums.One ? "a" : "b"; + +if (Nums.Zero) { + Nums; +} +else { + Nums; +} + + +if (Nums.One) { + Nums; +} +else { + Nums; +} + + +enum Strs { + Empty = "", + A = "A", +} + +const c = Strs.Empty ? "a" : "b"; +const d = Strs.A ? "a" : "b"; + +if (Strs.Empty) { + Strs; +} +else { + Strs; +} + + +if (Strs.A) { + Strs; +} +else { + Strs; +} + +//// [errorOnEnumReferenceInCondition.js] +"use strict"; +var Nums; +(function (Nums) { + Nums[Nums["Zero"] = 0] = "Zero"; + Nums[Nums["One"] = 1] = "One"; +})(Nums || (Nums = {})); +var a = Nums.Zero ? "a" : "b"; +var b = Nums.One ? "a" : "b"; +if (Nums.Zero) { + Nums; +} +else { + Nums; +} +if (Nums.One) { + Nums; +} +else { + Nums; +} +var Strs; +(function (Strs) { + Strs["Empty"] = ""; + Strs["A"] = "A"; +})(Strs || (Strs = {})); +var c = Strs.Empty ? "a" : "b"; +var d = Strs.A ? "a" : "b"; +if (Strs.Empty) { + Strs; +} +else { + Strs; +} +if (Strs.A) { + Strs; +} +else { + Strs; +} diff --git a/tests/baselines/reference/errorOnEnumReferenceInCondition.symbols b/tests/baselines/reference/errorOnEnumReferenceInCondition.symbols new file mode 100644 index 00000000000..dd110a06cdd --- /dev/null +++ b/tests/baselines/reference/errorOnEnumReferenceInCondition.symbols @@ -0,0 +1,101 @@ +//// [tests/cases/compiler/errorOnEnumReferenceInCondition.ts] //// + +=== errorOnEnumReferenceInCondition.ts === +enum Nums { +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) + + Zero = 0, +>Zero : Symbol(Nums.Zero, Decl(errorOnEnumReferenceInCondition.ts, 0, 11)) + + One = 1, +>One : Symbol(Nums.One, Decl(errorOnEnumReferenceInCondition.ts, 1, 13)) +} + +const a = Nums.Zero ? "a" : "b"; +>a : Symbol(a, Decl(errorOnEnumReferenceInCondition.ts, 5, 5)) +>Nums.Zero : Symbol(Nums.Zero, Decl(errorOnEnumReferenceInCondition.ts, 0, 11)) +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) +>Zero : Symbol(Nums.Zero, Decl(errorOnEnumReferenceInCondition.ts, 0, 11)) + +const b = Nums.One ? "a" : "b"; +>b : Symbol(b, Decl(errorOnEnumReferenceInCondition.ts, 6, 5)) +>Nums.One : Symbol(Nums.One, Decl(errorOnEnumReferenceInCondition.ts, 1, 13)) +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) +>One : Symbol(Nums.One, Decl(errorOnEnumReferenceInCondition.ts, 1, 13)) + +if (Nums.Zero) { +>Nums.Zero : Symbol(Nums.Zero, Decl(errorOnEnumReferenceInCondition.ts, 0, 11)) +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) +>Zero : Symbol(Nums.Zero, Decl(errorOnEnumReferenceInCondition.ts, 0, 11)) + + Nums; +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) +} +else { + Nums; +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) +} + + +if (Nums.One) { +>Nums.One : Symbol(Nums.One, Decl(errorOnEnumReferenceInCondition.ts, 1, 13)) +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) +>One : Symbol(Nums.One, Decl(errorOnEnumReferenceInCondition.ts, 1, 13)) + + Nums; +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) +} +else { + Nums; +>Nums : Symbol(Nums, Decl(errorOnEnumReferenceInCondition.ts, 0, 0)) +} + + +enum Strs { +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) + + Empty = "", +>Empty : Symbol(Strs.Empty, Decl(errorOnEnumReferenceInCondition.ts, 24, 11)) + + A = "A", +>A : Symbol(Strs.A, Decl(errorOnEnumReferenceInCondition.ts, 25, 15)) +} + +const c = Strs.Empty ? "a" : "b"; +>c : Symbol(c, Decl(errorOnEnumReferenceInCondition.ts, 29, 5)) +>Strs.Empty : Symbol(Strs.Empty, Decl(errorOnEnumReferenceInCondition.ts, 24, 11)) +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) +>Empty : Symbol(Strs.Empty, Decl(errorOnEnumReferenceInCondition.ts, 24, 11)) + +const d = Strs.A ? "a" : "b"; +>d : Symbol(d, Decl(errorOnEnumReferenceInCondition.ts, 30, 5)) +>Strs.A : Symbol(Strs.A, Decl(errorOnEnumReferenceInCondition.ts, 25, 15)) +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) +>A : Symbol(Strs.A, Decl(errorOnEnumReferenceInCondition.ts, 25, 15)) + +if (Strs.Empty) { +>Strs.Empty : Symbol(Strs.Empty, Decl(errorOnEnumReferenceInCondition.ts, 24, 11)) +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) +>Empty : Symbol(Strs.Empty, Decl(errorOnEnumReferenceInCondition.ts, 24, 11)) + + Strs; +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) +} +else { + Strs; +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) +} + + +if (Strs.A) { +>Strs.A : Symbol(Strs.A, Decl(errorOnEnumReferenceInCondition.ts, 25, 15)) +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) +>A : Symbol(Strs.A, Decl(errorOnEnumReferenceInCondition.ts, 25, 15)) + + Strs; +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) +} +else { + Strs; +>Strs : Symbol(Strs, Decl(errorOnEnumReferenceInCondition.ts, 21, 1)) +} diff --git a/tests/baselines/reference/errorOnEnumReferenceInCondition.types b/tests/baselines/reference/errorOnEnumReferenceInCondition.types new file mode 100644 index 00000000000..37138533060 --- /dev/null +++ b/tests/baselines/reference/errorOnEnumReferenceInCondition.types @@ -0,0 +1,175 @@ +//// [tests/cases/compiler/errorOnEnumReferenceInCondition.ts] //// + +=== errorOnEnumReferenceInCondition.ts === +enum Nums { +>Nums : Nums +> : ^^^^ + + Zero = 0, +>Zero : Nums.Zero +> : ^^^^^^^^^ +>0 : 0 +> : ^ + + One = 1, +>One : Nums.One +> : ^^^^^^^^ +>1 : 1 +> : ^ +} + +const a = Nums.Zero ? "a" : "b"; +>a : "a" | "b" +> : ^^^^^^^^^ +>Nums.Zero ? "a" : "b" : "a" | "b" +> : ^^^^^^^^^ +>Nums.Zero : Nums.Zero +> : ^^^^^^^^^ +>Nums : typeof Nums +> : ^^^^^^^^^^^ +>Zero : Nums.Zero +> : ^^^^^^^^^ +>"a" : "a" +> : ^^^ +>"b" : "b" +> : ^^^ + +const b = Nums.One ? "a" : "b"; +>b : "a" | "b" +> : ^^^^^^^^^ +>Nums.One ? "a" : "b" : "a" | "b" +> : ^^^^^^^^^ +>Nums.One : Nums.One +> : ^^^^^^^^ +>Nums : typeof Nums +> : ^^^^^^^^^^^ +>One : Nums.One +> : ^^^^^^^^ +>"a" : "a" +> : ^^^ +>"b" : "b" +> : ^^^ + +if (Nums.Zero) { +>Nums.Zero : Nums.Zero +> : ^^^^^^^^^ +>Nums : typeof Nums +> : ^^^^^^^^^^^ +>Zero : Nums.Zero +> : ^^^^^^^^^ + + Nums; +>Nums : typeof Nums +> : ^^^^^^^^^^^ +} +else { + Nums; +>Nums : typeof Nums +> : ^^^^^^^^^^^ +} + + +if (Nums.One) { +>Nums.One : Nums.One +> : ^^^^^^^^ +>Nums : typeof Nums +> : ^^^^^^^^^^^ +>One : Nums.One +> : ^^^^^^^^ + + Nums; +>Nums : typeof Nums +> : ^^^^^^^^^^^ +} +else { + Nums; +>Nums : typeof Nums +> : ^^^^^^^^^^^ +} + + +enum Strs { +>Strs : Strs +> : ^^^^ + + Empty = "", +>Empty : Strs.Empty +> : ^^^^^^^^^^ +>"" : "" +> : ^^ + + A = "A", +>A : Strs.A +> : ^^^^^^ +>"A" : "A" +> : ^^^ +} + +const c = Strs.Empty ? "a" : "b"; +>c : "a" | "b" +> : ^^^^^^^^^ +>Strs.Empty ? "a" : "b" : "a" | "b" +> : ^^^^^^^^^ +>Strs.Empty : Strs.Empty +> : ^^^^^^^^^^ +>Strs : typeof Strs +> : ^^^^^^^^^^^ +>Empty : Strs.Empty +> : ^^^^^^^^^^ +>"a" : "a" +> : ^^^ +>"b" : "b" +> : ^^^ + +const d = Strs.A ? "a" : "b"; +>d : "a" | "b" +> : ^^^^^^^^^ +>Strs.A ? "a" : "b" : "a" | "b" +> : ^^^^^^^^^ +>Strs.A : Strs.A +> : ^^^^^^ +>Strs : typeof Strs +> : ^^^^^^^^^^^ +>A : Strs.A +> : ^^^^^^ +>"a" : "a" +> : ^^^ +>"b" : "b" +> : ^^^ + +if (Strs.Empty) { +>Strs.Empty : Strs.Empty +> : ^^^^^^^^^^ +>Strs : typeof Strs +> : ^^^^^^^^^^^ +>Empty : Strs.Empty +> : ^^^^^^^^^^ + + Strs; +>Strs : typeof Strs +> : ^^^^^^^^^^^ +} +else { + Strs; +>Strs : typeof Strs +> : ^^^^^^^^^^^ +} + + +if (Strs.A) { +>Strs.A : Strs.A +> : ^^^^^^ +>Strs : typeof Strs +> : ^^^^^^^^^^^ +>A : Strs.A +> : ^^^^^^ + + Strs; +>Strs : typeof Strs +> : ^^^^^^^^^^^ +} +else { + Strs; +>Strs : typeof Strs +> : ^^^^^^^^^^^ +} diff --git a/tests/baselines/reference/es6ImportWithJsDocTags.symbols b/tests/baselines/reference/es6ImportWithJsDocTags.symbols new file mode 100644 index 00000000000..aa588d9fbc2 --- /dev/null +++ b/tests/baselines/reference/es6ImportWithJsDocTags.symbols @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/es6ImportWithJsDocTags.ts] //// + +=== ./a.js === +export const foo = 1; +>foo : Symbol(foo, Decl(a.js, 0, 12)) + +=== ./b.js === +'use strict'; + +/** @private */ + +import { foo } from './a.js'; +>foo : Symbol(foo, Decl(b.js, 4, 8)) + +console.log(foo); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>foo : Symbol(foo, Decl(b.js, 4, 8)) + diff --git a/tests/baselines/reference/es6ImportWithJsDocTags.types b/tests/baselines/reference/es6ImportWithJsDocTags.types new file mode 100644 index 00000000000..4e5b3c05511 --- /dev/null +++ b/tests/baselines/reference/es6ImportWithJsDocTags.types @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/es6ImportWithJsDocTags.ts] //// + +=== ./a.js === +export const foo = 1; +>foo : 1 +> : ^ +>1 : 1 +> : ^ + +=== ./b.js === +'use strict'; +>'use strict' : "use strict" +> : ^^^^^^^^^^^^ + +/** @private */ + +import { foo } from './a.js'; +>foo : 1 +> : ^ + +console.log(foo); +>console.log(foo) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^^^^^ +>foo : 1 +> : ^ + diff --git a/tests/baselines/reference/parserRegularExpression1.errors.txt b/tests/baselines/reference/parserRegularExpression1.errors.txt deleted file mode 100644 index bc21ec63c52..00000000000 --- a/tests/baselines/reference/parserRegularExpression1.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -parserRegularExpression1.ts(1,34): error TS1516: A character class range must not be bounded by another character class. - - -==== parserRegularExpression1.ts (1 errors) ==== - return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. \ No newline at end of file diff --git a/tests/baselines/reference/parserRegularExpression1.js b/tests/baselines/reference/parserRegularExpression1.js index 61698e7a7c2..36902cfcf37 100644 --- a/tests/baselines/reference/parserRegularExpression1.js +++ b/tests/baselines/reference/parserRegularExpression1.js @@ -1,7 +1,7 @@ //// [tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression1.ts] //// //// [parserRegularExpression1.ts] -return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; +/(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; //// [parserRegularExpression1.js] -return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; +/(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; diff --git a/tests/baselines/reference/parserRegularExpression1.symbols b/tests/baselines/reference/parserRegularExpression1.symbols index 637fbb00f2b..0e3e77dceca 100644 --- a/tests/baselines/reference/parserRegularExpression1.symbols +++ b/tests/baselines/reference/parserRegularExpression1.symbols @@ -2,4 +2,4 @@ === parserRegularExpression1.ts === -return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; +/(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; diff --git a/tests/baselines/reference/parserRegularExpression1.types b/tests/baselines/reference/parserRegularExpression1.types index e3b438be1a0..8853d983d3e 100644 --- a/tests/baselines/reference/parserRegularExpression1.types +++ b/tests/baselines/reference/parserRegularExpression1.types @@ -1,7 +1,7 @@ //// [tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression1.ts] //// === parserRegularExpression1.ts === -return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; +/(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; >/(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g : RegExp > : ^^^^^^ diff --git a/tests/baselines/reference/parserRegularExpression6.js b/tests/baselines/reference/parserRegularExpression6.js new file mode 100644 index 00000000000..b6142fd267d --- /dev/null +++ b/tests/baselines/reference/parserRegularExpression6.js @@ -0,0 +1,10 @@ +//// [tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression6.ts] //// + +//// [parserRegularExpression6.ts] +declare var a; +a /= 1; // parse as infix +a = /=/; // parse as regexp + +//// [parserRegularExpression6.js] +a /= 1; // parse as infix +a = /=/; // parse as regexp diff --git a/tests/baselines/reference/parserRegularExpression6.symbols b/tests/baselines/reference/parserRegularExpression6.symbols new file mode 100644 index 00000000000..b5cec1d8448 --- /dev/null +++ b/tests/baselines/reference/parserRegularExpression6.symbols @@ -0,0 +1,12 @@ +//// [tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression6.ts] //// + +=== parserRegularExpression6.ts === +declare var a; +>a : Symbol(a, Decl(parserRegularExpression6.ts, 0, 11)) + +a /= 1; // parse as infix +>a : Symbol(a, Decl(parserRegularExpression6.ts, 0, 11)) + +a = /=/; // parse as regexp +>a : Symbol(a, Decl(parserRegularExpression6.ts, 0, 11)) + diff --git a/tests/baselines/reference/parserRegularExpression6.types b/tests/baselines/reference/parserRegularExpression6.types new file mode 100644 index 00000000000..a07adbb2dcf --- /dev/null +++ b/tests/baselines/reference/parserRegularExpression6.types @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression6.ts] //// + +=== parserRegularExpression6.ts === +declare var a; +>a : any + +a /= 1; // parse as infix +>a /= 1 : number +> : ^^^^^^ +>a : any +>1 : 1 +> : ^ + +a = /=/; // parse as regexp +>a = /=/ : RegExp +> : ^^^^^^ +>a : any +>/=/ : RegExp +> : ^^^^^^ + diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt index 71688b69756..4b329215469 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt @@ -1,10 +1,13 @@ parserRegularExpressionDivideAmbiguity4.ts(1,1): error TS2304: Cannot find name 'foo'. parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS1161: Unterminated regular expression literal. +parserRegularExpressionDivideAmbiguity4.ts(1,17): error TS1005: ')' expected. -==== parserRegularExpressionDivideAmbiguity4.ts (2 errors) ==== +==== parserRegularExpressionDivideAmbiguity4.ts (3 errors) ==== foo(/notregexp); ~~~ !!! error TS2304: Cannot find name 'foo'. -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1161: Unterminated regular expression literal. + +!!! error TS1005: ')' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.js b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.js index b8ec4550186..de84199b803 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.js +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.js @@ -4,4 +4,4 @@ foo(/notregexp); //// [parserRegularExpressionDivideAmbiguity4.js] -foo(/notregexp); +foo(/notregexp);); diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.types b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.types index 49795f09553..0c2623d2d12 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.types +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.types @@ -2,10 +2,10 @@ === parserRegularExpressionDivideAmbiguity4.ts === foo(/notregexp); ->foo(/notregexp) : any -> : ^^^ +>foo(/notregexp); : any +> : ^^^ >foo : any > : ^^^ ->/notregexp : RegExp -> : ^^^^^^ +>/notregexp); : RegExp +> : ^^^^^^ diff --git a/tests/baselines/reference/regularExpressionScanning(target=es2015).errors.txt b/tests/baselines/reference/regularExpressionScanning(target=es2015).errors.txt index 45e837e1bf7..c2a61dc5f1d 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es2015).errors.txt +++ b/tests/baselines/reference/regularExpressionScanning(target=es2015).errors.txt @@ -17,214 +17,193 @@ regularExpressionScanning.ts(5,6): error TS1499: Unknown regular expression flag regularExpressionScanning.ts(5,7): error TS1509: This regular expression flag cannot be toggled within a subpattern. regularExpressionScanning.ts(5,10): error TS1509: This regular expression flag cannot be toggled within a subpattern. regularExpressionScanning.ts(5,11): error TS1500: Duplicate regular expression flag. -regularExpressionScanning.ts(7,9): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(7,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(7,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(7,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. -regularExpressionScanning.ts(7,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -regularExpressionScanning.ts(7,42): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(7,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -regularExpressionScanning.ts(8,9): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(8,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(8,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(8,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. -regularExpressionScanning.ts(8,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -regularExpressionScanning.ts(8,42): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(8,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -regularExpressionScanning.ts(9,5): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(9,14): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(9,29): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(9,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(9,57): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,15): error TS1532: There is no capturing group named 'absent' in this regular expression. -regularExpressionScanning.ts(10,24): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,36): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,58): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. -regularExpressionScanning.ts(12,31): error TS1507: There is nothing available for repetition. -regularExpressionScanning.ts(12,32): error TS1506: Numbers out of order in quantifier. -regularExpressionScanning.ts(12,40): error TS1507: There is nothing available for repetition. -regularExpressionScanning.ts(12,61): error TS1505: Incomplete quantifier. Digit expected. -regularExpressionScanning.ts(14,12): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,15): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,22): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(14,28): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,33): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(14,36): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(15,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(15,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(16,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(16,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(17,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(17,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(17,72): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(18,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(18,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(18,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(18,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(18,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(18,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(18,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(18,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(19,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(19,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(19,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(19,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(19,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(19,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(19,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(20,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(20,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(20,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(20,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(20,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(20,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(20,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,67): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(21,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(23,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(23,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(23,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(23,59): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(25,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(25,23): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(26,3): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,6): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,15): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(26,20): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,23): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,3): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,10): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,24): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,3): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,7): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,10): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,14): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,24): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(28,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(28,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,3): error TS1511: '\q' is only available inside character class. -regularExpressionScanning.ts(29,7): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. -regularExpressionScanning.ts(29,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,46): error TS1005: '}' expected. -regularExpressionScanning.ts(29,47): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(31,4): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,8): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(31,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(31,55): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(31,63): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,76): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(32,4): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,8): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,55): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(32,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,63): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,76): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(33,8): error TS1005: '--' expected. -regularExpressionScanning.ts(33,9): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,11): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,12): error TS1005: '--' expected. -regularExpressionScanning.ts(33,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,50): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,55): error TS1511: '\q' is only available inside character class. -regularExpressionScanning.ts(33,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,67): error TS1005: '--' expected. -regularExpressionScanning.ts(33,70): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,85): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,87): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(34,56): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(34,67): error TS1005: '&&' expected. -regularExpressionScanning.ts(34,77): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(35,83): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(36,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(36,30): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(36,83): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(37,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,77): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(38,95): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(39,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(39,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(39,95): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(40,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,89): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(13,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(13,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(13,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. +regularExpressionScanning.ts(13,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. +regularExpressionScanning.ts(13,42): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. +regularExpressionScanning.ts(14,5): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,14): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,29): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,57): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,15): error TS1532: There is no capturing group named 'absent' in this regular expression. +regularExpressionScanning.ts(15,24): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,36): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,58): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. +regularExpressionScanning.ts(17,31): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(17,32): error TS1506: Numbers out of order in quantifier. +regularExpressionScanning.ts(17,40): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(17,61): error TS1505: Incomplete quantifier. Digit expected. +regularExpressionScanning.ts(19,12): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,15): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,28): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(20,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(20,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,72): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(23,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(23,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(24,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(25,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,67): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(26,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(28,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,59): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(31,3): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,6): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,15): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(31,20): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,23): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,3): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,10): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,14): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,24): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,3): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(34,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. +regularExpressionScanning.ts(34,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,46): error TS1005: '}' expected. +regularExpressionScanning.ts(34,47): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(36,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,55): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,76): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(38,8): error TS1005: '--' expected. +regularExpressionScanning.ts(38,9): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,11): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,12): error TS1005: '--' expected. +regularExpressionScanning.ts(38,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,50): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(38,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,67): error TS1005: '--' expected. +regularExpressionScanning.ts(38,70): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,85): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,87): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(39,56): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(39,67): error TS1005: '&&' expected. +regularExpressionScanning.ts(39,77): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(40,83): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. regularExpressionScanning.ts(41,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(41,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(41,91): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(41,30): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(41,83): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. regularExpressionScanning.ts(42,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(42,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,77): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(43,95): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(44,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,95): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(45,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,89): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(46,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,91): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(47,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -==== regularExpressionScanning.ts (224 errors) ==== +==== regularExpressionScanning.ts (203 errors) ==== const regexes: RegExp[] = [ // Flags /foo/visualstudiocode, @@ -269,24 +248,15 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag ~ !!! error TS1500: Duplicate regular expression flag. // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, - ~~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. - ~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. - ~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. - ~~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. - ~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. - ~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. - ~~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, ~~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. ~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. ~~~ @@ -296,7 +266,7 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag ~~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. ~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. ~~~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, @@ -339,14 +309,8 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag !!! error TS1517: Range out of order in character class. ~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. ~~~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, ~~~~~ !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. @@ -492,10 +456,6 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag !!! error TS1501: This regular expression flag is only available when targeting 'esnext' or later. // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /\c[\c0\ca\cQ\c\C]\c1\C/u, ~~ !!! error TS1512: '\c' must be followed by an ASCII letter. @@ -510,20 +470,6 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag ~~ !!! error TS1535: This character cannot be escaped in a regular expression. /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, ~~ !!! error TS1535: This character cannot be escaped in a regular expression. @@ -588,12 +534,8 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. ~~~~~ !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. ~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, ~~~ !!! error TS1517: Range out of order in character class. diff --git a/tests/baselines/reference/regularExpressionScanning(target=es2015).js b/tests/baselines/reference/regularExpressionScanning(target=es2015).js index 11109bee884..0c7a8eb88a1 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es2015).js +++ b/tests/baselines/reference/regularExpressionScanning(target=es2015).js @@ -7,6 +7,11 @@ const regexes: RegExp[] = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, @@ -53,6 +58,11 @@ const regexes = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, diff --git a/tests/baselines/reference/regularExpressionScanning(target=es2015).symbols b/tests/baselines/reference/regularExpressionScanning(target=es2015).symbols index 129a4de38a1..d46a82ed9a7 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es2015).symbols +++ b/tests/baselines/reference/regularExpressionScanning(target=es2015).symbols @@ -10,6 +10,11 @@ const regexes: RegExp[] = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, diff --git a/tests/baselines/reference/regularExpressionScanning(target=es2015).types b/tests/baselines/reference/regularExpressionScanning(target=es2015).types index 17d45a20505..18219dd210a 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es2015).types +++ b/tests/baselines/reference/regularExpressionScanning(target=es2015).types @@ -4,8 +4,8 @@ const regexes: RegExp[] = [ >regexes : RegExp[] > : ^^^^^^^^ ->[ // Flags /foo/visualstudiocode, // Pattern modifiers /(?med-ium:bar)/, // Capturing groups /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, // Quantifiers /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, // Character classes /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, /\c[\c0\ca\cQ\c\C]\c1\C/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, // Unicode sets notation /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, /[[^\P{Decimal_Number}&&[0-9]]&&\p{L}&&\p{ID_Continue}--\p{ASCII}\p{CWCF}]/v, /[^\p{Emoji}\p{RGI_Emoji}][^\p{Emoji}--\p{RGI_Emoji}][^\p{Emoji}&&\p{RGI_Emoji}]/v, /[^\p{RGI_Emoji}\p{Emoji}][^\p{RGI_Emoji}--\p{Emoji}][^\p{RGI_Emoji}&&\p{Emoji}]/v, /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, /[^\p{Emoji}[[\p{RGI_Emoji}]]][^\p{Emoji}--[[\p{RGI_Emoji}]]][^\p{Emoji}&&[[\p{RGI_Emoji}]]]/v, /[^[[\p{RGI_Emoji}]]\p{Emoji}][^[[\p{RGI_Emoji}]]--\p{Emoji}][^[[\p{RGI_Emoji}]]&&\p{Emoji}]/v, /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v,] : RegExp[] -> : ^^^^^^^^ +>[ // Flags /foo/visualstudiocode, // Pattern modifiers /(?med-ium:bar)/, // Capturing groups /\0/, /\1/, /\2/, /(hi)\1/, /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, // Quantifiers /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, // Character classes /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, /\c[\c0\ca\cQ\c\C]\c1\C/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, // Unicode sets notation /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, /[[^\P{Decimal_Number}&&[0-9]]&&\p{L}&&\p{ID_Continue}--\p{ASCII}\p{CWCF}]/v, /[^\p{Emoji}\p{RGI_Emoji}][^\p{Emoji}--\p{RGI_Emoji}][^\p{Emoji}&&\p{RGI_Emoji}]/v, /[^\p{RGI_Emoji}\p{Emoji}][^\p{RGI_Emoji}--\p{Emoji}][^\p{RGI_Emoji}&&\p{Emoji}]/v, /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, /[^\p{Emoji}[[\p{RGI_Emoji}]]][^\p{Emoji}--[[\p{RGI_Emoji}]]][^\p{Emoji}&&[[\p{RGI_Emoji}]]]/v, /[^[[\p{RGI_Emoji}]]\p{Emoji}][^[[\p{RGI_Emoji}]]--\p{Emoji}][^[[\p{RGI_Emoji}]]&&\p{Emoji}]/v, /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v,] : RegExp[] +> : ^^^^^^^^ // Flags /foo/visualstudiocode, @@ -18,6 +18,26 @@ const regexes: RegExp[] = [ > : ^^^^^^ // Capturing groups + /\0/, +>/\0/ : RegExp +> : ^^^^^^ + + /\1/, +>/\1/ : RegExp +> : ^^^^^^ + + /\2/, +>/\2/ : RegExp +> : ^^^^^^ + + /(hi)\1/, +>/(hi)\1/ : RegExp +> : ^^^^^^ + + /(hi) (hello) \2/, +>/(hi) (hello) \2/ : RegExp +> : ^^^^^^ + /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, >/\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/ : RegExp > : ^^^^^^ diff --git a/tests/baselines/reference/regularExpressionScanning(target=es5).errors.txt b/tests/baselines/reference/regularExpressionScanning(target=es5).errors.txt index 33da1f9c671..83b45f84434 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es5).errors.txt +++ b/tests/baselines/reference/regularExpressionScanning(target=es5).errors.txt @@ -17,221 +17,200 @@ regularExpressionScanning.ts(5,6): error TS1499: Unknown regular expression flag regularExpressionScanning.ts(5,7): error TS1509: This regular expression flag cannot be toggled within a subpattern. regularExpressionScanning.ts(5,10): error TS1509: This regular expression flag cannot be toggled within a subpattern. regularExpressionScanning.ts(5,11): error TS1500: Duplicate regular expression flag. -regularExpressionScanning.ts(7,9): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(7,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(7,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(7,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. -regularExpressionScanning.ts(7,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -regularExpressionScanning.ts(7,42): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(7,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -regularExpressionScanning.ts(8,9): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(8,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(8,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(8,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. -regularExpressionScanning.ts(8,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -regularExpressionScanning.ts(8,42): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(8,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -regularExpressionScanning.ts(8,48): error TS1501: This regular expression flag is only available when targeting 'es6' or later. -regularExpressionScanning.ts(9,5): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(9,14): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(9,29): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(9,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(9,57): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,15): error TS1532: There is no capturing group named 'absent' in this regular expression. -regularExpressionScanning.ts(10,24): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,36): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,58): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -regularExpressionScanning.ts(10,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. -regularExpressionScanning.ts(12,31): error TS1507: There is nothing available for repetition. -regularExpressionScanning.ts(12,32): error TS1506: Numbers out of order in quantifier. -regularExpressionScanning.ts(12,40): error TS1507: There is nothing available for repetition. -regularExpressionScanning.ts(12,61): error TS1505: Incomplete quantifier. Digit expected. -regularExpressionScanning.ts(14,12): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,15): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,22): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(14,28): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,33): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(14,36): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(15,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(15,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(16,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(16,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(16,72): error TS1501: This regular expression flag is only available when targeting 'es6' or later. -regularExpressionScanning.ts(17,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(17,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(17,72): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(18,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(18,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(18,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(18,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(18,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(18,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(18,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(18,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(19,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(19,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(19,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(19,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(19,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(19,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(19,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,67): error TS1501: This regular expression flag is only available when targeting 'es6' or later. -regularExpressionScanning.ts(20,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(20,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(20,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(20,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(20,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(20,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(20,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(20,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,67): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(21,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,59): error TS1501: This regular expression flag is only available when targeting 'es6' or later. -regularExpressionScanning.ts(23,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(23,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(23,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(23,59): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(25,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(25,23): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(26,3): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,6): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,15): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(26,20): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,23): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(26,26): error TS1501: This regular expression flag is only available when targeting 'es6' or later. -regularExpressionScanning.ts(27,3): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,10): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,24): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,3): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,7): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,10): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,14): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,24): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(28,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(28,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(28,47): error TS1501: This regular expression flag is only available when targeting 'es6' or later. -regularExpressionScanning.ts(29,3): error TS1511: '\q' is only available inside character class. -regularExpressionScanning.ts(29,7): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. -regularExpressionScanning.ts(29,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,46): error TS1005: '}' expected. -regularExpressionScanning.ts(29,47): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(31,4): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,8): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(31,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(31,55): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(31,63): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,76): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(32,4): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,8): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,55): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(32,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,63): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,76): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(32,87): error TS1501: This regular expression flag is only available when targeting 'es6' or later. -regularExpressionScanning.ts(33,8): error TS1005: '--' expected. -regularExpressionScanning.ts(33,9): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,11): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,12): error TS1005: '--' expected. -regularExpressionScanning.ts(33,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,50): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,55): error TS1511: '\q' is only available inside character class. -regularExpressionScanning.ts(33,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,67): error TS1005: '--' expected. -regularExpressionScanning.ts(33,70): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,85): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,87): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(34,56): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(34,67): error TS1005: '&&' expected. -regularExpressionScanning.ts(34,77): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(35,83): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(36,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(36,30): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(36,83): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(37,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,77): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(38,95): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(39,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(39,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(39,95): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -regularExpressionScanning.ts(40,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,89): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(13,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(13,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(13,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. +regularExpressionScanning.ts(13,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. +regularExpressionScanning.ts(13,42): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. +regularExpressionScanning.ts(13,48): error TS1501: This regular expression flag is only available when targeting 'es6' or later. +regularExpressionScanning.ts(14,5): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,14): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,29): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,57): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,15): error TS1532: There is no capturing group named 'absent' in this regular expression. +regularExpressionScanning.ts(15,24): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,36): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,58): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. +regularExpressionScanning.ts(17,31): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(17,32): error TS1506: Numbers out of order in quantifier. +regularExpressionScanning.ts(17,40): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(17,61): error TS1505: Incomplete quantifier. Digit expected. +regularExpressionScanning.ts(19,12): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,15): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,28): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(20,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(20,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,72): error TS1501: This regular expression flag is only available when targeting 'es6' or later. +regularExpressionScanning.ts(22,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,72): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(23,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(23,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(24,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,67): error TS1501: This regular expression flag is only available when targeting 'es6' or later. +regularExpressionScanning.ts(25,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(25,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,67): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(26,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,59): error TS1501: This regular expression flag is only available when targeting 'es6' or later. +regularExpressionScanning.ts(28,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,59): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(31,3): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,6): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,15): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(31,20): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,23): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(31,26): error TS1501: This regular expression flag is only available when targeting 'es6' or later. +regularExpressionScanning.ts(33,3): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,10): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,14): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,24): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,47): error TS1501: This regular expression flag is only available when targeting 'es6' or later. +regularExpressionScanning.ts(34,3): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(34,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. +regularExpressionScanning.ts(34,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,46): error TS1005: '}' expected. +regularExpressionScanning.ts(34,47): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(36,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,55): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,76): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(37,87): error TS1501: This regular expression flag is only available when targeting 'es6' or later. +regularExpressionScanning.ts(38,8): error TS1005: '--' expected. +regularExpressionScanning.ts(38,9): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,11): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,12): error TS1005: '--' expected. +regularExpressionScanning.ts(38,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,50): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(38,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,67): error TS1005: '--' expected. +regularExpressionScanning.ts(38,70): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,85): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,87): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(39,56): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(39,67): error TS1005: '&&' expected. +regularExpressionScanning.ts(39,77): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(40,83): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. regularExpressionScanning.ts(41,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(41,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(41,91): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(41,30): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(41,83): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. regularExpressionScanning.ts(42,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(42,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,77): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(43,95): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(44,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,95): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(45,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,89): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(46,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,91): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. +regularExpressionScanning.ts(47,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag is only available when targeting 'esnext' or later. -==== regularExpressionScanning.ts (231 errors) ==== +==== regularExpressionScanning.ts (210 errors) ==== const regexes: RegExp[] = [ // Flags /foo/visualstudiocode, @@ -276,24 +255,15 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag ~ !!! error TS1500: Duplicate regular expression flag. // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, - ~~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. - ~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. - ~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. - ~~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. - ~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. - ~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. - ~~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, ~~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. ~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. ~~~ @@ -303,7 +273,7 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag ~~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. ~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. ~~~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. ~ @@ -348,14 +318,8 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag !!! error TS1517: Range out of order in character class. ~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. ~~~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, ~~~~~ !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. @@ -507,10 +471,6 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag !!! error TS1501: This regular expression flag is only available when targeting 'esnext' or later. // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /\c[\c0\ca\cQ\c\C]\c1\C/u, ~~ !!! error TS1512: '\c' must be followed by an ASCII letter. @@ -527,20 +487,6 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag ~ !!! error TS1501: This regular expression flag is only available when targeting 'es6' or later. /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, ~~ !!! error TS1535: This character cannot be escaped in a regular expression. @@ -607,12 +553,8 @@ regularExpressionScanning.ts(42,101): error TS1501: This regular expression flag !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. ~~~~~ !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. ~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, ~~~ !!! error TS1517: Range out of order in character class. diff --git a/tests/baselines/reference/regularExpressionScanning(target=es5).js b/tests/baselines/reference/regularExpressionScanning(target=es5).js index 7398dfd0d53..fa691f88c1b 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es5).js +++ b/tests/baselines/reference/regularExpressionScanning(target=es5).js @@ -7,6 +7,11 @@ const regexes: RegExp[] = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, @@ -53,6 +58,11 @@ var regexes = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, diff --git a/tests/baselines/reference/regularExpressionScanning(target=es5).symbols b/tests/baselines/reference/regularExpressionScanning(target=es5).symbols index 33232d175f5..7f424ca297b 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es5).symbols +++ b/tests/baselines/reference/regularExpressionScanning(target=es5).symbols @@ -10,6 +10,11 @@ const regexes: RegExp[] = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, diff --git a/tests/baselines/reference/regularExpressionScanning(target=es5).types b/tests/baselines/reference/regularExpressionScanning(target=es5).types index 17d45a20505..18219dd210a 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es5).types +++ b/tests/baselines/reference/regularExpressionScanning(target=es5).types @@ -4,8 +4,8 @@ const regexes: RegExp[] = [ >regexes : RegExp[] > : ^^^^^^^^ ->[ // Flags /foo/visualstudiocode, // Pattern modifiers /(?med-ium:bar)/, // Capturing groups /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, // Quantifiers /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, // Character classes /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, /\c[\c0\ca\cQ\c\C]\c1\C/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, // Unicode sets notation /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, /[[^\P{Decimal_Number}&&[0-9]]&&\p{L}&&\p{ID_Continue}--\p{ASCII}\p{CWCF}]/v, /[^\p{Emoji}\p{RGI_Emoji}][^\p{Emoji}--\p{RGI_Emoji}][^\p{Emoji}&&\p{RGI_Emoji}]/v, /[^\p{RGI_Emoji}\p{Emoji}][^\p{RGI_Emoji}--\p{Emoji}][^\p{RGI_Emoji}&&\p{Emoji}]/v, /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, /[^\p{Emoji}[[\p{RGI_Emoji}]]][^\p{Emoji}--[[\p{RGI_Emoji}]]][^\p{Emoji}&&[[\p{RGI_Emoji}]]]/v, /[^[[\p{RGI_Emoji}]]\p{Emoji}][^[[\p{RGI_Emoji}]]--\p{Emoji}][^[[\p{RGI_Emoji}]]&&\p{Emoji}]/v, /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v,] : RegExp[] -> : ^^^^^^^^ +>[ // Flags /foo/visualstudiocode, // Pattern modifiers /(?med-ium:bar)/, // Capturing groups /\0/, /\1/, /\2/, /(hi)\1/, /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, // Quantifiers /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, // Character classes /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, /\c[\c0\ca\cQ\c\C]\c1\C/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, // Unicode sets notation /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, /[[^\P{Decimal_Number}&&[0-9]]&&\p{L}&&\p{ID_Continue}--\p{ASCII}\p{CWCF}]/v, /[^\p{Emoji}\p{RGI_Emoji}][^\p{Emoji}--\p{RGI_Emoji}][^\p{Emoji}&&\p{RGI_Emoji}]/v, /[^\p{RGI_Emoji}\p{Emoji}][^\p{RGI_Emoji}--\p{Emoji}][^\p{RGI_Emoji}&&\p{Emoji}]/v, /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, /[^\p{Emoji}[[\p{RGI_Emoji}]]][^\p{Emoji}--[[\p{RGI_Emoji}]]][^\p{Emoji}&&[[\p{RGI_Emoji}]]]/v, /[^[[\p{RGI_Emoji}]]\p{Emoji}][^[[\p{RGI_Emoji}]]--\p{Emoji}][^[[\p{RGI_Emoji}]]&&\p{Emoji}]/v, /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v,] : RegExp[] +> : ^^^^^^^^ // Flags /foo/visualstudiocode, @@ -18,6 +18,26 @@ const regexes: RegExp[] = [ > : ^^^^^^ // Capturing groups + /\0/, +>/\0/ : RegExp +> : ^^^^^^ + + /\1/, +>/\1/ : RegExp +> : ^^^^^^ + + /\2/, +>/\2/ : RegExp +> : ^^^^^^ + + /(hi)\1/, +>/(hi)\1/ : RegExp +> : ^^^^^^ + + /(hi) (hello) \2/, +>/(hi) (hello) \2/ : RegExp +> : ^^^^^^ + /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, >/\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/ : RegExp > : ^^^^^^ diff --git a/tests/baselines/reference/regularExpressionScanning(target=esnext).errors.txt b/tests/baselines/reference/regularExpressionScanning(target=esnext).errors.txt index 75619a28c11..3fd6f798436 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=esnext).errors.txt +++ b/tests/baselines/reference/regularExpressionScanning(target=esnext).errors.txt @@ -14,191 +14,170 @@ regularExpressionScanning.ts(5,6): error TS1499: Unknown regular expression flag regularExpressionScanning.ts(5,7): error TS1509: This regular expression flag cannot be toggled within a subpattern. regularExpressionScanning.ts(5,10): error TS1509: This regular expression flag cannot be toggled within a subpattern. regularExpressionScanning.ts(5,11): error TS1500: Duplicate regular expression flag. -regularExpressionScanning.ts(7,9): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(7,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(7,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(7,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. -regularExpressionScanning.ts(7,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -regularExpressionScanning.ts(7,42): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(7,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -regularExpressionScanning.ts(8,9): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(8,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(8,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -regularExpressionScanning.ts(8,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. -regularExpressionScanning.ts(8,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -regularExpressionScanning.ts(8,42): error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. -regularExpressionScanning.ts(8,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -regularExpressionScanning.ts(10,15): error TS1532: There is no capturing group named 'absent' in this regular expression. -regularExpressionScanning.ts(10,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. -regularExpressionScanning.ts(12,31): error TS1507: There is nothing available for repetition. -regularExpressionScanning.ts(12,32): error TS1506: Numbers out of order in quantifier. -regularExpressionScanning.ts(12,40): error TS1507: There is nothing available for repetition. -regularExpressionScanning.ts(12,61): error TS1505: Incomplete quantifier. Digit expected. -regularExpressionScanning.ts(14,12): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,15): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,22): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(14,28): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(14,33): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(14,36): error TS1516: A character class range must not be bounded by another character class. -regularExpressionScanning.ts(15,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(15,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(15,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(16,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(16,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(17,28): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(17,62): error TS1529: Unknown Unicode property name or value. -regularExpressionScanning.ts(18,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(18,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(18,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(18,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(18,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(18,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(18,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(18,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(18,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(19,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(19,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(19,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(19,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(19,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(19,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(19,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(19,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,6): error TS1524: Unknown Unicode property name. -regularExpressionScanning.ts(20,31): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(20,32): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(20,39): error TS1525: Expected a Unicode property value. -regularExpressionScanning.ts(20,43): error TS1523: Expected a Unicode property name. -regularExpressionScanning.ts(20,52): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(20,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -regularExpressionScanning.ts(20,62): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(20,66): error TS1527: Expected a Unicode property name or value. -regularExpressionScanning.ts(21,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(21,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(22,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(23,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(23,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(23,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(25,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(25,23): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(26,3): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,6): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,15): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(26,20): error TS1512: '\c' must be followed by an ASCII letter. -regularExpressionScanning.ts(26,23): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,3): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,10): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,24): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(27,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,3): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,7): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,10): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,14): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,24): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(28,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(28,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(28,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,3): error TS1511: '\q' is only available inside character class. -regularExpressionScanning.ts(29,7): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. -regularExpressionScanning.ts(29,17): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,21): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,39): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,43): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(29,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(29,46): error TS1005: '}' expected. -regularExpressionScanning.ts(31,4): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,8): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(31,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -regularExpressionScanning.ts(31,55): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(31,63): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(31,76): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(32,4): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,8): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,55): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(32,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(32,63): error TS1517: Range out of order in character class. -regularExpressionScanning.ts(32,76): error TS1535: This character cannot be escaped in a regular expression. -regularExpressionScanning.ts(33,8): error TS1005: '--' expected. -regularExpressionScanning.ts(33,9): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,11): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,12): error TS1005: '--' expected. -regularExpressionScanning.ts(33,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(33,50): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,55): error TS1511: '\q' is only available inside character class. -regularExpressionScanning.ts(33,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,67): error TS1005: '--' expected. -regularExpressionScanning.ts(33,70): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(33,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? -regularExpressionScanning.ts(33,85): error TS1520: Expected a class set oprand. -regularExpressionScanning.ts(34,56): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -regularExpressionScanning.ts(34,67): error TS1005: '&&' expected. -regularExpressionScanning.ts(36,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(36,30): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(37,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(39,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(39,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(40,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(13,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,24): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(13,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(13,29): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. +regularExpressionScanning.ts(13,37): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. +regularExpressionScanning.ts(13,42): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,43): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. +regularExpressionScanning.ts(15,15): error TS1532: There is no capturing group named 'absent' in this regular expression. +regularExpressionScanning.ts(15,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. +regularExpressionScanning.ts(17,31): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(17,32): error TS1506: Numbers out of order in quantifier. +regularExpressionScanning.ts(17,40): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(17,61): error TS1505: Incomplete quantifier. Digit expected. +regularExpressionScanning.ts(19,12): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,15): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,28): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(20,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(20,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(23,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(23,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(24,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(25,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(26,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(28,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(31,3): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,6): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,15): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(31,20): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,23): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,3): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,10): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,14): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,24): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,3): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(34,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. +regularExpressionScanning.ts(34,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,46): error TS1005: '}' expected. +regularExpressionScanning.ts(36,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,55): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,76): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(38,8): error TS1005: '--' expected. +regularExpressionScanning.ts(38,9): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,11): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,12): error TS1005: '--' expected. +regularExpressionScanning.ts(38,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,50): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(38,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,67): error TS1005: '--' expected. +regularExpressionScanning.ts(38,70): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,85): error TS1520: Expected a class set oprand. +regularExpressionScanning.ts(39,56): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(39,67): error TS1005: '&&' expected. regularExpressionScanning.ts(41,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(41,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(41,30): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. regularExpressionScanning.ts(42,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -==== regularExpressionScanning.ts (198 errors) ==== +==== regularExpressionScanning.ts (177 errors) ==== const regexes: RegExp[] = [ // Flags /foo/visualstudiocode, @@ -237,24 +216,15 @@ regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly ~ !!! error TS1500: Duplicate regular expression flag. // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, - ~~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. - ~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. - ~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. - ~~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x53'. - ~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. - ~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. - ~~~~ -!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, ~~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. ~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. ~~~ @@ -264,7 +234,7 @@ regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly ~~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. ~ -!!! error TS1533: A decimal escape must refer to an existent capturing group. There are only 4 capturing groups in this regular expression. +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. ~~~~ !!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, @@ -289,14 +259,8 @@ regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly !!! error TS1517: Range out of order in character class. ~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. ~~~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. - ~~ -!!! error TS1516: A character class range must not be bounded by another character class. /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, ~~~~~ !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. @@ -436,10 +400,6 @@ regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly !!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /\c[\c0\ca\cQ\c\C]\c1\C/u, ~~ !!! error TS1512: '\c' must be followed by an ASCII letter. @@ -454,20 +414,6 @@ regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly ~~ !!! error TS1535: This character cannot be escaped in a regular expression. /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, ~~ !!! error TS1535: This character cannot be escaped in a regular expression. @@ -530,12 +476,8 @@ regularExpressionScanning.ts(42,89): error TS1518: Anything that would possibly !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. ~~~~~ !!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. ~~~ !!! error TS1517: Range out of order in character class. - ~~ -!!! error TS1535: This character cannot be escaped in a regular expression. /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, ~~~ !!! error TS1517: Range out of order in character class. diff --git a/tests/baselines/reference/regularExpressionScanning(target=esnext).js b/tests/baselines/reference/regularExpressionScanning(target=esnext).js index 11109bee884..0c7a8eb88a1 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=esnext).js +++ b/tests/baselines/reference/regularExpressionScanning(target=esnext).js @@ -7,6 +7,11 @@ const regexes: RegExp[] = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, @@ -53,6 +58,11 @@ const regexes = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, diff --git a/tests/baselines/reference/regularExpressionScanning(target=esnext).symbols b/tests/baselines/reference/regularExpressionScanning(target=esnext).symbols index d62c186dc8c..72c3617f33d 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=esnext).symbols +++ b/tests/baselines/reference/regularExpressionScanning(target=esnext).symbols @@ -10,6 +10,11 @@ const regexes: RegExp[] = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, diff --git a/tests/baselines/reference/regularExpressionScanning(target=esnext).types b/tests/baselines/reference/regularExpressionScanning(target=esnext).types index 17d45a20505..18219dd210a 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=esnext).types +++ b/tests/baselines/reference/regularExpressionScanning(target=esnext).types @@ -4,8 +4,8 @@ const regexes: RegExp[] = [ >regexes : RegExp[] > : ^^^^^^^^ ->[ // Flags /foo/visualstudiocode, // Pattern modifiers /(?med-ium:bar)/, // Capturing groups /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, // Quantifiers /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, // Character classes /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, /\c[\c0\ca\cQ\c\C]\c1\C/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, // Unicode sets notation /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, /[[^\P{Decimal_Number}&&[0-9]]&&\p{L}&&\p{ID_Continue}--\p{ASCII}\p{CWCF}]/v, /[^\p{Emoji}\p{RGI_Emoji}][^\p{Emoji}--\p{RGI_Emoji}][^\p{Emoji}&&\p{RGI_Emoji}]/v, /[^\p{RGI_Emoji}\p{Emoji}][^\p{RGI_Emoji}--\p{Emoji}][^\p{RGI_Emoji}&&\p{Emoji}]/v, /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, /[^\p{Emoji}[[\p{RGI_Emoji}]]][^\p{Emoji}--[[\p{RGI_Emoji}]]][^\p{Emoji}&&[[\p{RGI_Emoji}]]]/v, /[^[[\p{RGI_Emoji}]]\p{Emoji}][^[[\p{RGI_Emoji}]]--\p{Emoji}][^[[\p{RGI_Emoji}]]&&\p{Emoji}]/v, /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v,] : RegExp[] -> : ^^^^^^^^ +>[ // Flags /foo/visualstudiocode, // Pattern modifiers /(?med-ium:bar)/, // Capturing groups /\0/, /\1/, /\2/, /(hi)\1/, /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, // Quantifiers /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, // Character classes /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, // Character escapes /\c[\c0\ca\cQ\c\C]\c1\C/, /\c[\c0\ca\cQ\c\C]\c1\C/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, // Unicode sets notation /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, /[[^\P{Decimal_Number}&&[0-9]]&&\p{L}&&\p{ID_Continue}--\p{ASCII}\p{CWCF}]/v, /[^\p{Emoji}\p{RGI_Emoji}][^\p{Emoji}--\p{RGI_Emoji}][^\p{Emoji}&&\p{RGI_Emoji}]/v, /[^\p{RGI_Emoji}\p{Emoji}][^\p{RGI_Emoji}--\p{Emoji}][^\p{RGI_Emoji}&&\p{Emoji}]/v, /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, /[^\p{Emoji}[[\p{RGI_Emoji}]]][^\p{Emoji}--[[\p{RGI_Emoji}]]][^\p{Emoji}&&[[\p{RGI_Emoji}]]]/v, /[^[[\p{RGI_Emoji}]]\p{Emoji}][^[[\p{RGI_Emoji}]]--\p{Emoji}][^[[\p{RGI_Emoji}]]&&\p{Emoji}]/v, /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v,] : RegExp[] +> : ^^^^^^^^ // Flags /foo/visualstudiocode, @@ -18,6 +18,26 @@ const regexes: RegExp[] = [ > : ^^^^^^ // Capturing groups + /\0/, +>/\0/ : RegExp +> : ^^^^^^ + + /\1/, +>/\1/ : RegExp +> : ^^^^^^ + + /\2/, +>/\2/ : RegExp +> : ^^^^^^ + + /(hi)\1/, +>/(hi)\1/ : RegExp +> : ^^^^^^ + + /(hi) (hello) \2/, +>/(hi) (hello) \2/ : RegExp +> : ^^^^^^ + /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, >/\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/ : RegExp > : ^^^^^^ diff --git a/tests/baselines/reference/regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt b/tests/baselines/reference/regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt index 18133b69068..9b69caf634c 100644 --- a/tests/baselines/reference/regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt +++ b/tests/baselines/reference/regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt @@ -8,13 +8,13 @@ regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,55): error TS150 const regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}/u; ~~~~~ !!! error TS1529: Unknown Unicode property name or value. -!!! related TS1369 regularExpressionUnicodePropertyValueExpressionSuggestions.ts:1:19: Did you mean 'ASCII'? +!!! related TS1369: Did you mean 'ASCII'? ~~ !!! error TS1524: Unknown Unicode property name. -!!! related TS1369 regularExpressionUnicodePropertyValueExpressionSuggestions.ts:1:28: Did you mean 'sc'? +!!! related TS1369: Did you mean 'sc'? ~~~~~~~~ !!! error TS1526: Unknown Unicode property value. -!!! related TS1369 regularExpressionUnicodePropertyValueExpressionSuggestions.ts:1:45: Did you mean 'Unknown'? +!!! related TS1369: Did you mean 'Unknown'? ~ !!! error TS1501: This regular expression flag is only available when targeting 'es6' or later. \ No newline at end of file diff --git a/tests/baselines/reference/shebangError.errors.txt b/tests/baselines/reference/shebangError.errors.txt index ce5ecd3f555..43213c29fc2 100644 --- a/tests/baselines/reference/shebangError.errors.txt +++ b/tests/baselines/reference/shebangError.errors.txt @@ -1,23 +1,17 @@ shebangError.ts(2,1): error TS18026: '#!' can only be used at the start of a file. shebangError.ts(2,2): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -shebangError.ts(2,8): error TS1499: Unknown regular expression flag. -shebangError.ts(2,10): error TS1499: Unknown regular expression flag. shebangError.ts(2,12): error TS2304: Cannot find name 'env'. shebangError.ts(2,16): error TS1005: ';' expected. shebangError.ts(2,16): error TS2304: Cannot find name 'node'. -==== shebangError.ts (7 errors) ==== +==== shebangError.ts (5 errors) ==== var foo = 'Shebang is only allowed on the first line'; #!/usr/bin/env node ~~ !!! error TS18026: '#!' can only be used at the start of a file. ~~~~~~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. - ~ -!!! error TS1499: Unknown regular expression flag. - ~ -!!! error TS1499: Unknown regular expression flag. ~~~ !!! error TS2304: Cannot find name 'env'. ~~~~ diff --git a/tests/cases/compiler/errorOnEnumReferenceInCondition.ts b/tests/cases/compiler/errorOnEnumReferenceInCondition.ts new file mode 100644 index 00000000000..22c1a1c3411 --- /dev/null +++ b/tests/cases/compiler/errorOnEnumReferenceInCondition.ts @@ -0,0 +1,47 @@ +// @strict: true +enum Nums { + Zero = 0, + One = 1, +} + +const a = Nums.Zero ? "a" : "b"; +const b = Nums.One ? "a" : "b"; + +if (Nums.Zero) { + Nums; +} +else { + Nums; +} + + +if (Nums.One) { + Nums; +} +else { + Nums; +} + + +enum Strs { + Empty = "", + A = "A", +} + +const c = Strs.Empty ? "a" : "b"; +const d = Strs.A ? "a" : "b"; + +if (Strs.Empty) { + Strs; +} +else { + Strs; +} + + +if (Strs.A) { + Strs; +} +else { + Strs; +} \ No newline at end of file diff --git a/tests/cases/compiler/es6ImportWithJsDocTags.ts b/tests/cases/compiler/es6ImportWithJsDocTags.ts new file mode 100644 index 00000000000..fadace52053 --- /dev/null +++ b/tests/cases/compiler/es6ImportWithJsDocTags.ts @@ -0,0 +1,14 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true +// @filename: ./a.js +export const foo = 1; + +// @filename: ./b.js +'use strict'; + +/** @private */ + +import { foo } from './a.js'; + +console.log(foo); diff --git a/tests/cases/compiler/regularExpressionScanning.ts b/tests/cases/compiler/regularExpressionScanning.ts index 214ff8e9f40..f153631ed6d 100644 --- a/tests/cases/compiler/regularExpressionScanning.ts +++ b/tests/cases/compiler/regularExpressionScanning.ts @@ -6,6 +6,11 @@ const regexes: RegExp[] = [ // Pattern modifiers /(?med-ium:bar)/, // Capturing groups + /\0/, + /\1/, + /\2/, + /(hi)\1/, + /(hi) (hello) \2/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/, /\2()(\12)(foo)\1\0[\0\1\01\123](\3\03)\5\005/u, /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, diff --git a/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression1.ts b/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression1.ts index 456e62f4696..36f90d90371 100644 --- a/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression1.ts +++ b/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression1.ts @@ -1 +1 @@ -return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; \ No newline at end of file +/(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression6.ts b/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression6.ts new file mode 100644 index 00000000000..7180a2f6540 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression6.ts @@ -0,0 +1,3 @@ +declare var a; +a /= 1; // parse as infix +a = /=/; // parse as regexp \ No newline at end of file diff --git a/tests/cases/fourslash/completionCloneQuestionToken.ts b/tests/cases/fourslash/completionCloneQuestionToken.ts new file mode 100644 index 00000000000..67df1cabb4a --- /dev/null +++ b/tests/cases/fourslash/completionCloneQuestionToken.ts @@ -0,0 +1,29 @@ +/// + +// @Filename: /file2.ts +//// type TCallback = (options: T) => any; +//// type InKeyOf = { [K in keyof E]?: TCallback; }; +//// export class Bar { +//// baz(a: InKeyOf): void { } +//// } + +// @Filename: /file1.ts +//// import { Bar } from './file2'; +//// type TwoKeys = Record<'a' | 'b', { thisFails?: any; }> +//// class Foo extends Bar { +//// /**/ +//// } + +verify.completions({ + marker: "", + includes: { + name: "baz", + insertText: "baz(a: { a?: (options: { thisFails?: any; }) => any; b?: (options: { thisFails?: any; }) => any; }): void {\n}", + filterText: "baz", + }, + isNewIdentifierLocation: true, + preferences: { + includeCompletionsWithInsertText: true, + includeCompletionsWithClassMemberSnippets: true, + }, +}); \ No newline at end of file