diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5731936e4978e..20fe08f42855d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1849,6 +1849,14 @@ "category": "Error", "code": 1546 }, + "Incomplete character class range. Expected a class set character.": { + "category": "Error", + "code": 1547 + }, + "Missing '{0}' in between class set operands. To form a union of these characters, wrap them in a nested class instead.": { + "category": "Error", + "code": 1548 + }, "The types of '{0}' are incompatible between these types.": { "category": "Error", diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 343df39ad9cbc..6ef44d52abac3 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -3076,7 +3076,7 @@ export function createScanner( // ClassSetExpression ::= '^'? (ClassUnion | ClassIntersection | ClassSubtraction) // ClassUnion ::= (ClassSetRange | ClassSetOperand)* - // ClassIntersection ::= ClassSetOperand ('&&' ClassSetOperand)+ + // ClassIntersection ::= ClassSetOperand ('&&' [lookahead != '&'] ClassSetOperand)+ // ClassSubtraction ::= ClassSetOperand ('--' ClassSetOperand)+ // ClassSetRange ::= ClassSetCharacter '-' ClassSetCharacter function scanClassSetExpression() { @@ -3093,16 +3093,27 @@ export function createScanner( } let start = pos; let operand!: string; - switch (text.slice(pos, pos + 2)) { // TODO: don't use slice - case "--": - case "&&": - error(Diagnostics.Expected_a_class_set_operand); - mayContainStrings = false; - break; - default: - operand = scanClassSetOperand(); - break; + if (ch === charCodeChecked(pos + 1) && (ch === CharacterCodes.minus || ch === CharacterCodes.ampersand)) { + // Saw '--' or '&&', the first operand is absent. Only emit an error and don't consume the operator yet + error(Diagnostics.Expected_a_class_set_operand); + mayContainStrings = false; } + // If we see '-', parse the expression as ClassUnion. + // An exception is made for '-&&', in which case it is more intuitive to parse as ClassIntersection and scan '-' as an invalid operand + else if ( + ch === CharacterCodes.minus && ( + charCodeChecked(pos + 1) !== CharacterCodes.ampersand || charCodeChecked(pos + 2) !== CharacterCodes.ampersand + ) + ) { + // '-' can't be an operand in a ClassUnion (a class in Unicode sets mode can't start with '-') + error(Diagnostics.Incomplete_character_class_range_Expected_a_class_set_character); + mayContainStrings = false; + } + else { + // Scan the first operand + operand = scanClassSetOperand(); + } + // Use the first operator to determine the expression type switch (charCodeChecked(pos)) { case CharacterCodes.minus: if (charCodeChecked(pos + 1) === CharacterCodes.minus) { @@ -3125,9 +3136,6 @@ export function createScanner( mayContainStrings = !isCharacterComplement && expressionMayContainStrings; return; } - else { - error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); - } break; default: if (isCharacterComplement && mayContainStrings) { @@ -3136,6 +3144,7 @@ export function createScanner( expressionMayContainStrings = mayContainStrings; break; } + // Neither a ClassIntersection nor a ClassSubtraction, scan as ClassUnion while (true) { ch = charCodeChecked(pos); if (ch === CharacterCodes.EOF) { @@ -3143,23 +3152,26 @@ export function createScanner( } switch (ch) { case CharacterCodes.minus: - pos++; - ch = charCodeChecked(pos); + ch = charCodeChecked(pos + 1); if (isClassContentExit(ch)) { + // A class in Unicode sets mode can't end with '-', it must be followed by a class set character + pos++; + error(Diagnostics.Incomplete_character_class_range_Expected_a_class_set_character); mayContainStrings = !isCharacterComplement && expressionMayContainStrings; return; } if (ch === CharacterCodes.minus) { + // '--', skip for now and emit error later + } + else if (ch === CharacterCodes.ampersand && charCodeChecked(pos + 2) === CharacterCodes.ampersand) { + // '-&&', consume only the '-', skip '&&' for now and emit error later pos++; - error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2); - start = pos - 2; - operand = text.slice(start, pos); - continue; } else { if (!operand) { - error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start, pos - 1 - start); + error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start, pos - start); } + pos++; const secondStart = pos; const secondOperand = scanClassSetOperand(); if (isCharacterComplement && mayContainStrings) { @@ -3184,37 +3196,19 @@ export function createScanner( } } break; - case CharacterCodes.ampersand: - start = pos; - pos++; - if (charCodeChecked(pos) === CharacterCodes.ampersand) { - pos++; - error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2); - if (charCodeChecked(pos) === CharacterCodes.ampersand) { - error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); - pos++; - } - } - else { - error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch)); - } - operand = text.slice(start, pos); - continue; } - if (isClassContentExit(charCodeChecked(pos))) { + ch = charCodeChecked(pos); + if (isClassContentExit(ch)) { break; } start = pos; - switch (text.slice(pos, pos + 2)) { // TODO: don't use slice - case "--": - case "&&": - error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2); - pos += 2; - operand = text.slice(start, pos); - break; - default: - operand = scanClassSetOperand(); - break; + if (ch === charCodeChecked(pos + 1) && (ch === CharacterCodes.minus || ch === CharacterCodes.ampersand)) { + error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2); + pos += 2; + operand = text.slice(start, pos); + } + else { + operand = scanClassSetOperand(); } } mayContainStrings = !isCharacterComplement && expressionMayContainStrings; @@ -3230,40 +3224,91 @@ export function createScanner( // Provide user-friendly diagnostic messages switch (ch) { case CharacterCodes.minus: - pos++; - if (charCodeChecked(pos) === CharacterCodes.minus) { - pos++; + if (charCodeChecked(pos + 1) === CharacterCodes.minus) { if (expressionType !== ClassSetExpressionType.ClassSubtraction) { - error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2); + error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2); + } + pos += 2; + if ( + charCodeChecked(pos) === CharacterCodes.minus + && charCodeChecked(pos + 1) === CharacterCodes.minus + && charCodeChecked(pos + 2) !== CharacterCodes.minus + ) { + // 4 consecutive '-', assuming two subtraction operators with a missing operand in between + error(Diagnostics.Expected_a_class_set_operand); + continue; + } + else if ( + charCodeChecked(pos) === CharacterCodes.ampersand + && charCodeChecked(pos + 1) === CharacterCodes.ampersand + ) { + if (charCodeChecked(pos + 2) === CharacterCodes.ampersand) { + // '--&&&', consume a single '&' as a normal operand + pos++; + expressionMayContainStrings = false; + } + else { + // '--&&', assuming two operators with a missing operand in between. + // We could have emitted an "Expected a class set operand." error here, but doing so will suppress the next + // "Operators must not be mixed within a character class." error since it starts at the same position. + } + continue; } } + else if (charCodeChecked(pos + 1) === CharacterCodes.ampersand && charCodeChecked(pos + 2) === CharacterCodes.ampersand) { + // '-&&', consume '-' later as an invalid operand with error + } else { - error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1); + // a single '-', assuming class set range operator + error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 1); + pos++; } break; case CharacterCodes.ampersand: - pos++; - if (charCodeChecked(pos) === CharacterCodes.ampersand) { - pos++; + if (charCodeChecked(pos + 1) === CharacterCodes.ampersand) { if (expressionType !== ClassSetExpressionType.ClassIntersection) { - error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2); + error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2); } - if (charCodeChecked(pos) === CharacterCodes.ampersand) { - error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); - pos++; + pos += 2; + if ( + charCodeChecked(pos) === CharacterCodes.minus + && charCodeChecked(pos + 1) === CharacterCodes.minus + && charCodeChecked(pos + 2) !== CharacterCodes.minus + ) { + // '&&--', assuming two operators with a missing operand in between. + // We could have emitted an "Expected a class set operand." error here, but doing so will suppress the next + // "Operators must not be mixed within a character class." error since it starts at the same position. + continue; } + else if (charCodeChecked(pos) === CharacterCodes.ampersand) { + if ( + charCodeChecked(pos + 1) === CharacterCodes.ampersand + && charCodeChecked(pos + 2) !== CharacterCodes.ampersand + ) { + // 4 consecutive '&', assuming two intersection operators with a missing operand in between + error(Diagnostics.Expected_a_class_set_operand); + } + else { + // 3 or 5 or more consecutive '&', consume a single '&' with error + error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch)); + pos++; + expressionMayContainStrings = false; + } + continue; + } + break; } else { - error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch)); + // The single '&' is just a normal operand, there must be a missing operator before it } - break; + // falls through default: switch (expressionType) { case ClassSetExpressionType.ClassSubtraction: - error(Diagnostics._0_expected, pos, 0, "--"); + error(Diagnostics.Missing_0_in_between_class_set_operands_To_form_a_union_of_these_characters_wrap_them_in_a_nested_class_instead, pos, 0, "--"); break; case ClassSetExpressionType.ClassIntersection: - error(Diagnostics._0_expected, pos, 0, "&&"); + error(Diagnostics.Missing_0_in_between_class_set_operands_To_form_a_union_of_these_characters_wrap_them_in_a_nested_class_instead, pos, 0, "&&"); break; default: break; diff --git a/tests/baselines/reference/regularExpressionScanning(target=es2015).errors.txt b/tests/baselines/reference/regularExpressionScanning(target=es2015).errors.txt index a32fb1567c578..ee0f674149803 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es2015).errors.txt +++ b/tests/baselines/reference/regularExpressionScanning(target=es2015).errors.txt @@ -172,10 +172,10 @@ regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean 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,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,9): error TS1520: Expected a class set operand. regularExpressionScanning.ts(38,11): error TS1520: Expected a class set operand. -regularExpressionScanning.ts(38,12): error TS1005: '--' expected. +regularExpressionScanning.ts(38,12): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. 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. @@ -187,13 +187,14 @@ regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside 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,67): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,70): error TS1520: Expected a class set operand. regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,76): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,85): error TS1520: Expected a class set operand. regularExpressionScanning.ts(38,87): error TS1501: This regular expression flag is only available when targeting 'es2024' 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,67): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(39,77): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. regularExpressionScanning.ts(40,83): error TS1501: This regular expression flag is only available when targeting 'es2024' 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. @@ -219,7 +220,7 @@ regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -==== regularExpressionScanning.ts (219 errors) ==== +==== regularExpressionScanning.ts (220 errors) ==== const regexes: RegExp[] = [ // Flags /foo/visualstudiocode, @@ -607,13 +608,13 @@ regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag !!! 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}&&]/v, -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. !!! error TS1520: Expected a class set operand. -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. ~~ !!! error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? ~~ @@ -637,11 +638,13 @@ regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag ~ !!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. ~ !!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. ~ @@ -650,7 +653,7 @@ regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag ~~ !!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -!!! error TS1005: '&&' expected. +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. ~ !!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. /[^\p{Emoji}\p{RGI_Emoji}][^\p{Emoji}--\p{RGI_Emoji}][^\p{Emoji}&&\p{RGI_Emoji}]/v, diff --git a/tests/baselines/reference/regularExpressionScanning(target=es5).errors.txt b/tests/baselines/reference/regularExpressionScanning(target=es5).errors.txt index bb82df70855d7..bc8925d55544d 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=es5).errors.txt +++ b/tests/baselines/reference/regularExpressionScanning(target=es5).errors.txt @@ -179,10 +179,10 @@ regularExpressionScanning.ts(37,61): error TS1508: Unexpected '}'. Did you mean 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,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,9): error TS1520: Expected a class set operand. regularExpressionScanning.ts(38,11): error TS1520: Expected a class set operand. -regularExpressionScanning.ts(38,12): error TS1005: '--' expected. +regularExpressionScanning.ts(38,12): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. 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. @@ -194,13 +194,14 @@ regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside 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,67): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,70): error TS1520: Expected a class set operand. regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,76): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,85): error TS1520: Expected a class set operand. regularExpressionScanning.ts(38,87): error TS1501: This regular expression flag is only available when targeting 'es2024' 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,67): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(39,77): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. regularExpressionScanning.ts(40,83): error TS1501: This regular expression flag is only available when targeting 'es2024' 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. @@ -226,7 +227,7 @@ regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -==== regularExpressionScanning.ts (226 errors) ==== +==== regularExpressionScanning.ts (227 errors) ==== const regexes: RegExp[] = [ // Flags /foo/visualstudiocode, @@ -628,13 +629,13 @@ regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag !!! error TS1501: This regular expression flag is only available when targeting 'es6' or later. /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. !!! error TS1520: Expected a class set operand. -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. ~~ !!! error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? ~~ @@ -658,11 +659,13 @@ regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag ~ !!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. ~ !!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. ~ @@ -671,7 +674,7 @@ regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag ~~ !!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -!!! error TS1005: '&&' expected. +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. ~ !!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. /[^\p{Emoji}\p{RGI_Emoji}][^\p{Emoji}--\p{RGI_Emoji}][^\p{Emoji}&&\p{RGI_Emoji}]/v, diff --git a/tests/baselines/reference/regularExpressionScanning(target=esnext).errors.txt b/tests/baselines/reference/regularExpressionScanning(target=esnext).errors.txt index c2d144d42c511..947802fd1ce46 100644 --- a/tests/baselines/reference/regularExpressionScanning(target=esnext).errors.txt +++ b/tests/baselines/reference/regularExpressionScanning(target=esnext).errors.txt @@ -156,10 +156,10 @@ regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean 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,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,9): error TS1520: Expected a class set operand. regularExpressionScanning.ts(38,11): error TS1520: Expected a class set operand. -regularExpressionScanning.ts(38,12): error TS1005: '--' expected. +regularExpressionScanning.ts(38,12): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. 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. @@ -171,12 +171,13 @@ regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside 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,67): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,70): error TS1520: Expected a class set operand. regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,76): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. regularExpressionScanning.ts(38,85): error TS1520: Expected a class set operand. 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,67): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. 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,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. @@ -193,7 +194,7 @@ regularExpressionScanning.ts(47,5): error TS1518: Anything that would possibly m 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 (193 errors) ==== +==== regularExpressionScanning.ts (194 errors) ==== const regexes: RegExp[] = [ // Flags /foo/visualstudiocode, @@ -549,13 +550,13 @@ regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly !!! 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}&&]/v, -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. !!! error TS1520: Expected a class set operand. -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. ~~ !!! error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? ~~ @@ -579,18 +580,20 @@ regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly ~ !!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? -!!! error TS1005: '--' expected. +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. ~ !!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. !!! error TS1520: Expected a class set operand. /[[^\P{Decimal_Number}&&[0-9]]&&\p{L}&&\p{ID_Continue}--\p{ASCII}\p{CWCF}]/v, ~~ !!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. -!!! error TS1005: '&&' expected. +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. /[^\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, ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/regularExpressionUnicodeSets.errors.txt b/tests/baselines/reference/regularExpressionUnicodeSets.errors.txt new file mode 100644 index 0000000000000..cf58f5f90d118 --- /dev/null +++ b/tests/baselines/reference/regularExpressionUnicodeSets.errors.txt @@ -0,0 +1,868 @@ +regularExpressionUnicodeSets.ts(27,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(27,5): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(28,8): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(29,10): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(30,8): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(31,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(32,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(33,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(34,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(34,9): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(35,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(35,9): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(36,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(36,6): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(36,10): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(37,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(37,6): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(37,10): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(38,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(38,6): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(38,11): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(41,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(42,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(42,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(43,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(43,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(45,6): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(47,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(47,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(48,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(49,8): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(50,9): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(53,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(54,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(54,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(54,9): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(55,9): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(56,10): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(57,10): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(58,4): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(59,4): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(59,7): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(59,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(59,9): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(60,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(60,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(60,10): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(61,4): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(61,10): error TS1547: Incomplete character class range. Expected a class set character. +regularExpressionUnicodeSets.ts(62,4): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(62,9): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(62,10): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(65,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(65,6): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(66,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(66,6): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(67,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(67,6): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(67,8): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(68,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(68,6): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(68,9): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(69,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(69,6): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(69,9): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(73,7): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(73,8): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(74,7): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(75,7): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(76,7): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(76,10): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(76,11): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(78,7): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(79,7): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(80,7): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(80,9): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(81,7): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(81,10): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(82,7): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(82,10): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(85,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(86,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(87,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(87,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(88,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(88,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(89,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(89,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(89,10): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(92,8): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(93,8): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(93,9): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(94,8): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(94,10): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(99,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(99,6): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(100,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(100,6): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(101,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(101,6): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(101,8): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(102,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(102,6): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(102,9): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(103,4): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(103,6): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(103,9): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(105,4): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(107,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(107,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(108,7): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(109,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(110,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(110,10): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(110,11): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(112,7): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(113,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(114,7): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(114,9): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(115,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(115,10): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(116,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(116,10): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(119,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(120,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(121,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(121,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(122,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(122,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(123,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(123,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(123,10): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(126,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(126,9): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(127,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(128,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(128,10): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(129,4): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(130,9): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(134,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(135,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(135,9): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(136,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(136,10): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(137,4): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(141,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(143,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(143,9): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(144,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(145,8): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(145,10): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(149,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(150,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(151,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(152,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(152,10): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(152,11): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(153,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(153,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(154,7): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(154,9): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(156,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(156,8): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(157,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(158,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(158,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(159,7): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(159,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(159,10): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(159,11): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(160,7): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(160,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(161,7): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(161,9): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(164,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(165,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(166,4): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(167,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(168,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(170,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(171,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(174,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(174,11): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(175,8): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(175,12): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(175,16): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(175,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(176,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(176,11): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(176,13): error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(176,17): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(176,19): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(176,20): error TS1520: Expected a class set operand. +regularExpressionUnicodeSets.ts(177,15): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(177,19): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(178,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(178,11): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(179,8): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(179,11): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(179,12): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(179,16): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(179,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(180,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(180,11): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(180,12): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(180,17): error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. +regularExpressionUnicodeSets.ts(180,18): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(181,8): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(181,15): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(181,19): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(182,6): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(182,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(182,10): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(183,4): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(183,8): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(183,12): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(183,15): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(183,17): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(183,19): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(184,7): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(184,9): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(184,13): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(184,15): error TS1517: Range out of order in character class. +regularExpressionUnicodeSets.ts(184,18): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionUnicodeSets.ts(185,13): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionUnicodeSets.ts(185,17): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + + +==== regularExpressionUnicodeSets.ts (226 errors) ==== + const regexes: RegExp[] = [ + // Single '&' - valid everywhere in class unions since it is not an operator + /[&]/v, + /[?&]/v, + /[&?]/v, + /[?&?]/v, + /[&?&]/v, + /[a&]/v, + /[&a]/v, + /[a&a]/v, + /[&a&]/v, + + /[\?&]/v, + /[&\?]/v, + /[\?&\?]/v, + /[&\?&]/v, + /[\-&]/v, + /[&\-]/v, + /[\-&\-]/v, + /[&\-&]/v, + + /[\?\&]/v, + /[\&\?]/v, + /[\&\&]/v, + + // Single '-' - incomplete character class ranges, which is invalid in Unicode sets mode + /[-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[ab&-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[a&b&c-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[abc-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-abc]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-a&bc]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-a&b&c]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-abc-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-ab-c-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[-a-bc-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-a-b-c-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[-a-bc-d-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + + // Double '--', some of which are class subtractions + /[--\-]/v, + +!!! error TS1520: Expected a class set operand. + /[--\-&]/v, + +!!! error TS1520: Expected a class set operand. + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[-\--&]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[\--\-&]/v, + /[\-\--&]/v, + ~~~~ +!!! error TS1517: Range out of order in character class. + /[&--\-]/v, + /[&---&]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[&\---&]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[&-\--&]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[&--\-&]/v, + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + + // Double '&&', some of which are class intersections + /[&&\&]/v, + +!!! error TS1520: Expected a class set operand. + /[&&\&-]/v, + +!!! error TS1520: Expected a class set operand. + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1520: Expected a class set operand. + /[&\&&-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[\&&\&-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[\&\&&-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-&&\&]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[-&&&-]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1520: Expected a class set operand. + /[-\&&&-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-&\&&-]/v, + +!!! error TS1547: Incomplete character class range. Expected a class set character. + +!!! error TS1547: Incomplete character class range. Expected a class set character. + /[-&&\&-]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1520: Expected a class set operand. + + // Consecutive '&'s - test whether the recovery is user-friendly + /[&&]/v, + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + /[&&&]/v, + +!!! error TS1520: Expected a class set operand. + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + /[&&&&]/v, + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + /[&&&&&]/v, + +!!! error TS1520: Expected a class set operand. + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + +!!! error TS1520: Expected a class set operand. + /[&&&&&&]/v, + +!!! error TS1520: Expected a class set operand. + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + + /[?&+]/v, + /[?&&+]/v, + /[?&&&+]/v, + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[?&&&&+]/v, + +!!! error TS1520: Expected a class set operand. + /[?&&&&&+]/v, + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + /[?&&&&&&+]/v, + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + + /[a&&]/v, + +!!! error TS1520: Expected a class set operand. + /[a&&&]/v, + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + /[a&&&&]/v, + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + /[a&&&&&]/v, + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + +!!! error TS1520: Expected a class set operand. + /[a&&&&&&]/v, + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + + /[ab&bc]/v, + /[ab&&bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[ab&&&bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[ab&&&&bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[ab&&&&&bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[ab&&&&&&bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + + /[a&&\&]/v, + /[a&&b&]/v, + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a&&b&c]/v, + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a&&b\&c]/v, + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a&\&b\&]/v, + /[a\&&b&c]/v, + + // Consecutive '-'s - test whether the recovery is user-friendly + /[--]/v, + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + /[---]/v, + +!!! error TS1520: Expected a class set operand. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[----]/v, + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + /[-----]/v, + +!!! error TS1520: Expected a class set operand. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1520: Expected a class set operand. + /[------]/v, + +!!! error TS1520: Expected a class set operand. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + + /[?-+]/v, + ~~~ +!!! error TS1517: Range out of order in character class. + /[?--+]/v, + /[?---+]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[?----+]/v, + +!!! error TS1520: Expected a class set operand. + /[?-----+]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[?------+]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + + /[a--]/v, + +!!! error TS1520: Expected a class set operand. + /[a---]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[a----]/v, + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + /[a-----]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1520: Expected a class set operand. + /[a------]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + + /[ab-bc]/v, + /[ab--bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[ab---bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[ab----bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[ab-----bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[ab------bc]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + + /[a--\-]/v, + /[a--b-]/v, + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1520: Expected a class set operand. + /[a--b-c]/v, + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a--b\-c]/v, + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a-\-b\-]/v, + ~~~~ +!!! error TS1517: Range out of order in character class. + /[a\--b-c]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + + /[a--&]/v, + /[a--\&]/v, + /[a--b&]/v, + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a--b&c]/v, + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a--b\&c]/v, + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a-\-b\&]/v, + ~~~~ +!!! error TS1517: Range out of order in character class. + /[a\--b&c]/v, + + // Error recovery test with mixed operators + /[a&&-]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[a&&\-]/v, + /[a&&b-]/v, + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1520: Expected a class set operand. + /[a&&b-c]/v, + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&&b\-c]/v, + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a&\&b\-]/v, + /[a\&&b-c]/v, + + /[a--&b]/v, + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a--&&b]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a--&&&b]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a--&&&&b]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a---&&b]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a----&&b]/v, + +!!! error TS1520: Expected a class set operand. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + + /[a&&-b]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a&&--b]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&&---b]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&&----b]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + /[a&&&--b]/v, + ~ +!!! error TS1508: Unexpected '&'. Did you mean to escape it with backslash? + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&&&&--b]/v, + +!!! error TS1520: Expected a class set operand. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + + /[a-b&c]/v, + /[a-b&&c]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a-b&&&c]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a-&b]/v, + ~~~ +!!! error TS1517: Range out of order in character class. + /[a-&&b]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a-&&&b]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&-b]/v, + /[a&--b]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&---b]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + + // Integrated hybrid tests + /[a--&&--&&--c]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a--?&--&b--?&&--&&c]/v, + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a--b&&c-&b--a-&-]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1548: Missing '--' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1520: Expected a class set operand. + /[a\--a&-?\&a&&-a--&b\-]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&&--&&--&&c]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&&?-&&-b&&?--&&--c]/v, + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a&&b--c&-b&&a&-&]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + +!!! error TS1548: Missing '&&' in between class set operands. To form a union of these characters, wrap them in a nested class instead. + ~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a\&&a-&?\-a--&a&&-b\&]/v, + ~~~ +!!! error TS1517: Range out of order in character class. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a-&&--&&-c]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a-?&--&b--?&&--&&c]/v, + ~~~ +!!! error TS1517: Range out of order in character class. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + /[a-b&&c-&b--a-&-]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~~ +!!! error TS1517: Range out of order in character class. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~~ +!!! error TS1517: Range out of order in character class. + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + /[a-b&-?\&a&&-a--&b\-]/v, + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ~~ +!!! error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. + ]; + \ No newline at end of file diff --git a/tests/baselines/reference/regularExpressionUnicodeSets.js b/tests/baselines/reference/regularExpressionUnicodeSets.js new file mode 100644 index 0000000000000..fd6a8267b9edb --- /dev/null +++ b/tests/baselines/reference/regularExpressionUnicodeSets.js @@ -0,0 +1,357 @@ +//// [tests/cases/compiler/regularExpressionUnicodeSets.ts] //// + +//// [regularExpressionUnicodeSets.ts] +const regexes: RegExp[] = [ + // Single '&' - valid everywhere in class unions since it is not an operator + /[&]/v, + /[?&]/v, + /[&?]/v, + /[?&?]/v, + /[&?&]/v, + /[a&]/v, + /[&a]/v, + /[a&a]/v, + /[&a&]/v, + + /[\?&]/v, + /[&\?]/v, + /[\?&\?]/v, + /[&\?&]/v, + /[\-&]/v, + /[&\-]/v, + /[\-&\-]/v, + /[&\-&]/v, + + /[\?\&]/v, + /[\&\?]/v, + /[\&\&]/v, + + // Single '-' - incomplete character class ranges, which is invalid in Unicode sets mode + /[-]/v, + /[ab&-]/v, + /[a&b&c-]/v, + /[abc-]/v, + /[-abc]/v, + /[-a&bc]/v, + /[-a&b&c]/v, + /[-abc-]/v, + /[-ab-c-]/v, + /[-a-bc-]/v, + /[-a-b-c-]/v, + /[-a-bc-d-]/v, + + // Double '--', some of which are class subtractions + /[--\-]/v, + /[--\-&]/v, + /[-\--&]/v, + /[\--\-&]/v, + /[\-\--&]/v, + /[&--\-]/v, + /[&---&]/v, + /[&\---&]/v, + /[&-\--&]/v, + /[&--\-&]/v, + + // Double '&&', some of which are class intersections + /[&&\&]/v, + /[&&\&-]/v, + /[&\&&-]/v, + /[\&&\&-]/v, + /[\&\&&-]/v, + /[-&&\&]/v, + /[-&&&-]/v, + /[-\&&&-]/v, + /[-&\&&-]/v, + /[-&&\&-]/v, + + // Consecutive '&'s - test whether the recovery is user-friendly + /[&&]/v, + /[&&&]/v, + /[&&&&]/v, + /[&&&&&]/v, + /[&&&&&&]/v, + + /[?&+]/v, + /[?&&+]/v, + /[?&&&+]/v, + /[?&&&&+]/v, + /[?&&&&&+]/v, + /[?&&&&&&+]/v, + + /[a&&]/v, + /[a&&&]/v, + /[a&&&&]/v, + /[a&&&&&]/v, + /[a&&&&&&]/v, + + /[ab&bc]/v, + /[ab&&bc]/v, + /[ab&&&bc]/v, + /[ab&&&&bc]/v, + /[ab&&&&&bc]/v, + /[ab&&&&&&bc]/v, + + /[a&&\&]/v, + /[a&&b&]/v, + /[a&&b&c]/v, + /[a&&b\&c]/v, + /[a&\&b\&]/v, + /[a\&&b&c]/v, + + // Consecutive '-'s - test whether the recovery is user-friendly + /[--]/v, + /[---]/v, + /[----]/v, + /[-----]/v, + /[------]/v, + + /[?-+]/v, + /[?--+]/v, + /[?---+]/v, + /[?----+]/v, + /[?-----+]/v, + /[?------+]/v, + + /[a--]/v, + /[a---]/v, + /[a----]/v, + /[a-----]/v, + /[a------]/v, + + /[ab-bc]/v, + /[ab--bc]/v, + /[ab---bc]/v, + /[ab----bc]/v, + /[ab-----bc]/v, + /[ab------bc]/v, + + /[a--\-]/v, + /[a--b-]/v, + /[a--b-c]/v, + /[a--b\-c]/v, + /[a-\-b\-]/v, + /[a\--b-c]/v, + + /[a--&]/v, + /[a--\&]/v, + /[a--b&]/v, + /[a--b&c]/v, + /[a--b\&c]/v, + /[a-\-b\&]/v, + /[a\--b&c]/v, + + // Error recovery test with mixed operators + /[a&&-]/v, + /[a&&\-]/v, + /[a&&b-]/v, + /[a&&b-c]/v, + /[a&&b\-c]/v, + /[a&\&b\-]/v, + /[a\&&b-c]/v, + + /[a--&b]/v, + /[a--&&b]/v, + /[a--&&&b]/v, + /[a--&&&&b]/v, + /[a---&&b]/v, + /[a----&&b]/v, + + /[a&&-b]/v, + /[a&&--b]/v, + /[a&&---b]/v, + /[a&&----b]/v, + /[a&&&--b]/v, + /[a&&&&--b]/v, + + /[a-b&c]/v, + /[a-b&&c]/v, + /[a-b&&&c]/v, + /[a-&b]/v, + /[a-&&b]/v, + /[a-&&&b]/v, + /[a&-b]/v, + /[a&--b]/v, + /[a&---b]/v, + + // Integrated hybrid tests + /[a--&&--&&--c]/v, + /[a--?&--&b--?&&--&&c]/v, + /[a--b&&c-&b--a-&-]/v, + /[a\--a&-?\&a&&-a--&b\-]/v, + /[a&&--&&--&&c]/v, + /[a&&?-&&-b&&?--&&--c]/v, + /[a&&b--c&-b&&a&-&]/v, + /[a\&&a-&?\-a--&a&&-b\&]/v, + /[a-&&--&&-c]/v, + /[a-?&--&b--?&&--&&c]/v, + /[a-b&&c-&b--a-&-]/v, + /[a-b&-?\&a&&-a--&b\-]/v, +]; + + +//// [regularExpressionUnicodeSets.js] +const regexes = [ + // Single '&' - valid everywhere in class unions since it is not an operator + /[&]/v, + /[?&]/v, + /[&?]/v, + /[?&?]/v, + /[&?&]/v, + /[a&]/v, + /[&a]/v, + /[a&a]/v, + /[&a&]/v, + /[\?&]/v, + /[&\?]/v, + /[\?&\?]/v, + /[&\?&]/v, + /[\-&]/v, + /[&\-]/v, + /[\-&\-]/v, + /[&\-&]/v, + /[\?\&]/v, + /[\&\?]/v, + /[\&\&]/v, + // Single '-' - incomplete character class ranges, which is invalid in Unicode sets mode + /[-]/v, + /[ab&-]/v, + /[a&b&c-]/v, + /[abc-]/v, + /[-abc]/v, + /[-a&bc]/v, + /[-a&b&c]/v, + /[-abc-]/v, + /[-ab-c-]/v, + /[-a-bc-]/v, + /[-a-b-c-]/v, + /[-a-bc-d-]/v, + // Double '--', some of which are class subtractions + /[--\-]/v, + /[--\-&]/v, + /[-\--&]/v, + /[\--\-&]/v, + /[\-\--&]/v, + /[&--\-]/v, + /[&---&]/v, + /[&\---&]/v, + /[&-\--&]/v, + /[&--\-&]/v, + // Double '&&', some of which are class intersections + /[&&\&]/v, + /[&&\&-]/v, + /[&\&&-]/v, + /[\&&\&-]/v, + /[\&\&&-]/v, + /[-&&\&]/v, + /[-&&&-]/v, + /[-\&&&-]/v, + /[-&\&&-]/v, + /[-&&\&-]/v, + // Consecutive '&'s - test whether the recovery is user-friendly + /[&&]/v, + /[&&&]/v, + /[&&&&]/v, + /[&&&&&]/v, + /[&&&&&&]/v, + /[?&+]/v, + /[?&&+]/v, + /[?&&&+]/v, + /[?&&&&+]/v, + /[?&&&&&+]/v, + /[?&&&&&&+]/v, + /[a&&]/v, + /[a&&&]/v, + /[a&&&&]/v, + /[a&&&&&]/v, + /[a&&&&&&]/v, + /[ab&bc]/v, + /[ab&&bc]/v, + /[ab&&&bc]/v, + /[ab&&&&bc]/v, + /[ab&&&&&bc]/v, + /[ab&&&&&&bc]/v, + /[a&&\&]/v, + /[a&&b&]/v, + /[a&&b&c]/v, + /[a&&b\&c]/v, + /[a&\&b\&]/v, + /[a\&&b&c]/v, + // Consecutive '-'s - test whether the recovery is user-friendly + /[--]/v, + /[---]/v, + /[----]/v, + /[-----]/v, + /[------]/v, + /[?-+]/v, + /[?--+]/v, + /[?---+]/v, + /[?----+]/v, + /[?-----+]/v, + /[?------+]/v, + /[a--]/v, + /[a---]/v, + /[a----]/v, + /[a-----]/v, + /[a------]/v, + /[ab-bc]/v, + /[ab--bc]/v, + /[ab---bc]/v, + /[ab----bc]/v, + /[ab-----bc]/v, + /[ab------bc]/v, + /[a--\-]/v, + /[a--b-]/v, + /[a--b-c]/v, + /[a--b\-c]/v, + /[a-\-b\-]/v, + /[a\--b-c]/v, + /[a--&]/v, + /[a--\&]/v, + /[a--b&]/v, + /[a--b&c]/v, + /[a--b\&c]/v, + /[a-\-b\&]/v, + /[a\--b&c]/v, + // Error recovery test with mixed operators + /[a&&-]/v, + /[a&&\-]/v, + /[a&&b-]/v, + /[a&&b-c]/v, + /[a&&b\-c]/v, + /[a&\&b\-]/v, + /[a\&&b-c]/v, + /[a--&b]/v, + /[a--&&b]/v, + /[a--&&&b]/v, + /[a--&&&&b]/v, + /[a---&&b]/v, + /[a----&&b]/v, + /[a&&-b]/v, + /[a&&--b]/v, + /[a&&---b]/v, + /[a&&----b]/v, + /[a&&&--b]/v, + /[a&&&&--b]/v, + /[a-b&c]/v, + /[a-b&&c]/v, + /[a-b&&&c]/v, + /[a-&b]/v, + /[a-&&b]/v, + /[a-&&&b]/v, + /[a&-b]/v, + /[a&--b]/v, + /[a&---b]/v, + // Integrated hybrid tests + /[a--&&--&&--c]/v, + /[a--?&--&b--?&&--&&c]/v, + /[a--b&&c-&b--a-&-]/v, + /[a\--a&-?\&a&&-a--&b\-]/v, + /[a&&--&&--&&c]/v, + /[a&&?-&&-b&&?--&&--c]/v, + /[a&&b--c&-b&&a&-&]/v, + /[a\&&a-&?\-a--&a&&-b\&]/v, + /[a-&&--&&-c]/v, + /[a-?&--&b--?&&--&&c]/v, + /[a-b&&c-&b--a-&-]/v, + /[a-b&-?\&a&&-a--&b\-]/v, +]; diff --git a/tests/baselines/reference/regularExpressionUnicodeSets.symbols b/tests/baselines/reference/regularExpressionUnicodeSets.symbols new file mode 100644 index 0000000000000..dd2e7b3630194 --- /dev/null +++ b/tests/baselines/reference/regularExpressionUnicodeSets.symbols @@ -0,0 +1,193 @@ +//// [tests/cases/compiler/regularExpressionUnicodeSets.ts] //// + +=== regularExpressionUnicodeSets.ts === +const regexes: RegExp[] = [ +>regexes : Symbol(regexes, Decl(regularExpressionUnicodeSets.ts, 0, 5)) +>RegExp : Symbol(RegExp, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.regexp.d.ts, --, --) ... and 3 more) + + // Single '&' - valid everywhere in class unions since it is not an operator + /[&]/v, + /[?&]/v, + /[&?]/v, + /[?&?]/v, + /[&?&]/v, + /[a&]/v, + /[&a]/v, + /[a&a]/v, + /[&a&]/v, + + /[\?&]/v, + /[&\?]/v, + /[\?&\?]/v, + /[&\?&]/v, + /[\-&]/v, + /[&\-]/v, + /[\-&\-]/v, + /[&\-&]/v, + + /[\?\&]/v, + /[\&\?]/v, + /[\&\&]/v, + + // Single '-' - incomplete character class ranges, which is invalid in Unicode sets mode + /[-]/v, + /[ab&-]/v, + /[a&b&c-]/v, + /[abc-]/v, + /[-abc]/v, + /[-a&bc]/v, + /[-a&b&c]/v, + /[-abc-]/v, + /[-ab-c-]/v, + /[-a-bc-]/v, + /[-a-b-c-]/v, + /[-a-bc-d-]/v, + + // Double '--', some of which are class subtractions + /[--\-]/v, + /[--\-&]/v, + /[-\--&]/v, + /[\--\-&]/v, + /[\-\--&]/v, + /[&--\-]/v, + /[&---&]/v, + /[&\---&]/v, + /[&-\--&]/v, + /[&--\-&]/v, + + // Double '&&', some of which are class intersections + /[&&\&]/v, + /[&&\&-]/v, + /[&\&&-]/v, + /[\&&\&-]/v, + /[\&\&&-]/v, + /[-&&\&]/v, + /[-&&&-]/v, + /[-\&&&-]/v, + /[-&\&&-]/v, + /[-&&\&-]/v, + + // Consecutive '&'s - test whether the recovery is user-friendly + /[&&]/v, + /[&&&]/v, + /[&&&&]/v, + /[&&&&&]/v, + /[&&&&&&]/v, + + /[?&+]/v, + /[?&&+]/v, + /[?&&&+]/v, + /[?&&&&+]/v, + /[?&&&&&+]/v, + /[?&&&&&&+]/v, + + /[a&&]/v, + /[a&&&]/v, + /[a&&&&]/v, + /[a&&&&&]/v, + /[a&&&&&&]/v, + + /[ab&bc]/v, + /[ab&&bc]/v, + /[ab&&&bc]/v, + /[ab&&&&bc]/v, + /[ab&&&&&bc]/v, + /[ab&&&&&&bc]/v, + + /[a&&\&]/v, + /[a&&b&]/v, + /[a&&b&c]/v, + /[a&&b\&c]/v, + /[a&\&b\&]/v, + /[a\&&b&c]/v, + + // Consecutive '-'s - test whether the recovery is user-friendly + /[--]/v, + /[---]/v, + /[----]/v, + /[-----]/v, + /[------]/v, + + /[?-+]/v, + /[?--+]/v, + /[?---+]/v, + /[?----+]/v, + /[?-----+]/v, + /[?------+]/v, + + /[a--]/v, + /[a---]/v, + /[a----]/v, + /[a-----]/v, + /[a------]/v, + + /[ab-bc]/v, + /[ab--bc]/v, + /[ab---bc]/v, + /[ab----bc]/v, + /[ab-----bc]/v, + /[ab------bc]/v, + + /[a--\-]/v, + /[a--b-]/v, + /[a--b-c]/v, + /[a--b\-c]/v, + /[a-\-b\-]/v, + /[a\--b-c]/v, + + /[a--&]/v, + /[a--\&]/v, + /[a--b&]/v, + /[a--b&c]/v, + /[a--b\&c]/v, + /[a-\-b\&]/v, + /[a\--b&c]/v, + + // Error recovery test with mixed operators + /[a&&-]/v, + /[a&&\-]/v, + /[a&&b-]/v, + /[a&&b-c]/v, + /[a&&b\-c]/v, + /[a&\&b\-]/v, + /[a\&&b-c]/v, + + /[a--&b]/v, + /[a--&&b]/v, + /[a--&&&b]/v, + /[a--&&&&b]/v, + /[a---&&b]/v, + /[a----&&b]/v, + + /[a&&-b]/v, + /[a&&--b]/v, + /[a&&---b]/v, + /[a&&----b]/v, + /[a&&&--b]/v, + /[a&&&&--b]/v, + + /[a-b&c]/v, + /[a-b&&c]/v, + /[a-b&&&c]/v, + /[a-&b]/v, + /[a-&&b]/v, + /[a-&&&b]/v, + /[a&-b]/v, + /[a&--b]/v, + /[a&---b]/v, + + // Integrated hybrid tests + /[a--&&--&&--c]/v, + /[a--?&--&b--?&&--&&c]/v, + /[a--b&&c-&b--a-&-]/v, + /[a\--a&-?\&a&&-a--&b\-]/v, + /[a&&--&&--&&c]/v, + /[a&&?-&&-b&&?--&&--c]/v, + /[a&&b--c&-b&&a&-&]/v, + /[a\&&a-&?\-a--&a&&-b\&]/v, + /[a-&&--&&-c]/v, + /[a-?&--&b--?&&--&&c]/v, + /[a-b&&c-&b--a-&-]/v, + /[a-b&-?\&a&&-a--&b\-]/v, +]; + diff --git a/tests/baselines/reference/regularExpressionUnicodeSets.types b/tests/baselines/reference/regularExpressionUnicodeSets.types new file mode 100644 index 0000000000000..ba3f9b4b105b8 --- /dev/null +++ b/tests/baselines/reference/regularExpressionUnicodeSets.types @@ -0,0 +1,639 @@ +//// [tests/cases/compiler/regularExpressionUnicodeSets.ts] //// + +=== regularExpressionUnicodeSets.ts === +const regexes: RegExp[] = [ +>regexes : RegExp[] +> : ^^^^^^^^ +>[ // Single '&' - valid everywhere in class unions since it is not an operator /[&]/v, /[?&]/v, /[&?]/v, /[?&?]/v, /[&?&]/v, /[a&]/v, /[&a]/v, /[a&a]/v, /[&a&]/v, /[\?&]/v, /[&\?]/v, /[\?&\?]/v, /[&\?&]/v, /[\-&]/v, /[&\-]/v, /[\-&\-]/v, /[&\-&]/v, /[\?\&]/v, /[\&\?]/v, /[\&\&]/v, // Single '-' - incomplete character class ranges, which is invalid in Unicode sets mode /[-]/v, /[ab&-]/v, /[a&b&c-]/v, /[abc-]/v, /[-abc]/v, /[-a&bc]/v, /[-a&b&c]/v, /[-abc-]/v, /[-ab-c-]/v, /[-a-bc-]/v, /[-a-b-c-]/v, /[-a-bc-d-]/v, // Double '--', some of which are class subtractions /[--\-]/v, /[--\-&]/v, /[-\--&]/v, /[\--\-&]/v, /[\-\--&]/v, /[&--\-]/v, /[&---&]/v, /[&\---&]/v, /[&-\--&]/v, /[&--\-&]/v, // Double '&&', some of which are class intersections /[&&\&]/v, /[&&\&-]/v, /[&\&&-]/v, /[\&&\&-]/v, /[\&\&&-]/v, /[-&&\&]/v, /[-&&&-]/v, /[-\&&&-]/v, /[-&\&&-]/v, /[-&&\&-]/v, // Consecutive '&'s - test whether the recovery is user-friendly /[&&]/v, /[&&&]/v, /[&&&&]/v, /[&&&&&]/v, /[&&&&&&]/v, /[?&+]/v, /[?&&+]/v, /[?&&&+]/v, /[?&&&&+]/v, /[?&&&&&+]/v, /[?&&&&&&+]/v, /[a&&]/v, /[a&&&]/v, /[a&&&&]/v, /[a&&&&&]/v, /[a&&&&&&]/v, /[ab&bc]/v, /[ab&&bc]/v, /[ab&&&bc]/v, /[ab&&&&bc]/v, /[ab&&&&&bc]/v, /[ab&&&&&&bc]/v, /[a&&\&]/v, /[a&&b&]/v, /[a&&b&c]/v, /[a&&b\&c]/v, /[a&\&b\&]/v, /[a\&&b&c]/v, // Consecutive '-'s - test whether the recovery is user-friendly /[--]/v, /[---]/v, /[----]/v, /[-----]/v, /[------]/v, /[?-+]/v, /[?--+]/v, /[?---+]/v, /[?----+]/v, /[?-----+]/v, /[?------+]/v, /[a--]/v, /[a---]/v, /[a----]/v, /[a-----]/v, /[a------]/v, /[ab-bc]/v, /[ab--bc]/v, /[ab---bc]/v, /[ab----bc]/v, /[ab-----bc]/v, /[ab------bc]/v, /[a--\-]/v, /[a--b-]/v, /[a--b-c]/v, /[a--b\-c]/v, /[a-\-b\-]/v, /[a\--b-c]/v, /[a--&]/v, /[a--\&]/v, /[a--b&]/v, /[a--b&c]/v, /[a--b\&c]/v, /[a-\-b\&]/v, /[a\--b&c]/v, // Error recovery test with mixed operators /[a&&-]/v, /[a&&\-]/v, /[a&&b-]/v, /[a&&b-c]/v, /[a&&b\-c]/v, /[a&\&b\-]/v, /[a\&&b-c]/v, /[a--&b]/v, /[a--&&b]/v, /[a--&&&b]/v, /[a--&&&&b]/v, /[a---&&b]/v, /[a----&&b]/v, /[a&&-b]/v, /[a&&--b]/v, /[a&&---b]/v, /[a&&----b]/v, /[a&&&--b]/v, /[a&&&&--b]/v, /[a-b&c]/v, /[a-b&&c]/v, /[a-b&&&c]/v, /[a-&b]/v, /[a-&&b]/v, /[a-&&&b]/v, /[a&-b]/v, /[a&--b]/v, /[a&---b]/v, // Integrated hybrid tests /[a--&&--&&--c]/v, /[a--?&--&b--?&&--&&c]/v, /[a--b&&c-&b--a-&-]/v, /[a\--a&-?\&a&&-a--&b\-]/v, /[a&&--&&--&&c]/v, /[a&&?-&&-b&&?--&&--c]/v, /[a&&b--c&-b&&a&-&]/v, /[a\&&a-&?\-a--&a&&-b\&]/v, /[a-&&--&&-c]/v, /[a-?&--&b--?&&--&&c]/v, /[a-b&&c-&b--a-&-]/v, /[a-b&-?\&a&&-a--&b\-]/v,] : RegExp[] +> : ^^^^^^^^ + + // Single '&' - valid everywhere in class unions since it is not an operator + /[&]/v, +>/[&]/v : RegExp +> : ^^^^^^ + + /[?&]/v, +>/[?&]/v : RegExp +> : ^^^^^^ + + /[&?]/v, +>/[&?]/v : RegExp +> : ^^^^^^ + + /[?&?]/v, +>/[?&?]/v : RegExp +> : ^^^^^^ + + /[&?&]/v, +>/[&?&]/v : RegExp +> : ^^^^^^ + + /[a&]/v, +>/[a&]/v : RegExp +> : ^^^^^^ + + /[&a]/v, +>/[&a]/v : RegExp +> : ^^^^^^ + + /[a&a]/v, +>/[a&a]/v : RegExp +> : ^^^^^^ + + /[&a&]/v, +>/[&a&]/v : RegExp +> : ^^^^^^ + + /[\?&]/v, +>/[\?&]/v : RegExp +> : ^^^^^^ + + /[&\?]/v, +>/[&\?]/v : RegExp +> : ^^^^^^ + + /[\?&\?]/v, +>/[\?&\?]/v : RegExp +> : ^^^^^^ + + /[&\?&]/v, +>/[&\?&]/v : RegExp +> : ^^^^^^ + + /[\-&]/v, +>/[\-&]/v : RegExp +> : ^^^^^^ + + /[&\-]/v, +>/[&\-]/v : RegExp +> : ^^^^^^ + + /[\-&\-]/v, +>/[\-&\-]/v : RegExp +> : ^^^^^^ + + /[&\-&]/v, +>/[&\-&]/v : RegExp +> : ^^^^^^ + + /[\?\&]/v, +>/[\?\&]/v : RegExp +> : ^^^^^^ + + /[\&\?]/v, +>/[\&\?]/v : RegExp +> : ^^^^^^ + + /[\&\&]/v, +>/[\&\&]/v : RegExp +> : ^^^^^^ + + // Single '-' - incomplete character class ranges, which is invalid in Unicode sets mode + /[-]/v, +>/[-]/v : RegExp +> : ^^^^^^ + + /[ab&-]/v, +>/[ab&-]/v : RegExp +> : ^^^^^^ + + /[a&b&c-]/v, +>/[a&b&c-]/v : RegExp +> : ^^^^^^ + + /[abc-]/v, +>/[abc-]/v : RegExp +> : ^^^^^^ + + /[-abc]/v, +>/[-abc]/v : RegExp +> : ^^^^^^ + + /[-a&bc]/v, +>/[-a&bc]/v : RegExp +> : ^^^^^^ + + /[-a&b&c]/v, +>/[-a&b&c]/v : RegExp +> : ^^^^^^ + + /[-abc-]/v, +>/[-abc-]/v : RegExp +> : ^^^^^^ + + /[-ab-c-]/v, +>/[-ab-c-]/v : RegExp +> : ^^^^^^ + + /[-a-bc-]/v, +>/[-a-bc-]/v : RegExp +> : ^^^^^^ + + /[-a-b-c-]/v, +>/[-a-b-c-]/v : RegExp +> : ^^^^^^ + + /[-a-bc-d-]/v, +>/[-a-bc-d-]/v : RegExp +> : ^^^^^^ + + // Double '--', some of which are class subtractions + /[--\-]/v, +>/[--\-]/v : RegExp +> : ^^^^^^ + + /[--\-&]/v, +>/[--\-&]/v : RegExp +> : ^^^^^^ + + /[-\--&]/v, +>/[-\--&]/v : RegExp +> : ^^^^^^ + + /[\--\-&]/v, +>/[\--\-&]/v : RegExp +> : ^^^^^^ + + /[\-\--&]/v, +>/[\-\--&]/v : RegExp +> : ^^^^^^ + + /[&--\-]/v, +>/[&--\-]/v : RegExp +> : ^^^^^^ + + /[&---&]/v, +>/[&---&]/v : RegExp +> : ^^^^^^ + + /[&\---&]/v, +>/[&\---&]/v : RegExp +> : ^^^^^^ + + /[&-\--&]/v, +>/[&-\--&]/v : RegExp +> : ^^^^^^ + + /[&--\-&]/v, +>/[&--\-&]/v : RegExp +> : ^^^^^^ + + // Double '&&', some of which are class intersections + /[&&\&]/v, +>/[&&\&]/v : RegExp +> : ^^^^^^ + + /[&&\&-]/v, +>/[&&\&-]/v : RegExp +> : ^^^^^^ + + /[&\&&-]/v, +>/[&\&&-]/v : RegExp +> : ^^^^^^ + + /[\&&\&-]/v, +>/[\&&\&-]/v : RegExp +> : ^^^^^^ + + /[\&\&&-]/v, +>/[\&\&&-]/v : RegExp +> : ^^^^^^ + + /[-&&\&]/v, +>/[-&&\&]/v : RegExp +> : ^^^^^^ + + /[-&&&-]/v, +>/[-&&&-]/v : RegExp +> : ^^^^^^ + + /[-\&&&-]/v, +>/[-\&&&-]/v : RegExp +> : ^^^^^^ + + /[-&\&&-]/v, +>/[-&\&&-]/v : RegExp +> : ^^^^^^ + + /[-&&\&-]/v, +>/[-&&\&-]/v : RegExp +> : ^^^^^^ + + // Consecutive '&'s - test whether the recovery is user-friendly + /[&&]/v, +>/[&&]/v : RegExp +> : ^^^^^^ + + /[&&&]/v, +>/[&&&]/v : RegExp +> : ^^^^^^ + + /[&&&&]/v, +>/[&&&&]/v : RegExp +> : ^^^^^^ + + /[&&&&&]/v, +>/[&&&&&]/v : RegExp +> : ^^^^^^ + + /[&&&&&&]/v, +>/[&&&&&&]/v : RegExp +> : ^^^^^^ + + /[?&+]/v, +>/[?&+]/v : RegExp +> : ^^^^^^ + + /[?&&+]/v, +>/[?&&+]/v : RegExp +> : ^^^^^^ + + /[?&&&+]/v, +>/[?&&&+]/v : RegExp +> : ^^^^^^ + + /[?&&&&+]/v, +>/[?&&&&+]/v : RegExp +> : ^^^^^^ + + /[?&&&&&+]/v, +>/[?&&&&&+]/v : RegExp +> : ^^^^^^ + + /[?&&&&&&+]/v, +>/[?&&&&&&+]/v : RegExp +> : ^^^^^^ + + /[a&&]/v, +>/[a&&]/v : RegExp +> : ^^^^^^ + + /[a&&&]/v, +>/[a&&&]/v : RegExp +> : ^^^^^^ + + /[a&&&&]/v, +>/[a&&&&]/v : RegExp +> : ^^^^^^ + + /[a&&&&&]/v, +>/[a&&&&&]/v : RegExp +> : ^^^^^^ + + /[a&&&&&&]/v, +>/[a&&&&&&]/v : RegExp +> : ^^^^^^ + + /[ab&bc]/v, +>/[ab&bc]/v : RegExp +> : ^^^^^^ + + /[ab&&bc]/v, +>/[ab&&bc]/v : RegExp +> : ^^^^^^ + + /[ab&&&bc]/v, +>/[ab&&&bc]/v : RegExp +> : ^^^^^^ + + /[ab&&&&bc]/v, +>/[ab&&&&bc]/v : RegExp +> : ^^^^^^ + + /[ab&&&&&bc]/v, +>/[ab&&&&&bc]/v : RegExp +> : ^^^^^^ + + /[ab&&&&&&bc]/v, +>/[ab&&&&&&bc]/v : RegExp +> : ^^^^^^ + + /[a&&\&]/v, +>/[a&&\&]/v : RegExp +> : ^^^^^^ + + /[a&&b&]/v, +>/[a&&b&]/v : RegExp +> : ^^^^^^ + + /[a&&b&c]/v, +>/[a&&b&c]/v : RegExp +> : ^^^^^^ + + /[a&&b\&c]/v, +>/[a&&b\&c]/v : RegExp +> : ^^^^^^ + + /[a&\&b\&]/v, +>/[a&\&b\&]/v : RegExp +> : ^^^^^^ + + /[a\&&b&c]/v, +>/[a\&&b&c]/v : RegExp +> : ^^^^^^ + + // Consecutive '-'s - test whether the recovery is user-friendly + /[--]/v, +>/[--]/v : RegExp +> : ^^^^^^ + + /[---]/v, +>/[---]/v : RegExp +> : ^^^^^^ + + /[----]/v, +>/[----]/v : RegExp +> : ^^^^^^ + + /[-----]/v, +>/[-----]/v : RegExp +> : ^^^^^^ + + /[------]/v, +>/[------]/v : RegExp +> : ^^^^^^ + + /[?-+]/v, +>/[?-+]/v : RegExp +> : ^^^^^^ + + /[?--+]/v, +>/[?--+]/v : RegExp +> : ^^^^^^ + + /[?---+]/v, +>/[?---+]/v : RegExp +> : ^^^^^^ + + /[?----+]/v, +>/[?----+]/v : RegExp +> : ^^^^^^ + + /[?-----+]/v, +>/[?-----+]/v : RegExp +> : ^^^^^^ + + /[?------+]/v, +>/[?------+]/v : RegExp +> : ^^^^^^ + + /[a--]/v, +>/[a--]/v : RegExp +> : ^^^^^^ + + /[a---]/v, +>/[a---]/v : RegExp +> : ^^^^^^ + + /[a----]/v, +>/[a----]/v : RegExp +> : ^^^^^^ + + /[a-----]/v, +>/[a-----]/v : RegExp +> : ^^^^^^ + + /[a------]/v, +>/[a------]/v : RegExp +> : ^^^^^^ + + /[ab-bc]/v, +>/[ab-bc]/v : RegExp +> : ^^^^^^ + + /[ab--bc]/v, +>/[ab--bc]/v : RegExp +> : ^^^^^^ + + /[ab---bc]/v, +>/[ab---bc]/v : RegExp +> : ^^^^^^ + + /[ab----bc]/v, +>/[ab----bc]/v : RegExp +> : ^^^^^^ + + /[ab-----bc]/v, +>/[ab-----bc]/v : RegExp +> : ^^^^^^ + + /[ab------bc]/v, +>/[ab------bc]/v : RegExp +> : ^^^^^^ + + /[a--\-]/v, +>/[a--\-]/v : RegExp +> : ^^^^^^ + + /[a--b-]/v, +>/[a--b-]/v : RegExp +> : ^^^^^^ + + /[a--b-c]/v, +>/[a--b-c]/v : RegExp +> : ^^^^^^ + + /[a--b\-c]/v, +>/[a--b\-c]/v : RegExp +> : ^^^^^^ + + /[a-\-b\-]/v, +>/[a-\-b\-]/v : RegExp +> : ^^^^^^ + + /[a\--b-c]/v, +>/[a\--b-c]/v : RegExp +> : ^^^^^^ + + /[a--&]/v, +>/[a--&]/v : RegExp +> : ^^^^^^ + + /[a--\&]/v, +>/[a--\&]/v : RegExp +> : ^^^^^^ + + /[a--b&]/v, +>/[a--b&]/v : RegExp +> : ^^^^^^ + + /[a--b&c]/v, +>/[a--b&c]/v : RegExp +> : ^^^^^^ + + /[a--b\&c]/v, +>/[a--b\&c]/v : RegExp +> : ^^^^^^ + + /[a-\-b\&]/v, +>/[a-\-b\&]/v : RegExp +> : ^^^^^^ + + /[a\--b&c]/v, +>/[a\--b&c]/v : RegExp +> : ^^^^^^ + + // Error recovery test with mixed operators + /[a&&-]/v, +>/[a&&-]/v : RegExp +> : ^^^^^^ + + /[a&&\-]/v, +>/[a&&\-]/v : RegExp +> : ^^^^^^ + + /[a&&b-]/v, +>/[a&&b-]/v : RegExp +> : ^^^^^^ + + /[a&&b-c]/v, +>/[a&&b-c]/v : RegExp +> : ^^^^^^ + + /[a&&b\-c]/v, +>/[a&&b\-c]/v : RegExp +> : ^^^^^^ + + /[a&\&b\-]/v, +>/[a&\&b\-]/v : RegExp +> : ^^^^^^ + + /[a\&&b-c]/v, +>/[a\&&b-c]/v : RegExp +> : ^^^^^^ + + /[a--&b]/v, +>/[a--&b]/v : RegExp +> : ^^^^^^ + + /[a--&&b]/v, +>/[a--&&b]/v : RegExp +> : ^^^^^^ + + /[a--&&&b]/v, +>/[a--&&&b]/v : RegExp +> : ^^^^^^ + + /[a--&&&&b]/v, +>/[a--&&&&b]/v : RegExp +> : ^^^^^^ + + /[a---&&b]/v, +>/[a---&&b]/v : RegExp +> : ^^^^^^ + + /[a----&&b]/v, +>/[a----&&b]/v : RegExp +> : ^^^^^^ + + /[a&&-b]/v, +>/[a&&-b]/v : RegExp +> : ^^^^^^ + + /[a&&--b]/v, +>/[a&&--b]/v : RegExp +> : ^^^^^^ + + /[a&&---b]/v, +>/[a&&---b]/v : RegExp +> : ^^^^^^ + + /[a&&----b]/v, +>/[a&&----b]/v : RegExp +> : ^^^^^^ + + /[a&&&--b]/v, +>/[a&&&--b]/v : RegExp +> : ^^^^^^ + + /[a&&&&--b]/v, +>/[a&&&&--b]/v : RegExp +> : ^^^^^^ + + /[a-b&c]/v, +>/[a-b&c]/v : RegExp +> : ^^^^^^ + + /[a-b&&c]/v, +>/[a-b&&c]/v : RegExp +> : ^^^^^^ + + /[a-b&&&c]/v, +>/[a-b&&&c]/v : RegExp +> : ^^^^^^ + + /[a-&b]/v, +>/[a-&b]/v : RegExp +> : ^^^^^^ + + /[a-&&b]/v, +>/[a-&&b]/v : RegExp +> : ^^^^^^ + + /[a-&&&b]/v, +>/[a-&&&b]/v : RegExp +> : ^^^^^^ + + /[a&-b]/v, +>/[a&-b]/v : RegExp +> : ^^^^^^ + + /[a&--b]/v, +>/[a&--b]/v : RegExp +> : ^^^^^^ + + /[a&---b]/v, +>/[a&---b]/v : RegExp +> : ^^^^^^ + + // Integrated hybrid tests + /[a--&&--&&--c]/v, +>/[a--&&--&&--c]/v : RegExp +> : ^^^^^^ + + /[a--?&--&b--?&&--&&c]/v, +>/[a--?&--&b--?&&--&&c]/v : RegExp +> : ^^^^^^ + + /[a--b&&c-&b--a-&-]/v, +>/[a--b&&c-&b--a-&-]/v : RegExp +> : ^^^^^^ + + /[a\--a&-?\&a&&-a--&b\-]/v, +>/[a\--a&-?\&a&&-a--&b\-]/v : RegExp +> : ^^^^^^ + + /[a&&--&&--&&c]/v, +>/[a&&--&&--&&c]/v : RegExp +> : ^^^^^^ + + /[a&&?-&&-b&&?--&&--c]/v, +>/[a&&?-&&-b&&?--&&--c]/v : RegExp +> : ^^^^^^ + + /[a&&b--c&-b&&a&-&]/v, +>/[a&&b--c&-b&&a&-&]/v : RegExp +> : ^^^^^^ + + /[a\&&a-&?\-a--&a&&-b\&]/v, +>/[a\&&a-&?\-a--&a&&-b\&]/v : RegExp +> : ^^^^^^ + + /[a-&&--&&-c]/v, +>/[a-&&--&&-c]/v : RegExp +> : ^^^^^^ + + /[a-?&--&b--?&&--&&c]/v, +>/[a-?&--&b--?&&--&&c]/v : RegExp +> : ^^^^^^ + + /[a-b&&c-&b--a-&-]/v, +>/[a-b&&c-&b--a-&-]/v : RegExp +> : ^^^^^^ + + /[a-b&-?\&a&&-a--&b\-]/v, +>/[a-b&-?\&a&&-a--&b\-]/v : RegExp +> : ^^^^^^ + +]; + diff --git a/tests/cases/compiler/regularExpressionUnicodeSets.ts b/tests/cases/compiler/regularExpressionUnicodeSets.ts new file mode 100644 index 0000000000000..45bc1390c21aa --- /dev/null +++ b/tests/cases/compiler/regularExpressionUnicodeSets.ts @@ -0,0 +1,188 @@ +// @target: esnext + +const regexes: RegExp[] = [ + // Single '&' - valid everywhere in class unions since it is not an operator + /[&]/v, + /[?&]/v, + /[&?]/v, + /[?&?]/v, + /[&?&]/v, + /[a&]/v, + /[&a]/v, + /[a&a]/v, + /[&a&]/v, + + /[\?&]/v, + /[&\?]/v, + /[\?&\?]/v, + /[&\?&]/v, + /[\-&]/v, + /[&\-]/v, + /[\-&\-]/v, + /[&\-&]/v, + + /[\?\&]/v, + /[\&\?]/v, + /[\&\&]/v, + + // Single '-' - incomplete character class ranges, which is invalid in Unicode sets mode + /[-]/v, + /[ab&-]/v, + /[a&b&c-]/v, + /[abc-]/v, + /[-abc]/v, + /[-a&bc]/v, + /[-a&b&c]/v, + /[-abc-]/v, + /[-ab-c-]/v, + /[-a-bc-]/v, + /[-a-b-c-]/v, + /[-a-bc-d-]/v, + + // Double '--', some of which are class subtractions + /[--\-]/v, + /[--\-&]/v, + /[-\--&]/v, + /[\--\-&]/v, + /[\-\--&]/v, + /[&--\-]/v, + /[&---&]/v, + /[&\---&]/v, + /[&-\--&]/v, + /[&--\-&]/v, + + // Double '&&', some of which are class intersections + /[&&\&]/v, + /[&&\&-]/v, + /[&\&&-]/v, + /[\&&\&-]/v, + /[\&\&&-]/v, + /[-&&\&]/v, + /[-&&&-]/v, + /[-\&&&-]/v, + /[-&\&&-]/v, + /[-&&\&-]/v, + + // Consecutive '&'s - test whether the recovery is user-friendly + /[&&]/v, + /[&&&]/v, + /[&&&&]/v, + /[&&&&&]/v, + /[&&&&&&]/v, + + /[?&+]/v, + /[?&&+]/v, + /[?&&&+]/v, + /[?&&&&+]/v, + /[?&&&&&+]/v, + /[?&&&&&&+]/v, + + /[a&&]/v, + /[a&&&]/v, + /[a&&&&]/v, + /[a&&&&&]/v, + /[a&&&&&&]/v, + + /[ab&bc]/v, + /[ab&&bc]/v, + /[ab&&&bc]/v, + /[ab&&&&bc]/v, + /[ab&&&&&bc]/v, + /[ab&&&&&&bc]/v, + + /[a&&\&]/v, + /[a&&b&]/v, + /[a&&b&c]/v, + /[a&&b\&c]/v, + /[a&\&b\&]/v, + /[a\&&b&c]/v, + + // Consecutive '-'s - test whether the recovery is user-friendly + /[--]/v, + /[---]/v, + /[----]/v, + /[-----]/v, + /[------]/v, + + /[?-+]/v, + /[?--+]/v, + /[?---+]/v, + /[?----+]/v, + /[?-----+]/v, + /[?------+]/v, + + /[a--]/v, + /[a---]/v, + /[a----]/v, + /[a-----]/v, + /[a------]/v, + + /[ab-bc]/v, + /[ab--bc]/v, + /[ab---bc]/v, + /[ab----bc]/v, + /[ab-----bc]/v, + /[ab------bc]/v, + + /[a--\-]/v, + /[a--b-]/v, + /[a--b-c]/v, + /[a--b\-c]/v, + /[a-\-b\-]/v, + /[a\--b-c]/v, + + /[a--&]/v, + /[a--\&]/v, + /[a--b&]/v, + /[a--b&c]/v, + /[a--b\&c]/v, + /[a-\-b\&]/v, + /[a\--b&c]/v, + + // Error recovery test with mixed operators + /[a&&-]/v, + /[a&&\-]/v, + /[a&&b-]/v, + /[a&&b-c]/v, + /[a&&b\-c]/v, + /[a&\&b\-]/v, + /[a\&&b-c]/v, + + /[a--&b]/v, + /[a--&&b]/v, + /[a--&&&b]/v, + /[a--&&&&b]/v, + /[a---&&b]/v, + /[a----&&b]/v, + + /[a&&-b]/v, + /[a&&--b]/v, + /[a&&---b]/v, + /[a&&----b]/v, + /[a&&&--b]/v, + /[a&&&&--b]/v, + + /[a-b&c]/v, + /[a-b&&c]/v, + /[a-b&&&c]/v, + /[a-&b]/v, + /[a-&&b]/v, + /[a-&&&b]/v, + /[a&-b]/v, + /[a&--b]/v, + /[a&---b]/v, + + // Integrated hybrid tests + /[a--&&--&&--c]/v, + /[a--?&--&b--?&&--&&c]/v, + /[a--b&&c-&b--a-&-]/v, + /[a\--a&-?\&a&&-a--&b\-]/v, + /[a&&--&&--&&c]/v, + /[a&&?-&&-b&&?--&&--c]/v, + /[a&&b--c&-b&&a&-&]/v, + /[a\&&a-&?\-a--&a&&-b\&]/v, + /[a-&&--&&-c]/v, + /[a-?&--&b--?&&--&&c]/v, + /[a-b&&c-&b--a-&-]/v, + /[a-b&-?\&a&&-a--&b\-]/v, +];