diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 1e19463d793..9a32c6d0d7b 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -679,6 +679,7 @@ type Checker struct { markedAssignmentSymbolLinks core.LinkStore[*ast.Symbol, MarkedAssignmentSymbolLinks] symbolContainerLinks core.LinkStore[*ast.Symbol, ContainingSymbolLinks] sourceFileLinks core.LinkStore[*ast.SourceFile, SourceFileLinks] + regExpScanner *scanner.Scanner patternForType map[*Type]*ast.Node contextFreeTypes map[*ast.Node]*Type anyType *Type diff --git a/internal/checker/grammarchecks.go b/internal/checker/grammarchecks.go index 6eba92c3c7f..12a5f8b7fec 100644 --- a/internal/checker/grammarchecks.go +++ b/internal/checker/grammarchecks.go @@ -54,43 +54,35 @@ func (c *Checker) grammarErrorOnNodeSkippedOnNoEmit(node *ast.Node, message *dia return false } -func (c *Checker) checkGrammarRegularExpressionLiteral(_ *ast.RegularExpressionLiteral) bool { - // !!! - // Unclear if this is needed until regular expression parsing is more thoroughly implemented. +func (c *Checker) checkGrammarRegularExpressionLiteral(node *ast.RegularExpressionLiteral) bool { + sourceFile := ast.GetSourceFileOfNode(node.AsNode()) + if !c.hasParseDiagnostics(sourceFile) { + var lastError *ast.Diagnostic + if c.regExpScanner == nil { + c.regExpScanner = scanner.NewScanner() + } + c.regExpScanner.SetScriptTarget(c.languageVersion) + c.regExpScanner.SetLanguageVariant(sourceFile.LanguageVariant) + c.regExpScanner.SetOnError(func(message *diagnostics.Message, start int, length int, args ...any) { + if message.Category() == diagnostics.CategoryMessage && lastError != nil && start == lastError.Pos() && length == lastError.Len() { + // For providing spelling suggestions. + err := ast.NewDiagnostic(nil, core.NewTextRange(start, start+length), message, args...) + lastError.AddRelatedInfo(err) + } else if lastError == nil || start != lastError.Pos() { + lastError = ast.NewDiagnostic(sourceFile, core.NewTextRange(start, start+length), message, args...) + c.diagnostics.Add(lastError) + } + }) + c.regExpScanner.SetText(sourceFile.Text()) + c.regExpScanner.ResetTokenState(node.AsNode().Pos()) + c.regExpScanner.Scan() + tokenIsRegularExpressionLiteral := c.regExpScanner.ReScanSlashToken(true) == ast.KindRegularExpressionLiteral + c.regExpScanner.SetText("") + c.regExpScanner.SetOnError(nil) + debug.Assert(tokenIsRegularExpressionLiteral) + return lastError != nil + } return false - // sourceFile := ast.GetSourceFileOfNode(node.AsNode()) - // if !c.hasParseDiagnostics(sourceFile) && !node.IsUnterminated { - // var lastError *ast.Diagnostic - // scanner := NewScanner() - // scanner.skipTrivia = true - // scanner.SetScriptTarget(sourceFile.LanguageVersion) - // scanner.SetLanguageVariant(sourceFile.LanguageVariant) - // scanner.SetOnError(func(message *diagnostics.Message, start int, length int, args ...any) { - // // !!! - // // Original uses `tokenEnd()` - unclear if this is the same as the `start` passed in here. - // // const start = scanner.TokenEnd() - - // // The scanner is operating on a slice of the original source text, so we need to adjust the start - // // for error reporting. - // start = start + node.Pos() - - // // For providing spelling suggestions - // if message.Category() == diagnostics.CategoryMessage && lastError != nil && start == lastError.Pos() && length == lastError.Len() { - // err := ast.NewDiagnostic(sourceFile, core.NewTextRange(start, start+length), message, args) - // lastError.AddRelatedInfo(err) - // } else if !(lastError != nil) || start != lastError.Pos() { - // lastError = ast.NewDiagnostic(sourceFile, core.NewTextRange(start, start+length), message, args) - // c.diagnostics.Add(lastError) - // } - // }) - // scanner.SetText(sourceFile.Text[node.Pos():node.Loc.Len()]) - // scanner.Scan() - // if scanner.ReScanSlashToken() != ast.KindRegularExpressionLiteral { - // panic("Expected to rescan RegularExpressionLiteral") - // } - // return lastError != nil - // } - // return false } func (c *Checker) checkGrammarPrivateIdentifierExpression(privId *ast.PrivateIdentifier) bool { diff --git a/internal/scanner/regexp.go b/internal/scanner/regexp.go new file mode 100644 index 00000000000..5f42804a09f --- /dev/null +++ b/internal/scanner/regexp.go @@ -0,0 +1,1088 @@ +package scanner + +import ( + "math" + "strconv" + "strings" + "unicode/utf8" + + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/debug" + "github.com/microsoft/typescript-go/internal/diagnostics" + "github.com/microsoft/typescript-go/internal/stringutil" +) + +type regularExpressionFlags int32 + +const ( + regularExpressionFlagsNone regularExpressionFlags = 0 + regularExpressionFlagsHasIndices regularExpressionFlags = 1 << 0 // d + regularExpressionFlagsGlobal regularExpressionFlags = 1 << 1 // g + regularExpressionFlagsIgnoreCase regularExpressionFlags = 1 << 2 // i + regularExpressionFlagsMultiline regularExpressionFlags = 1 << 3 // m + regularExpressionFlagsDotAll regularExpressionFlags = 1 << 4 // s + regularExpressionFlagsUnicode regularExpressionFlags = 1 << 5 // u + regularExpressionFlagsUnicodeSets regularExpressionFlags = 1 << 6 // v + regularExpressionFlagsSticky regularExpressionFlags = 1 << 7 // y + regularExpressionFlagsAnyUnicodeMode regularExpressionFlags = regularExpressionFlagsUnicode | regularExpressionFlagsUnicodeSets + regularExpressionFlagsModifiers regularExpressionFlags = regularExpressionFlagsIgnoreCase | regularExpressionFlagsMultiline | regularExpressionFlagsDotAll +) + +var charCodeToRegExpFlag = map[rune]regularExpressionFlags{ + 'd': regularExpressionFlagsHasIndices, + 'g': regularExpressionFlagsGlobal, + 'i': regularExpressionFlagsIgnoreCase, + 'm': regularExpressionFlagsMultiline, + 's': regularExpressionFlagsDotAll, + 'u': regularExpressionFlagsUnicode, + 'v': regularExpressionFlagsUnicodeSets, + 'y': regularExpressionFlagsSticky, +} + +var regExpFlagToFirstAvailableLanguageVersion = map[regularExpressionFlags]core.ScriptTarget{ + regularExpressionFlagsHasIndices: core.ScriptTargetES2022, + regularExpressionFlagsDotAll: core.ScriptTargetES2018, + regularExpressionFlagsUnicodeSets: core.ScriptTargetES2024, +} + +func (s *Scanner) checkRegularExpressionFlagAvailability(flag regularExpressionFlags, pos int, size int) { + if availableFrom, ok := regExpFlagToFirstAvailableLanguageVersion[flag]; ok && s.languageVersion() < availableFrom { + s.errorAt(diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, size, strings.ToLower(availableFrom.String())) + } +} + +type classSetExpressionType int + +const ( + classSetExpressionTypeUnknown classSetExpressionType = iota + classSetExpressionTypeClassUnion + classSetExpressionTypeClassIntersection + classSetExpressionTypeClassSubtraction +) + +type groupNameReference struct { + pos int + end int + name string +} + +type decimalEscapeValue struct { + pos int + end int + value int +} + +type regExpParser struct { + scanner *Scanner + end int + regExpFlags regularExpressionFlags + anyUnicodeMode bool + unicodeSetsMode bool + annexB bool + + anyUnicodeModeOrNonAnnexB bool + namedCaptureGroups bool + + // See scanClassSetExpression. + mayContainStrings bool + // The number of all (named and unnamed) capturing groups defined in the regex. + numberOfCapturingGroups int + // All named capturing groups defined in the regex. + groupSpecifiers map[string]bool + // All references to named capturing groups in the regex. + groupNameReferences []groupNameReference + // All numeric backreferences within the regex. + decimalEscapes []decimalEscapeValue + // A stack of scopes for named capturing groups. See scanGroupName. + namedCapturingGroups []map[string]bool + + // pendingLowSurrogate holds the low surrogate to emit on the next + // scanSourceCharacter call when Corsa has to split a non-BMP rune into + // UTF-16 surrogate code units in non-unicode mode. Strada did not need + // this bookkeeping because its source text was already indexed as UTF-16. + pendingLowSurrogate rune +} + +func (p *regExpParser) pos() int { + return p.scanner.pos +} + +func (p *regExpParser) setPos(v int) { + p.scanner.pos = v +} + +func (p *regExpParser) incPos(n int) { + p.scanner.pos += n +} + +func (p *regExpParser) char() rune { + return p.scanner.char() +} + +func (p *regExpParser) charAt(pos int) rune { + return p.scanner.charAt(pos - p.pos()) +} + +func (p *regExpParser) error(msg *diagnostics.Message, pos int, length int, args ...any) { + p.scanner.errorAt(msg, pos, length, args...) +} + +func (p *regExpParser) text() string { + return p.scanner.text +} + +func compareDecimalStrings(a string, b string) int { + a = strings.TrimLeft(a, "0") + b = strings.TrimLeft(b, "0") + if a == "" { + a = "0" + } + if b == "" { + b = "0" + } + if len(a) != len(b) { + if len(a) < len(b) { + return -1 + } + return 1 + } + return strings.Compare(a, b) +} + +// Disjunction ::= Alternative ('|' Alternative)* +func (p *regExpParser) scanDisjunction(isInGroup bool) { + for { + p.namedCapturingGroups = append(p.namedCapturingGroups, make(map[string]bool)) + p.scanAlternative(isInGroup) + p.namedCapturingGroups = p.namedCapturingGroups[:len(p.namedCapturingGroups)-1] + if p.char() != '|' { + return + } + p.incPos(1) + } +} + +// Alternative ::= Term* +// Term ::= +// +// | Assertion +// | Atom Quantifier? +// +// Assertion ::= +// +// | '^' +// | '$' +// | '\b' +// | '\B' +// | '(?=' Disjunction ')' +// | '(?!' Disjunction ')' +// | '(?<=' Disjunction ')' +// | '(?' Disjunction ')' +// | '(?' RegularExpressionFlags ('-' RegularExpressionFlags)? ':' Disjunction ')' +// +// CharacterClass ::= unicodeMode +// +// ? '[' ClassRanges ']' +// : '[' ClassSetExpression ']' +func (p *regExpParser) scanAlternative(isInGroup bool) { + isPreviousTermQuantifiable := false + for p.pos() < p.end { + start := p.pos() + ch := p.char() + switch ch { + case '^', '$': + p.incPos(1) + isPreviousTermQuantifiable = false + case '\\': + p.incPos(1) + switch p.char() { + case 'b', 'B': + p.incPos(1) + isPreviousTermQuantifiable = false + default: + p.scanAtomEscape() + isPreviousTermQuantifiable = true + } + case '(': + p.incPos(1) + if p.char() == '?' { + p.incPos(1) + switch p.char() { + case '=', '!': + p.incPos(1) + // In Annex B, `(?=Disjunction)` and `(?!Disjunction)` are quantifiable + isPreviousTermQuantifiable = !p.anyUnicodeModeOrNonAnnexB + case '<': + groupNameStart := p.pos() + p.incPos(1) + switch p.char() { + case '=', '!': + p.incPos(1) + isPreviousTermQuantifiable = false + default: + p.scanGroupName(false /*isReference*/) + p.scanExpectedChar('>') + if p.scanner.languageVersion() < core.ScriptTargetES2018 { + p.error(diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, p.pos()-groupNameStart) + } + p.numberOfCapturingGroups++ + isPreviousTermQuantifiable = true + } + default: + flagsStart := p.pos() + setFlags := p.scanPatternModifiers(regularExpressionFlagsNone) + if p.char() == '-' { + p.incPos(1) + p.scanPatternModifiers(setFlags) + if p.pos() == flagsStart+1 { + p.error(diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, flagsStart, p.pos()-flagsStart) + } + } + p.scanExpectedChar(':') + isPreviousTermQuantifiable = true + } + } else { + p.numberOfCapturingGroups++ + isPreviousTermQuantifiable = true + } + p.scanDisjunction(true /*isInGroup*/) + p.scanExpectedChar(')') + case '{': + p.incPos(1) + digitsStart := p.pos() + p.scanDigits() + minStr := p.scanner.tokenValue + if !p.anyUnicodeModeOrNonAnnexB && minStr == "" { + isPreviousTermQuantifiable = true + continue + } + if p.char() == ',' { + p.incPos(1) + p.scanDigits() + maxStr := p.scanner.tokenValue + if minStr == "" { + if maxStr != "" || p.char() == '}' { + p.error(diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0) + } else { + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start, 1, string(ch)) + isPreviousTermQuantifiable = true + continue + } + } else if maxStr != "" { + if compareDecimalStrings(minStr, maxStr) > 0 && (p.anyUnicodeModeOrNonAnnexB || p.char() == '}') { + p.error(diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, p.pos()-digitsStart) + } + } + } else if minStr == "" { + if p.anyUnicodeModeOrNonAnnexB { + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start, 1, string(ch)) + } + isPreviousTermQuantifiable = true + continue + } + if p.char() != '}' { + if p.anyUnicodeModeOrNonAnnexB { + p.error(diagnostics.X_0_expected, p.pos(), 0, "}") + p.incPos(-1) + } else { + isPreviousTermQuantifiable = true + continue + } + } + fallthrough + case '*', '+', '?': + p.incPos(1) + if p.char() == '?' { + // Non-greedy + p.incPos(1) + } + if !isPreviousTermQuantifiable { + p.error(diagnostics.There_is_nothing_available_for_repetition, start, p.pos()-start) + } + isPreviousTermQuantifiable = false + case '.': + p.incPos(1) + isPreviousTermQuantifiable = true + case '[': + p.incPos(1) + if p.unicodeSetsMode { + p.scanClassSetExpression() + } else { + p.scanClassRanges() + p.pendingLowSurrogate = 0 + } + p.scanExpectedChar(']') + isPreviousTermQuantifiable = true + case ')': + if isInGroup { + return + } + fallthrough + case ']', '}': + if p.anyUnicodeModeOrNonAnnexB || ch == ')' { + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, p.pos(), 1, string(ch)) + } + p.incPos(1) + isPreviousTermQuantifiable = true + case '/', '|': + return + default: + p.scanSourceCharacter() + isPreviousTermQuantifiable = true + } + } +} + +func (p *regExpParser) scanPatternModifiers(currFlags regularExpressionFlags) regularExpressionFlags { + for p.pos() < p.end { + ch, size := utf8.DecodeRuneInString(p.text()[p.pos():]) + if ch == utf8.RuneError || !IsIdentifierPart(ch) { + break + } + flag, ok := charCodeToRegExpFlag[ch] + if !ok { + p.error(diagnostics.Unknown_regular_expression_flag, p.pos(), size) + } else if currFlags&flag != 0 { + p.error(diagnostics.Duplicate_regular_expression_flag, p.pos(), size) + } else if flag®ularExpressionFlagsModifiers == 0 { + p.error(diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, p.pos(), size) + } else { + currFlags |= flag + p.scanner.checkRegularExpressionFlagAvailability(flag, p.pos(), size) + } + p.incPos(size) + } + return currFlags +} + +// AtomEscape ::= +// +// | DecimalEscape +// | CharacterClassEscape +// | CharacterEscape +// | 'k<' RegExpIdentifierName '>' +func (p *regExpParser) scanAtomEscape() { + debug.Assert(p.pos() > 0 && p.text()[p.pos()-1] == '\\') + switch p.char() { + case 'k': + p.incPos(1) + if p.char() == '<' { + p.incPos(1) + p.scanGroupName(true /*isReference*/) + p.scanExpectedChar('>') + } else if p.anyUnicodeModeOrNonAnnexB || p.namedCaptureGroups { + p.error(diagnostics.X_k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, p.pos()-2, 2) + } + case 'q': + if p.unicodeSetsMode { + p.incPos(1) + p.error(diagnostics.X_q_is_only_available_inside_character_class, p.pos()-2, 2) + return + } + fallthrough + default: + if !p.scanCharacterClassEscape() && !p.scanDecimalEscape() { + // Regex literals cannot contain line breaks here, so a character escape must consume something. + debug.Assert(p.scanCharacterEscape(true /*atomEscape*/) != "") + } + } +} + +// DecimalEscape ::= [1-9] [0-9]* +func (p *regExpParser) scanDecimalEscape() bool { + debug.Assert(p.pos() > 0 && p.text()[p.pos()-1] == '\\') + ch := p.char() + if ch >= '1' && ch <= '9' { + start := p.pos() + p.scanDigits() + val, err := strconv.Atoi(p.scanner.tokenValue) + if err != nil { + val = math.MaxInt + } + p.decimalEscapes = append(p.decimalEscapes, decimalEscapeValue{pos: start, end: p.pos(), value: val}) + return true + } + return false +} + +// CharacterEscape ::= +// +// | `c` ControlLetter +// | IdentityEscape +// | (Other sequences handled by `scanEscapeSequence`) +// +// IdentityEscape ::= +// +// | '^' | '$' | '/' | '\' | '.' | '*' | '+' | '?' | '(' | ')' | '[' | ']' | '{' | '}' | '|' +// | [~AnyUnicodeMode] (any other non-identifier characters) +func (p *regExpParser) scanCharacterEscape(atomEscape bool) string { + debug.Assert(p.pos() > 0 && p.text()[p.pos()-1] == '\\') + ch := p.char() + switch ch { + case -1: + p.error(diagnostics.Undetermined_character_escape, p.pos()-1, 1) + return "\\" + case 'c': + p.incPos(1) + ch = p.char() + if stringutil.IsASCIILetter(ch) { + p.incPos(1) + return string(ch & 0x1f) + } + if p.anyUnicodeModeOrNonAnnexB { + p.error(diagnostics.X_c_must_be_followed_by_an_ASCII_letter, p.pos()-2, 2) + } else if atomEscape { + p.incPos(-1) + return "\\" + } + return string(ch) + case '^', '$', '/', '\\', '.', '*', '+', '?', '(', ')', '[', ']', '{', '}', '|': + p.incPos(1) + return string(ch) + default: + p.incPos(-1) // back up to include the backslash for scanEscapeSequence + flags := EscapeSequenceScanningFlagsRegularExpression + if p.annexB { + flags |= EscapeSequenceScanningFlagsAnnexB + } + if p.anyUnicodeMode { + flags |= EscapeSequenceScanningFlagsAnyUnicodeMode + } + if atomEscape { + flags |= EscapeSequenceScanningFlagsAtomEscape + } + return p.scanner.scanEscapeSequence(flags) + } +} + +func (p *regExpParser) scanGroupName(isReference bool) { + debug.Assert(p.pos() > 0 && p.text()[p.pos()-1] == '<') + p.scanner.tokenStart = p.pos() + p.scanner.scanIdentifier(0) + if p.pos() == p.scanner.tokenStart { + p.error(diagnostics.Expected_a_capturing_group_name, p.pos(), 0) + } else if isReference { + p.groupNameReferences = append(p.groupNameReferences, groupNameReference{pos: p.scanner.tokenStart, end: p.pos(), name: p.scanner.tokenValue}) + } else if p.namedCapturingGroupsContains(p.scanner.tokenValue) { + p.error(diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, p.scanner.tokenStart, p.pos()-p.scanner.tokenStart) + } else { + if len(p.namedCapturingGroups) > 0 { + p.namedCapturingGroups[len(p.namedCapturingGroups)-1][p.scanner.tokenValue] = true + } + p.groupSpecifiers[p.scanner.tokenValue] = true + } +} + +func (p *regExpParser) namedCapturingGroupsContains(name string) bool { + for _, group := range p.namedCapturingGroups { + if group[name] { + return true + } + } + return false +} + +func (p *regExpParser) isClassContentExit(ch rune) bool { + return ch == ']' || p.pos() >= p.end +} + +// ClassRanges ::= '^'? (ClassAtom ('-' ClassAtom)?)* +func (p *regExpParser) scanClassRanges() { + debug.Assert(p.pos() > 0 && p.text()[p.pos()-1] == '[') + p.pendingLowSurrogate = 0 + if p.char() == '^' { + p.incPos(1) + } + for p.pos() < p.end { + ch := p.char() + if p.isClassContentExit(ch) { + return + } + minStart := p.pos() + minCharacter := p.scanClassAtom() + if p.char() == '-' { + p.incPos(1) + ch = p.char() + if p.isClassContentExit(ch) { + return + } + if minCharacter == "" && p.anyUnicodeModeOrNonAnnexB { + p.error(diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, p.pos()-1-minStart) + } + maxStart := p.pos() + maxCharacter := p.scanClassAtom() + if maxCharacter == "" && p.anyUnicodeModeOrNonAnnexB { + p.error(diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, p.pos()-maxStart) + continue + } + if minCharacter == "" { + continue + } + minCharacterValue, minSize := decodeClassAtomRune(minCharacter) + maxCharacterValue, maxSize := decodeClassAtomRune(maxCharacter) + if len(minCharacter) == minSize && len(maxCharacter) == maxSize && minCharacterValue > maxCharacterValue { + p.error(diagnostics.Range_out_of_order_in_character_class, minStart, p.pos()-minStart) + } + } + } +} + +// Static Semantics: MayContainStrings +// ClassUnion: ClassSetOperands.some(ClassSetOperand => ClassSetOperand.MayContainStrings) +// ClassIntersection: ClassSetOperands.every(ClassSetOperand => ClassSetOperand.MayContainStrings) +// ClassSubtraction: ClassSetOperands[0].MayContainStrings +// ClassSetOperand: +// || ClassStringDisjunctionContents.MayContainStrings +// || CharacterClassEscape.UnicodePropertyValueExpression.LoneUnicodePropertyNameOrValue.MayContainStrings +// ClassStringDisjunctionContents: ClassStrings.some(ClassString => ClassString.ClassSetCharacters.length !== 1) +// LoneUnicodePropertyNameOrValue: isBinaryUnicodePropertyOfStrings(LoneUnicodePropertyNameOrValue) + +// ClassSetExpression ::= '^'? (ClassUnion | ClassIntersection | ClassSubtraction) +// ClassUnion ::= (ClassSetRange | ClassSetOperand)* +// ClassIntersection ::= ClassSetOperand ('&&' ClassSetOperand)+ +// ClassSubtraction ::= ClassSetOperand ('--' ClassSetOperand)+ +// ClassSetRange ::= ClassSetCharacter '-' ClassSetCharacter +func (p *regExpParser) scanClassSetExpression() { + debug.Assert(p.pos() > 0 && p.text()[p.pos()-1] == '[') + isCharacterComplement := false + if p.char() == '^' { + p.incPos(1) + isCharacterComplement = true + } + expressionMayContainStrings := false + ch := p.char() + if p.isClassContentExit(ch) { + return + } + start := p.pos() + var operand string + twoChars := "" + if p.pos()+1 < p.end { + twoChars = p.text()[p.pos() : p.pos()+2] + } + switch twoChars { + case "--", "&&": + p.error(diagnostics.Expected_a_class_set_operand, p.pos(), 0) + p.mayContainStrings = false + default: + operand = p.scanClassSetOperand() + } + switch p.char() { + case '-': + if p.pos()+1 < p.end && p.charAt(p.pos()+1) == '-' { + if isCharacterComplement && p.mayContainStrings { + p.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start, p.pos()-start) + } + expressionMayContainStrings = p.mayContainStrings + p.scanClassSetSubExpression(classSetExpressionTypeClassSubtraction) + p.mayContainStrings = !isCharacterComplement && expressionMayContainStrings + return + } + case '&': + if p.pos()+1 < p.end && p.charAt(p.pos()+1) == '&' { + p.scanClassSetSubExpression(classSetExpressionTypeClassIntersection) + if isCharacterComplement && p.mayContainStrings { + p.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start, p.pos()-start) + } + expressionMayContainStrings = p.mayContainStrings + p.mayContainStrings = !isCharacterComplement && expressionMayContainStrings + return + } else { + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, p.pos(), 1, string(ch)) + } + default: + if isCharacterComplement && p.mayContainStrings { + p.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start, p.pos()-start) + } + expressionMayContainStrings = p.mayContainStrings + } + for p.pos() < p.end { + ch = p.char() + switch ch { + case '-': + p.incPos(1) + ch = p.char() + if p.isClassContentExit(ch) { + p.mayContainStrings = !isCharacterComplement && expressionMayContainStrings + return + } + if ch == '-' { + p.incPos(1) + p.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, p.pos()-2, 2) + start = p.pos() - 2 + operand = p.text()[start:p.pos()] + continue + } else { + if operand == "" { + p.error(diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start, p.pos()-1-start) + } + secondStart := p.pos() + secondOperand := p.scanClassSetOperand() + if isCharacterComplement && p.mayContainStrings { + p.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, p.pos()-secondStart) + } + expressionMayContainStrings = expressionMayContainStrings || p.mayContainStrings + if secondOperand == "" { + p.error(diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, p.pos()-secondStart) + } else if operand != "" { + minCharacterValue, minSize := decodeClassAtomRune(operand) + maxCharacterValue, maxSize := decodeClassAtomRune(secondOperand) + if len(operand) == minSize && len(secondOperand) == maxSize && minCharacterValue > maxCharacterValue { + p.error(diagnostics.Range_out_of_order_in_character_class, start, p.pos()-start) + } + } + } + case '&': + start = p.pos() + p.incPos(1) + if p.char() == '&' { + p.incPos(1) + p.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, p.pos()-2, 2) + if p.char() == '&' { + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, p.pos(), 1, string(ch)) + p.incPos(1) + } + } else { + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, p.pos()-1, 1, string(ch)) + } + operand = p.text()[start:p.pos()] + continue + } + if p.isClassContentExit(p.char()) { + break + } + start = p.pos() + twoChars = "" + if p.pos()+1 < p.end { + twoChars = p.text()[p.pos() : p.pos()+2] + } + switch twoChars { + case "--", "&&": + p.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, p.pos(), 2) + p.incPos(2) + operand = p.text()[start:p.pos()] + default: + operand = p.scanClassSetOperand() + } + } + p.mayContainStrings = !isCharacterComplement && expressionMayContainStrings +} + +func (p *regExpParser) scanClassSetSubExpression(expressionType classSetExpressionType) { + expressionMayContainStrings := p.mayContainStrings + for p.pos() < p.end { + ch := p.char() + if p.isClassContentExit(ch) { + break + } + switch ch { + case '-': + p.incPos(1) + if p.char() == '-' { + p.incPos(1) + if expressionType != classSetExpressionTypeClassSubtraction { + p.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, p.pos()-2, 2) + } + } else { + p.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, p.pos()-1, 1) + } + case '&': + p.incPos(1) + if p.char() == '&' { + p.incPos(1) + if expressionType != classSetExpressionTypeClassIntersection { + p.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, p.pos()-2, 2) + } + if p.char() == '&' { + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, p.pos(), 1, string(ch)) + p.incPos(1) + } + } else { + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, p.pos()-1, 1, string(ch)) + } + default: + switch expressionType { + case classSetExpressionTypeClassSubtraction: + p.error(diagnostics.X_0_expected, p.pos(), 0, "--") + case classSetExpressionTypeClassIntersection: + p.error(diagnostics.X_0_expected, p.pos(), 0, "&&") + } + } + ch = p.char() + if p.isClassContentExit(ch) { + p.error(diagnostics.Expected_a_class_set_operand, p.pos(), 0) + break + } + p.scanClassSetOperand() + if expressionType == classSetExpressionTypeClassIntersection { + expressionMayContainStrings = expressionMayContainStrings && p.mayContainStrings + } + } + p.mayContainStrings = expressionMayContainStrings +} + +// ClassSetOperand ::= +// +// | '[' ClassSetExpression ']' +// | '\' CharacterClassEscape +// | '\q{' ClassStringDisjunctionContents '}' +// | ClassSetCharacter +func (p *regExpParser) scanClassSetOperand() string { + p.mayContainStrings = false + switch p.char() { + case '[': + p.incPos(1) + p.scanClassSetExpression() + p.scanExpectedChar(']') + return "" + case '\\': + p.incPos(1) + if p.scanCharacterClassEscape() { + return "" + } else if p.char() == 'q' { + p.incPos(1) + if p.char() == '{' { + p.incPos(1) + p.scanClassStringDisjunctionContents() + p.scanExpectedChar('}') + return "" + } else { + p.error(diagnostics.X_q_must_be_followed_by_string_alternatives_enclosed_in_braces, p.pos()-2, 2) + return "q" + } + } + p.incPos(-1) + fallthrough + default: + return p.scanClassSetCharacter() + } +} + +// ClassStringDisjunctionContents ::= ClassSetCharacter* ('|' ClassSetCharacter*)* +func (p *regExpParser) scanClassStringDisjunctionContents() { + debug.Assert(p.pos() > 0 && p.text()[p.pos()-1] == '{') + characterCount := 0 + for p.pos() < p.end { + ch := p.char() + switch ch { + case '}': + if characterCount != 1 { + p.mayContainStrings = true + } + return + case '|': + if characterCount != 1 { + p.mayContainStrings = true + } + p.incPos(1) + characterCount = 0 + default: + p.scanClassSetCharacter() + characterCount++ + } + } +} + +// ClassSetCharacter ::= +// +// | SourceCharacter -- ClassSetSyntaxCharacter -- ClassSetReservedDoublePunctuator +// | '\' (CharacterEscape | ClassSetReservedPunctuator | 'b') +func (p *regExpParser) scanClassSetCharacter() string { + ch := p.char() + if ch == '\\' { + p.incPos(1) + innerCh := p.char() + switch innerCh { + case 'b': + p.incPos(1) + return "\b" + case '&', '-', '!', '#', '%', ',', ':', ';', '<', '=', '>', '@', '`', '~': + p.incPos(1) + return string(innerCh) + default: + return p.scanCharacterEscape(false /*atomEscape*/) + } + } else if p.pos()+1 < p.end && ch == p.charAt(p.pos()+1) { + switch ch { + case '&', '!', '#', '%', '*', '+', ',', '.', ':', ';', '<', '=', '>', '?', '@', '`', '~': + p.error(diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, p.pos(), 2) + p.incPos(2) + return p.text()[p.pos()-2 : p.pos()] + } + } + switch ch { + case '/', '(', ')', '[', ']', '{', '}', '-', '|': + p.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, p.pos(), 1, string(ch)) + p.incPos(1) + return string(ch) + } + return p.scanSourceCharacter() +} + +// ClassAtom ::= +// +// | SourceCharacter but not one of '\' or ']' +// | '\' ClassEscape +// +// ClassEscape ::= +// +// | 'b' +// | '-' +// | CharacterClassEscape +// | CharacterEscape +func (p *regExpParser) scanClassAtom() string { + if p.char() == '\\' { + p.incPos(1) + ch := p.char() + switch ch { + case 'b': + p.incPos(1) + return "\b" + case '-': + p.incPos(1) + return string(ch) + default: + if p.scanCharacterClassEscape() { + return "" + } + return p.scanCharacterEscape(false /*atomEscape*/) + } + } else { + return p.scanSourceCharacter() + } +} + +// CharacterClassEscape ::= +// +// | 'd' | 'D' | 's' | 'S' | 'w' | 'W' +// | [+AnyUnicodeMode] ('P' | 'p') '{' UnicodePropertyValueExpression '}' +func (p *regExpParser) scanCharacterClassEscape() bool { + debug.Assert(p.pos() > 0 && p.text()[p.pos()-1] == '\\') + isCharacterComplement := false + start := p.pos() - 1 + ch := p.char() + switch ch { + case 'd', 'D', 's', 'S', 'w', 'W': + p.incPos(1) + return true + case 'P': + isCharacterComplement = true + fallthrough + case 'p': + p.incPos(1) + if p.char() == '{' { + p.incPos(1) + propertyNameOrValueStart := p.pos() + propertyNameOrValue := p.scanWordCharacters() + if p.char() == '=' { + propertyName := nonBinaryUnicodeProperties[propertyNameOrValue] + if p.pos() == propertyNameOrValueStart { + p.error(diagnostics.Expected_a_Unicode_property_name, p.pos(), 0) + } else if propertyName == "" { + p.error(diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, p.pos()-propertyNameOrValueStart) + suggestion := p.getSpellingSuggestionForUnicodePropertyName(propertyNameOrValue) + if suggestion != "" { + p.error(diagnostics.Did_you_mean_0, propertyNameOrValueStart, p.pos()-propertyNameOrValueStart, suggestion) + } + } + p.incPos(1) + propertyValueStart := p.pos() + propertyValue := p.scanWordCharacters() + if p.pos() == propertyValueStart { + p.error(diagnostics.Expected_a_Unicode_property_value, p.pos(), 0) + } else if propertyName != "" { + values := valuesOfNonBinaryUnicodeProperties[propertyName] + if values != nil && !values.Has(propertyValue) { + p.error(diagnostics.Unknown_Unicode_property_value, propertyValueStart, p.pos()-propertyValueStart) + suggestion := p.getSpellingSuggestionForUnicodePropertyValue(propertyName, propertyValue) + if suggestion != "" { + p.error(diagnostics.Did_you_mean_0, propertyValueStart, p.pos()-propertyValueStart, suggestion) + } + } + } + } else { + if p.pos() == propertyNameOrValueStart { + p.error(diagnostics.Expected_a_Unicode_property_name_or_value, p.pos(), 0) + } else if binaryUnicodePropertiesOfStrings.Has(propertyNameOrValue) { + if !p.unicodeSetsMode { + p.error(diagnostics.Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set, propertyNameOrValueStart, p.pos()-propertyNameOrValueStart) + } else if isCharacterComplement { + p.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, p.pos()-propertyNameOrValueStart) + } else { + p.mayContainStrings = true + } + } else if !valuesOfNonBinaryUnicodeProperties["General_Category"].Has(propertyNameOrValue) && !binaryUnicodeProperties.Has(propertyNameOrValue) { + p.error(diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, p.pos()-propertyNameOrValueStart) + suggestion := p.getSpellingSuggestionForUnicodePropertyNameOrValue(propertyNameOrValue) + if suggestion != "" { + p.error(diagnostics.Did_you_mean_0, propertyNameOrValueStart, p.pos()-propertyNameOrValueStart, suggestion) + } + } + } + p.scanExpectedChar('}') + if !p.anyUnicodeMode { + p.error(diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start, p.pos()-start) + } + } else if p.anyUnicodeModeOrNonAnnexB { + p.error(diagnostics.X_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, p.pos()-2, 2, string(ch)) + } else { + p.incPos(-1) + return false + } + return true + } + return false +} + +func (p *regExpParser) getSpellingSuggestionForUnicodePropertyName(name string) string { + candidates := make([]string, 0, len(nonBinaryUnicodeProperties)) + for k := range nonBinaryUnicodeProperties { + candidates = append(candidates, k) + } + return core.GetSpellingSuggestion(name, candidates, func(s string) string { return s }) +} + +func (p *regExpParser) getSpellingSuggestionForUnicodePropertyValue(propertyName string, value string) string { + values := valuesOfNonBinaryUnicodeProperties[propertyName] + if values == nil { + return "" + } + candidates := make([]string, 0, values.Len()) + for k := range values.Keys() { + candidates = append(candidates, k) + } + return core.GetSpellingSuggestion(value, candidates, func(s string) string { return s }) +} + +func (p *regExpParser) getSpellingSuggestionForUnicodePropertyNameOrValue(name string) string { + var candidates []string + for k := range valuesOfNonBinaryUnicodeProperties["General_Category"].Keys() { + candidates = append(candidates, k) + } + for k := range binaryUnicodeProperties.Keys() { + candidates = append(candidates, k) + } + for k := range binaryUnicodePropertiesOfStrings.Keys() { + candidates = append(candidates, k) + } + return core.GetSpellingSuggestion(name, candidates, func(s string) string { return s }) +} + +func (p *regExpParser) scanWordCharacters() string { + start := p.pos() + for p.pos() < p.end { + ch := p.char() + if !isWordCharacter(ch) { + break + } + p.incPos(1) + } + return p.text()[start:p.pos()] +} + +func (p *regExpParser) scanSourceCharacter() string { + if p.pos() >= p.end { + return "" + } + if !p.anyUnicodeMode { + if p.pendingLowSurrogate != 0 { + // Second of two surrogate code units for the same non-BMP character. + // Now advance past the full UTF-8 sequence (the high surrogate call did not advance). + _, size := utf8.DecodeRuneInString(p.text()[p.pos():]) + p.incPos(size) + low := p.pendingLowSurrogate + p.pendingLowSurrogate = 0 + return encodeSurrogate(low) + } + ch, size := utf8.DecodeRuneInString(p.text()[p.pos():]) + if ch == utf8.RuneError || size == 0 { + // Not a valid rune; consume one raw byte. + p.incPos(1) + return string(p.text()[p.pos()-1]) + } + if ch >= surrSelf { + // Non-BMP character: emit the high surrogate first WITHOUT advancing. + // The low surrogate will be emitted on the next call, which also advances. + high := surr1 + (ch-surrSelf)>>10 + low := surr2 + (ch-surrSelf)&0x3FF + p.pendingLowSurrogate = low + return encodeSurrogate(high) + } + p.incPos(size) + return string(ch) + } + ch, size := utf8.DecodeRuneInString(p.text()[p.pos():]) + if size == 0 || ch == utf8.RuneError { + return "" + } + p.incPos(size) + return string(ch) +} + +func (p *regExpParser) scanExpectedChar(ch rune) { + if p.char() == ch { + p.incPos(1) + } else { + p.error(diagnostics.X_0_expected, p.pos(), 0, string(ch)) + } +} + +func (p *regExpParser) scanDigits() { + start := p.pos() + for p.pos() < p.end && stringutil.IsDigit(p.char()) { + p.incPos(1) + } + p.scanner.tokenValue = p.text()[start:p.pos()] +} + +func (p *regExpParser) run() { + // Regular expressions are checked more strictly when either in 'u' or 'v' mode, or + // when not using the looser interpretation of the syntax from ECMA-262 Annex B. + p.anyUnicodeModeOrNonAnnexB = p.anyUnicodeMode || !p.annexB + + p.scanDisjunction(false /*isInGroup*/) + + for _, reference := range p.groupNameReferences { + if !p.groupSpecifiers[reference.name] { + p.error(diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end-reference.pos, reference.name) + if len(p.groupSpecifiers) > 0 { + specifiers := make([]string, 0, len(p.groupSpecifiers)) + for k := range p.groupSpecifiers { + specifiers = append(specifiers, k) + } + suggestion := core.GetSpellingSuggestion(reference.name, specifiers, func(s string) string { return s }) + if suggestion != "" { + p.error(diagnostics.Did_you_mean_0, reference.pos, reference.end-reference.pos, suggestion) + } + } + } + } + for _, escape := range p.decimalEscapes { + // Although a DecimalEscape with a value greater than the number of capturing groups + // is treated as either a LegacyOctalEscapeSequence or an IdentityEscape in Annex B, + // an error is nevertheless reported since it's most likely a mistake. + if escape.value > p.numberOfCapturingGroups { + if p.numberOfCapturingGroups > 0 { + p.error(diagnostics.This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression, escape.pos, escape.end-escape.pos, p.numberOfCapturingGroups) + } else { + p.error(diagnostics.This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression, escape.pos, escape.end-escape.pos) + } + } + } +} diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 623a2eff141..3c27fcd5571 100644 --- a/internal/scanner/scanner.go +++ b/internal/scanner/scanner.go @@ -211,7 +211,9 @@ type ScannerState struct { type Scanner struct { text string + end int languageVariant core.LanguageVariant + scriptTarget core.ScriptTarget onError ErrorCallback skipTrivia bool scriptKind core.ScriptKind @@ -403,6 +405,7 @@ func hasJSDocTag(text string, tags ...string) bool { func (s *Scanner) SetText(text string) { s.text = text + s.end = len(text) s.ScannerState = ScannerState{} } @@ -418,6 +421,17 @@ func (s *Scanner) SetLanguageVariant(languageVariant core.LanguageVariant) { s.languageVariant = languageVariant } +func (s *Scanner) SetScriptTarget(scriptTarget core.ScriptTarget) { + s.scriptTarget = scriptTarget +} + +func (s *Scanner) languageVersion() core.ScriptTarget { + if s.scriptTarget == core.ScriptTargetNone { + return core.ScriptTargetLatest + } + return s.scriptTarget +} + func (s *Scanner) error(diagnostic *diagnostics.Message) { s.errorAt(diagnostic, s.pos, 0) } @@ -432,7 +446,7 @@ func (s *Scanner) errorAt(diagnostic *diagnostics.Message, pos int, length int, // It must be checked against utf8.RuneSelf to verify that a call to charAndSize // is not needed. func (s *Scanner) char() rune { - if s.pos < len(s.text) { + if s.pos < s.end { return rune(s.text[s.pos]) } return -1 @@ -440,7 +454,7 @@ func (s *Scanner) char() rune { // NOTE: this returns a rune, but only decodes the byte at the offset. func (s *Scanner) charAt(offset int) rune { - if s.pos+offset < len(s.text) { + if s.pos+offset < s.end { return rune(s.text[s.pos+offset]) } return -1 @@ -1034,20 +1048,35 @@ func (s *Scanner) ReScanAsteriskEqualsToken() ast.Kind { return s.token } -// !!! https://github.com/microsoft/TypeScript/pull/55600 -func (s *Scanner) ReScanSlashToken() ast.Kind { +func (s *Scanner) ReScanSlashToken(reportErrors ...bool) ast.Kind { + shouldReportErrors := len(reportErrors) > 0 && reportErrors[0] if s.token == ast.KindSlashToken || s.token == ast.KindSlashEqualsToken { - s.pos = s.tokenStart + 1 - startOfRegExpBody := s.pos + // Quickly get to the end of regex such that we know the flags + startOfRegExpBody := s.tokenStart + 1 + p := startOfRegExpBody inEscape := false + namedCaptureGroups := false + // Although nested character classes are allowed in Unicode Sets mode, + // an unescaped slash is nevertheless invalid even in a character class in any Unicode mode. + // This is indicated by Section 12.9.5 Regular Expression Literals of the specification, + // where nested character classes are not considered at all. (A `[` RegularExpressionClassChar + // does nothing in a RegularExpressionClass, and a `]` always closes the class.) + // Additionally, parsing nested character classes will misinterpret regexes like `/[[]/` + // as unterminated, consuming characters beyond the slash. (This even applies to `/[[]/v`, + // which should be parsed as a well-terminated regex with an incomplete character class.) + // Thus we must not handle nested character classes in the first pass. inCharacterClass := false loop: for { - ch, size := s.charAndSize() // If we reach the end of a file, or hit a newline, then this is an unterminated - // regex. Report error and return what we have so far. + // regex. Report error and return what we have so far. + if p >= s.end { + s.tokenFlags |= ast.TokenFlagsUnterminated + break loop + } + ch := rune(s.text[p]) switch { - case size == 0 || stringutil.IsLineBreak(ch): + case stringutil.IsLineBreak(ch): s.tokenFlags |= ast.TokenFlagsUnterminated break loop case inEscape: @@ -1064,20 +1093,26 @@ func (s *Scanner) ReScanSlashToken() ast.Kind { inEscape = true case ch == ']': inCharacterClass = false + case !inCharacterClass && ch == '(' && + p+1 < s.end && s.text[p+1] == '?' && + p+2 < s.end && s.text[p+2] == '<' && + (p+3 >= s.end || (s.text[p+3] != '=' && s.text[p+3] != '!')): + namedCaptureGroups = true } - s.pos += size + p++ } + + endOfRegExpBody := p if s.tokenFlags&ast.TokenFlagsUnterminated != 0 { // Search for the nearest unbalanced bracket for better recovery. Since the expression is // invalid anyways, we take nested square brackets into consideration for the best guess. - endOfRegExpBody := s.pos - s.pos = startOfRegExpBody + p = startOfRegExpBody inEscape = false characterClassDepth := 0 inDecimalQuantifier := false groupDepth := 0 - for s.pos < endOfRegExpBody { - ch, size := s.charAndSize() + for p < endOfRegExpBody { + ch := rune(s.text[p]) if inEscape { inEscape = false } else if ch == '\\' { @@ -1102,29 +1137,69 @@ func (s *Scanner) ReScanSlashToken() ast.Kind { } } } - s.pos += size + p++ } // Whitespaces and semicolons at the end are not likely to be part of the regex - for { - ch, size := utf8.DecodeLastRuneInString(s.text[:s.pos]) + for p > startOfRegExpBody { + ch, size := utf8.DecodeLastRuneInString(s.text[:p]) if stringutil.IsWhiteSpaceLike(ch) || ch == ';' { - s.pos -= size + p -= size } else { break } } - s.errorAt(diagnostics.Unterminated_regular_expression_literal, s.tokenStart, s.pos-s.tokenStart) + s.errorAt(diagnostics.Unterminated_regular_expression_literal, s.tokenStart, p-s.tokenStart) } else { // Consume the slash character - s.pos++ - for { - ch, size := s.charAndSize() - if size == 0 || !IsIdentifierPart(ch) { + p++ + var regExpFlags regularExpressionFlags + for p < s.end { + ch, size := utf8.DecodeRuneInString(s.text[p:]) + if ch == utf8.RuneError || !IsIdentifierPart(ch) { break } - s.pos += size + if shouldReportErrors { + flag, ok := charCodeToRegExpFlag[ch] + if !ok { + s.errorAt(diagnostics.Unknown_regular_expression_flag, p, size) + } else if regExpFlags&flag != 0 { + s.errorAt(diagnostics.Duplicate_regular_expression_flag, p, size) + } else if (regExpFlags|flag)®ularExpressionFlagsAnyUnicodeMode == regularExpressionFlagsAnyUnicodeMode { + s.errorAt(diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, size) + } else { + regExpFlags |= flag + s.checkRegularExpressionFlagAvailability(flag, p, size) + } + } + p += size + } + if shouldReportErrors { + s.pos = startOfRegExpBody + saveEnd := s.end + saveTokenPos := s.tokenStart + saveTokenFlags := s.tokenFlags + s.end = endOfRegExpBody + parser := ®ExpParser{ + scanner: s, + end: endOfRegExpBody, + regExpFlags: regExpFlags, + anyUnicodeMode: regExpFlags®ularExpressionFlagsAnyUnicodeMode != 0, + unicodeSetsMode: regExpFlags®ularExpressionFlagsUnicodeSets != 0, + annexB: true, + namedCaptureGroups: namedCaptureGroups, + groupSpecifiers: make(map[string]bool), + } + parser.run() + s.end = saveEnd + s.pos = p + s.tokenStart = saveTokenPos + s.tokenFlags = saveTokenFlags + } else { + s.pos = p } } + + s.pos = p s.tokenValue = s.text[s.tokenStart:s.pos] s.token = ast.KindRegularExpressionLiteral } @@ -1629,9 +1704,9 @@ func (s *Scanner) scanEscapeSequence(flags EscapeSequenceScanningFlags) string { if flags&EscapeSequenceScanningFlagsReportInvalidEscapeErrors != 0 { code, _ := strconv.ParseInt(s.text[start+1:s.pos], 8, 32) if flags&EscapeSequenceScanningFlagsRegularExpression != 0 && flags&EscapeSequenceScanningFlagsAtomEscape == 0 && ch != '0' { - s.errorAt(diagnostics.Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead, start, s.pos-start, fmt.Sprintf("%02x", code)) + s.errorAt(diagnostics.Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead, start, s.pos-start, fmt.Sprintf("\\x%02x", code)) } else { - s.errorAt(diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start, s.pos-start, "\\x"+fmt.Sprintf("%02x", code)) + s.errorAt(diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start, s.pos-start, fmt.Sprintf("\\x%02x", code)) } return string(rune(code)) } @@ -1665,18 +1740,43 @@ func (s *Scanner) scanEscapeSequence(flags EscapeSequenceScanningFlags) string { case '"': return "\"" case 'u': - // '\uDDDD' and '\U{DDDDDD}' + // '\uDDDD' and '\u{DDDDDD}' + extended := s.char() == '{' s.pos -= 2 codePoint := s.scanUnicodeEscape(flags&EscapeSequenceScanningFlagsReportInvalidEscapeErrors != 0) + if extended { + if flags&EscapeSequenceScanningFlagsAllowExtendedUnicodeEscape == 0 { + s.tokenFlags |= ast.TokenFlagsContainsInvalidEscape + if flags&EscapeSequenceScanningFlagsReportInvalidEscapeErrors != 0 { + s.errorAt(diagnostics.Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start, s.pos-start) + } + } + if codePoint < 0 { + return s.text[start:s.pos] + } + return string(codePoint) + } if codePoint < 0 { return s.text[start:s.pos] - } else if codePointIsHighSurrogate(codePoint) && s.char() == '\\' && s.charAt(1) == 'u' { + } else if codePointIsHighSurrogate(codePoint) && + (flags&EscapeSequenceScanningFlagsRegularExpression == 0 || flags&EscapeSequenceScanningFlagsAnyUnicodeMode != 0) && + s.char() == '\\' && s.charAt(1) == 'u' && s.charAt(2) != '{' { + // Combine \uHigh\uLow into a single code point in string literals (always) and + // in regex AnyUnicodeMode. In non-unicode regex mode they are separate atoms. savedPos := s.pos nextCodePoint := s.scanUnicodeEscape(flags&EscapeSequenceScanningFlagsReportInvalidEscapeErrors != 0) if codePointIsLowSurrogate(nextCodePoint) { return string(surrogatePairToCodepoint(codePoint, nextCodePoint)) } - s.pos = savedPos // restore position because we do not consume nextCodePoint + s.pos = savedPos + if flags&EscapeSequenceScanningFlagsRegularExpression != 0 { + return encodeSurrogate(codePoint) + } + } else if (codePointIsHighSurrogate(codePoint) || codePointIsLowSurrogate(codePoint)) && + flags&EscapeSequenceScanningFlagsRegularExpression != 0 { + // Lone surrogate inside a non-unicode regex: encode as CESU-8 so scanClassRanges + // can compare surrogates numerically. Must NOT apply to string literals. + return encodeSurrogate(codePoint) } return string(codePoint) case 'x': @@ -1720,7 +1820,6 @@ func (s *Scanner) scanUnicodeEscape(shouldEmitInvalidEscapeError bool) rune { var hexDigits string if extended { s.pos++ - s.tokenFlags |= ast.TokenFlagsExtendedUnicodeEscape hexDigits = s.scanHexDigits(1, true, false) } else { s.tokenFlags |= ast.TokenFlagsUnicodeEscape @@ -1735,21 +1834,31 @@ func (s *Scanner) scanUnicodeEscape(shouldEmitInvalidEscapeError bool) rune { } hexValue, _ := strconv.ParseInt(hexDigits, 16, 32) if extended { + isInvalidExtendedEscape := false if hexValue > 0x10FFFF { - s.tokenFlags |= ast.TokenFlagsContainsInvalidEscape if shouldEmitInvalidEscapeError { s.errorAt(diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, start+1, s.pos-start-1) } - return -1 + isInvalidExtendedEscape = true } - if s.char() != '}' { - s.tokenFlags |= ast.TokenFlagsContainsInvalidEscape + if s.pos >= s.end { + if shouldEmitInvalidEscapeError { + s.error(diagnostics.Unexpected_end_of_text) + } + isInvalidExtendedEscape = true + } else if s.char() == '}' { + s.pos++ + } else { if shouldEmitInvalidEscapeError { s.error(diagnostics.Unterminated_Unicode_escape_sequence) } + isInvalidExtendedEscape = true + } + if isInvalidExtendedEscape { + s.tokenFlags |= ast.TokenFlagsContainsInvalidEscape return -1 } - s.pos++ + s.tokenFlags |= ast.TokenFlagsExtendedUnicodeEscape } return rune(hexValue) } @@ -2349,6 +2458,7 @@ func GetScannerForSourceFile(sourceFile *ast.SourceFile, pos int) *Scanner { s := NewScanner() s.text = sourceFile.Text() s.pos = pos + s.end = len(s.text) s.languageVariant = sourceFile.LanguageVariant s.Scan() return s diff --git a/internal/scanner/unicodeproperties.go b/internal/scanner/unicodeproperties.go new file mode 100644 index 00000000000..83d1e0e847c --- /dev/null +++ b/internal/scanner/unicodeproperties.go @@ -0,0 +1,162 @@ +package scanner + +import "github.com/microsoft/typescript-go/internal/collections" + +// Table 66: Non-binary Unicode property aliases and their canonical property names +// https://tc39.es/ecma262/#table-nonbinary-unicode-properties +var nonBinaryUnicodeProperties = map[string]string{ + "General_Category": "General_Category", + "gc": "General_Category", + "Script": "Script", + "sc": "Script", + "Script_Extensions": "Script_Extensions", + "scx": "Script_Extensions", +} + +// Table 67: Binary Unicode property aliases and their canonical property names +// https://tc39.es/ecma262/#table-binary-unicode-properties +var binaryUnicodeProperties = collections.NewSetFromItems( + "ASCII", "ASCII_Hex_Digit", "AHex", "Alphabetic", "Alpha", "Any", "Assigned", + "Bidi_Control", "Bidi_C", "Bidi_Mirrored", "Bidi_M", + "Case_Ignorable", "CI", "Cased", + "Changes_When_Casefolded", "CWCF", "Changes_When_Casemapped", "CWCM", + "Changes_When_Lowercased", "CWL", "Changes_When_NFKC_Casefolded", "CWKCF", + "Changes_When_Titlecased", "CWT", "Changes_When_Uppercased", "CWU", + "Dash", "Default_Ignorable_Code_Point", "DI", "Deprecated", "Dep", + "Diacritic", "Dia", + "Emoji", "Emoji_Component", "EComp", "Emoji_Modifier", "EMod", + "Emoji_Modifier_Base", "EBase", "Emoji_Presentation", "EPres", + "Extended_Pictographic", "ExtPict", "Extender", "Ext", + "Grapheme_Base", "Gr_Base", "Grapheme_Extend", "Gr_Ext", + "Hex_Digit", "Hex", + "IDS_Binary_Operator", "IDSB", "IDS_Trinary_Operator", "IDST", + "ID_Continue", "IDC", "ID_Start", "IDS", + "Ideographic", "Ideo", + "Join_Control", "Join_C", + "Logical_Order_Exception", "LOE", + "Lowercase", "Lower", "Math", + "Noncharacter_Code_Point", "NChar", + "Pattern_Syntax", "Pat_Syn", "Pattern_White_Space", "Pat_WS", + "Quotation_Mark", "QMark", + "Radical", + "Regional_Indicator", "RI", + "Sentence_Terminal", "STerm", + "Soft_Dotted", "SD", + "Terminal_Punctuation", "Term", + "Unified_Ideograph", "UIdeo", + "Uppercase", "Upper", + "Variation_Selector", "VS", + "White_Space", "space", + "XID_Continue", "XIDC", "XID_Start", "XIDS", +) + +// Table 68: Binary Unicode properties of strings +// https://tc39.es/ecma262/#table-binary-unicode-properties-of-strings +var binaryUnicodePropertiesOfStrings = collections.NewSetFromItems( + "Basic_Emoji", "Emoji_Keycap_Sequence", "RGI_Emoji_Modifier_Sequence", + "RGI_Emoji_Flag_Sequence", "RGI_Emoji_Tag_Sequence", + "RGI_Emoji_ZWJ_Sequence", "RGI_Emoji", +) + +// Unicode 15.1 +var scriptValues = collections.NewSetFromItems( + "Adlm", "Adlam", "Aghb", "Caucasian_Albanian", "Ahom", "Arab", "Arabic", + "Armi", "Imperial_Aramaic", "Armn", "Armenian", "Avst", "Avestan", + "Bali", "Balinese", "Bamu", "Bamum", "Bass", "Bassa_Vah", "Batk", "Batak", + "Beng", "Bengali", "Bhks", "Bhaiksuki", "Bopo", "Bopomofo", "Brah", "Brahmi", + "Brai", "Braille", "Bugi", "Buginese", "Buhd", "Buhid", + "Cakm", "Chakma", "Cans", "Canadian_Aboriginal", "Cari", "Carian", + "Cham", "Cher", "Cherokee", "Chrs", "Chorasmian", + "Copt", "Coptic", "Qaac", "Cpmn", "Cypro_Minoan", "Cprt", "Cypriot", + "Cyrl", "Cyrillic", + "Deva", "Devanagari", "Diak", "Dives_Akuru", "Dogr", "Dogra", + "Dsrt", "Deseret", "Dupl", "Duployan", + "Egyp", "Egyptian_Hieroglyphs", "Elba", "Elbasan", "Elym", "Elymaic", + "Ethi", "Ethiopic", + "Geor", "Georgian", "Glag", "Glagolitic", + "Gong", "Gunjala_Gondi", "Gonm", "Masaram_Gondi", + "Goth", "Gothic", "Gran", "Grantha", "Grek", "Greek", + "Gujr", "Gujarati", "Guru", "Gurmukhi", + "Hang", "Hangul", "Hani", "Han", "Hano", "Hanunoo", + "Hatr", "Hatran", "Hebr", "Hebrew", + "Hira", "Hiragana", "Hluw", "Anatolian_Hieroglyphs", + "Hmng", "Pahawh_Hmong", "Hmnp", "Nyiakeng_Puachue_Hmong", + "Hrkt", "Katakana_Or_Hiragana", + "Hung", "Old_Hungarian", + "Ital", "Old_Italic", + "Java", "Javanese", + "Kali", "Kayah_Li", "Kana", "Katakana", "Kawi", + "Khar", "Kharoshthi", "Khmr", "Khmer", "Khoj", "Khojki", + "Kits", "Khitan_Small_Script", "Knda", "Kannada", "Kthi", "Kaithi", + "Lana", "Tai_Tham", "Laoo", "Lao", "Latn", "Latin", + "Lepc", "Lepcha", "Limb", "Limbu", + "Lina", "Linear_A", "Linb", "Linear_B", "Lisu", + "Lyci", "Lycian", "Lydi", "Lydian", + "Mahj", "Mahajani", "Maka", "Makasar", + "Mand", "Mandaic", "Mani", "Manichaean", "Marc", "Marchen", + "Medf", "Medefaidrin", "Mend", "Mende_Kikakui", + "Merc", "Meroitic_Cursive", "Mero", "Meroitic_Hieroglyphs", + "Mlym", "Malayalam", "Modi", "Mong", "Mongolian", + "Mroo", "Mro", "Mtei", "Meetei_Mayek", "Mult", "Multani", + "Mymr", "Myanmar", + "Nagm", "Nag_Mundari", "Nand", "Nandinagari", + "Narb", "Old_North_Arabian", "Nbat", "Nabataean", + "Newa", "Nkoo", "Nko", "Nshu", "Nushu", + "Ogam", "Ogham", "Olck", "Ol_Chiki", + "Orkh", "Old_Turkic", "Orya", "Oriya", + "Osge", "Osage", "Osma", "Osmanya", "Ougr", "Old_Uyghur", + "Palm", "Palmyrene", "Pauc", "Pau_Cin_Hau", + "Perm", "Old_Permic", "Phag", "Phags_Pa", + "Phli", "Inscriptional_Pahlavi", "Phlp", "Psalter_Pahlavi", + "Phnx", "Phoenician", "Plrd", "Miao", + "Prti", "Inscriptional_Parthian", + "Rjng", "Rejang", "Rohg", "Hanifi_Rohingya", + "Runr", "Runic", + "Samr", "Samaritan", "Sarb", "Old_South_Arabian", + "Saur", "Saurashtra", "Sgnw", "SignWriting", + "Shaw", "Shavian", "Shrd", "Sharada", + "Sidd", "Siddham", "Sind", "Khudawadi", "Sinh", "Sinhala", + "Sogd", "Sogdian", "Sogo", "Old_Sogdian", + "Sora", "Sora_Sompeng", "Soyo", "Soyombo", + "Sund", "Sundanese", "Sylo", "Syloti_Nagri", "Syrc", "Syriac", + "Tagb", "Tagbanwa", "Takr", "Takri", + "Tale", "Tai_Le", "Talu", "New_Tai_Lue", + "Taml", "Tamil", "Tang", "Tangut", "Tavt", "Tai_Viet", + "Telu", "Telugu", "Tfng", "Tifinagh", + "Tglg", "Tagalog", "Thaa", "Thaana", "Thai", "Tibt", "Tibetan", + "Tirh", "Tirhuta", "Tnsa", "Tangsa", "Toto", + "Ugar", "Ugaritic", + "Vaii", "Vai", "Vith", "Vithkuqi", + "Wara", "Warang_Citi", "Wcho", "Wancho", + "Xpeo", "Old_Persian", "Xsux", "Cuneiform", + "Yezi", "Yezidi", "Yiii", "Yi", + "Zanb", "Zanabazar_Square", + "Zinh", "Inherited", "Qaai", + "Zyyy", "Common", + "Zzzz", "Unknown", +) + +var valuesOfNonBinaryUnicodeProperties = map[string]*collections.Set[string]{ + "General_Category": collections.NewSetFromItems( + "C", "Other", "Cc", "Control", "cntrl", "Cf", "Format", "Cn", "Unassigned", + "Co", "Private_Use", "Cs", "Surrogate", + "L", "Letter", "LC", "Cased_Letter", "Ll", "Lowercase_Letter", "Lm", "Modifier_Letter", + "Lo", "Other_Letter", "Lt", "Titlecase_Letter", "Lu", "Uppercase_Letter", + "M", "Mark", "Combining_Mark", "Mc", "Spacing_Mark", "Me", "Enclosing_Mark", + "Mn", "Nonspacing_Mark", + "N", "Number", "Nd", "Decimal_Number", "digit", "Nl", "Letter_Number", "No", "Other_Number", + "P", "Punctuation", "punct", "Pc", "Connector_Punctuation", "Pd", "Dash_Punctuation", + "Pe", "Close_Punctuation", "Pf", "Final_Punctuation", "Pi", "Initial_Punctuation", + "Po", "Other_Punctuation", "Ps", "Open_Punctuation", + "S", "Symbol", "Sc", "Currency_Symbol", "Sk", "Modifier_Symbol", + "Sm", "Math_Symbol", "So", "Other_Symbol", + "Z", "Separator", "Zl", "Line_Separator", "Zp", "Paragraph_Separator", + "Zs", "Space_Separator", + ), + "Script": scriptValues, + // The Script_Extensions property of a character contains one or more Script values. + // See https://www.unicode.org/reports/tr24/#Script_Extensions + // Here, since each Unicode property value expression only allows a single value, + // its values can be considered the same as those of the Script property. + "Script_Extensions": scriptValues, +} diff --git a/internal/scanner/utilities.go b/internal/scanner/utilities.go index 06b29a1e2aa..a5bb3008e58 100644 --- a/internal/scanner/utilities.go +++ b/internal/scanner/utilities.go @@ -27,6 +27,28 @@ func surrogatePairToCodepoint(r1, r2 rune) rune { return (r1-surr1)<<10 | (r2 - surr2) + surrSelf } +// encodeSurrogate encodes a surrogate code unit (0xD800–0xDFFF) as a 3-byte +// CESU-8 sequence. Standard UTF-8 decoders reject this range, so it acts as a +// sentinel that decodeClassAtomRune can identify when comparing class ranges in +// non-unicode regex mode (where surrogates are valid individual characters). +func encodeSurrogate(r rune) string { + return string([]byte{ + 0xED, + byte(0x80 | ((r >> 6) & 0x3F)), + byte(0x80 | (r & 0x3F)), + }) +} + +// decodeClassAtomRune is like utf8.DecodeRuneInString but also handles +// surrogate code units encoded by encodeSurrogate. +func decodeClassAtomRune(s string) (rune, int) { + if len(s) >= 3 && s[0] == 0xED && s[1] >= 0xA0 && s[1] <= 0xBF && s[2] >= 0x80 && s[2] <= 0xBF { + r := rune(0xD000) | rune(s[1]&0x3F)<<6 | rune(s[2]&0x3F) + return r, 3 + } + return utf8.DecodeRuneInString(s) +} + func tokenIsIdentifierOrKeyword(token ast.Kind) bool { return token >= ast.KindIdentifier } diff --git a/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.errors.txt b/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.errors.txt new file mode 100644 index 00000000000..223ac13c6d5 --- /dev/null +++ b/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.errors.txt @@ -0,0 +1,18 @@ +regularExpressionQuantifierBounds1.ts(4,5): error TS1506: Numbers out of order in quantifier. +regularExpressionQuantifierBounds1.ts(5,5): error TS1506: Numbers out of order in quantifier. + + +==== regularExpressionQuantifierBounds1.ts (2 errors) ==== + const regexes: RegExp[] = [ + /a{7,8}/, + /a{9223372036854775807,9223372036854775808}/, + /a{8,7}/, + ~~~ +!!! error TS1506: Numbers out of order in quantifier. + /a{9223372036854775808,9223372036854775807}/, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1506: Numbers out of order in quantifier. + /a{8,8}/, + /a{9223372036854775808,9223372036854775808}/, + ]; + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.js b/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.js new file mode 100644 index 00000000000..a569206a3d9 --- /dev/null +++ b/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/regularExpressionQuantifierBounds1.ts] //// + +//// [regularExpressionQuantifierBounds1.ts] +const regexes: RegExp[] = [ + /a{7,8}/, + /a{9223372036854775807,9223372036854775808}/, + /a{8,7}/, + /a{9223372036854775808,9223372036854775807}/, + /a{8,8}/, + /a{9223372036854775808,9223372036854775808}/, +]; + + +//// [regularExpressionQuantifierBounds1.js] +"use strict"; +const regexes = [ + /a{7,8}/, + /a{9223372036854775807,9223372036854775808}/, + /a{8,7}/, + /a{9223372036854775808,9223372036854775807}/, + /a{8,8}/, + /a{9223372036854775808,9223372036854775808}/, +]; diff --git a/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.symbols b/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.symbols new file mode 100644 index 00000000000..441ebd635f4 --- /dev/null +++ b/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.symbols @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/regularExpressionQuantifierBounds1.ts] //// + +=== regularExpressionQuantifierBounds1.ts === +const regexes: RegExp[] = [ +>regexes : Symbol(regexes, Decl(regularExpressionQuantifierBounds1.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) + + /a{7,8}/, + /a{9223372036854775807,9223372036854775808}/, + /a{8,7}/, + /a{9223372036854775808,9223372036854775807}/, + /a{8,8}/, + /a{9223372036854775808,9223372036854775808}/, +]; + diff --git a/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.types b/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.types new file mode 100644 index 00000000000..5c732f6653c --- /dev/null +++ b/testdata/baselines/reference/compiler/regularExpressionQuantifierBounds1.types @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/regularExpressionQuantifierBounds1.ts] //// + +=== regularExpressionQuantifierBounds1.ts === +const regexes: RegExp[] = [ +>regexes : RegExp[] +>[ /a{7,8}/, /a{9223372036854775807,9223372036854775808}/, /a{8,7}/, /a{9223372036854775808,9223372036854775807}/, /a{8,8}/, /a{9223372036854775808,9223372036854775808}/,] : RegExp[] + + /a{7,8}/, +>/a{7,8}/ : RegExp + + /a{9223372036854775807,9223372036854775808}/, +>/a{9223372036854775807,9223372036854775808}/ : RegExp + + /a{8,7}/, +>/a{8,7}/ : RegExp + + /a{9223372036854775808,9223372036854775807}/, +>/a{9223372036854775808,9223372036854775807}/ : RegExp + + /a{8,8}/, +>/a{8,8}/ : RegExp + + /a{9223372036854775808,9223372036854775808}/, +>/a{9223372036854775808,9223372036854775808}/ : RegExp + +]; + diff --git a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt b/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt index a7240a31cc5..15df2d938b1 100644 --- a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt @@ -8,7 +8,13 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(10,64): error TS2550: Property ' doYouNeedToChangeYourTargetLibraryES2016Plus.ts(11,21): error TS2583: Cannot find name 'Atomics'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2017' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(12,35): error TS2583: Cannot find name 'SharedArrayBuffer'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2017' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(15,50): error TS2550: Property 'finally' does not exist on type 'Promise'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. +doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,58): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,76): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,95): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,113): error TS2550: Property 'groups' does not exist on type 'RegExpMatchArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. +doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,38): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,56): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,75): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,111): error TS2550: Property 'groups' does not exist on type 'RegExpExecArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(18,33): error TS2550: Property 'dotAll' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(19,38): error TS2550: Property 'PluralRules' does not exist on type 'typeof Intl'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. @@ -34,7 +40,7 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): error TS2550: Property ' doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. -==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (34 errors) ==== +==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (40 errors) ==== // es2016 const testIncludes = ["hello"].includes("world"); ~~~~~~~~ @@ -71,9 +77,21 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2550: Property ' ~~~~~~~ !!! error TS2550: Property 'finally' does not exist on type 'Promise'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. const testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; + ~~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. ~~~~~~ !!! error TS2550: Property 'groups' does not exist on type 'RegExpMatchArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. const testRegExpExecArrayGroups = /(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups; + ~~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. ~~~~~~ !!! error TS2550: Property 'groups' does not exist on type 'RegExpExecArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. const testRegExpDotAll = /foo/g.dotAll; diff --git a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt.diff deleted file mode 100644 index 143334c8331..00000000000 --- a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt.diff +++ /dev/null @@ -1,47 +0,0 @@ ---- old.doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt -+++ new.doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt -@@= skipped -7, +7 lines =@@ - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(11,21): error TS2583: Cannot find name 'Atomics'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2017' or later. - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(12,35): error TS2583: Cannot find name 'SharedArrayBuffer'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2017' or later. - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(15,50): error TS2550: Property 'finally' does not exist on type 'Promise'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. --doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,58): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,76): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,95): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,113): error TS2550: Property 'groups' does not exist on type 'RegExpMatchArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. --doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,38): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,56): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,75): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,111): error TS2550: Property 'groups' does not exist on type 'RegExpExecArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(18,33): error TS2550: Property 'dotAll' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(19,38): error TS2550: Property 'PluralRules' does not exist on type 'typeof Intl'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. -@@= skipped -32, +26 lines =@@ - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. - - --==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (40 errors) ==== -+==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (34 errors) ==== - // es2016 - const testIncludes = ["hello"].includes("world"); - ~~~~~~~~ -@@= skipped -37, +37 lines =@@ - ~~~~~~~ - !!! error TS2550: Property 'finally' does not exist on type 'Promise'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. - const testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; -- ~~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. - ~~~~~~ - !!! error TS2550: Property 'groups' does not exist on type 'RegExpMatchArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. - const testRegExpExecArrayGroups = /(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups; -- ~~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. - ~~~~~~ - !!! error TS2550: Property 'groups' does not exist on type 'RegExpExecArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. - const testRegExpDotAll = /foo/g.dotAll; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es2015).errors.txt b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es2015).errors.txt new file mode 100644 index 00000000000..86e97bc3edc --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es2015).errors.txt @@ -0,0 +1,15 @@ +regExpWithOpenBracketInCharClass.ts(4,7): error TS1005: ']' expected. +regExpWithOpenBracketInCharClass.ts(4,8): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + + +==== regExpWithOpenBracketInCharClass.ts (2 errors) ==== + const regexes: RegExp[] = [ + /[[]/, // Valid + /[[]/u, // Valid + /[[]/v, // Well-terminated regex with an incomplete character class + +!!! error TS1005: ']' expected. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + ]; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es2015).errors.txt.diff deleted file mode 100644 index 2b831805329..00000000000 --- a/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es2015).errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.regExpWithOpenBracketInCharClass(target=es2015).errors.txt -+++ new.regExpWithOpenBracketInCharClass(target=es2015).errors.txt -@@= skipped -0, +0 lines =@@ --regExpWithOpenBracketInCharClass.ts(4,7): error TS1005: ']' expected. --regExpWithOpenBracketInCharClass.ts(4,8): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- -- --==== regExpWithOpenBracketInCharClass.ts (2 errors) ==== -- const regexes: RegExp[] = [ -- /[[]/, // Valid -- /[[]/u, // Valid -- /[[]/v, // Well-terminated regex with an incomplete character class -- --!!! error TS1005: ']' expected. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- ]; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=esnext).errors.txt b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=esnext).errors.txt new file mode 100644 index 00000000000..fb5540bc6ba --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=esnext).errors.txt @@ -0,0 +1,12 @@ +regExpWithOpenBracketInCharClass.ts(4,7): error TS1005: ']' expected. + + +==== regExpWithOpenBracketInCharClass.ts (1 errors) ==== + const regexes: RegExp[] = [ + /[[]/, // Valid + /[[]/u, // Valid + /[[]/v, // Well-terminated regex with an incomplete character class + +!!! error TS1005: ']' expected. + ]; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=esnext).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=esnext).errors.txt.diff deleted file mode 100644 index 52ebf56baa6..00000000000 --- a/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=esnext).errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.regExpWithOpenBracketInCharClass(target=esnext).errors.txt -+++ new.regExpWithOpenBracketInCharClass(target=esnext).errors.txt -@@= skipped -0, +0 lines =@@ --regExpWithOpenBracketInCharClass.ts(4,7): error TS1005: ']' expected. -- -- --==== regExpWithOpenBracketInCharClass.ts (1 errors) ==== -- const regexes: RegExp[] = [ -- /[[]/, // Valid -- /[[]/u, // Valid -- /[[]/v, // Well-terminated regex with an incomplete character class -- --!!! error TS1005: ']' expected. -- ]; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionAnnexB.errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionAnnexB.errors.txt new file mode 100644 index 00000000000..f08ceaf8959 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionAnnexB.errors.txt @@ -0,0 +1,269 @@ +regularExpressionAnnexB.ts(2,8): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(2,22): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(2,28): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(3,9): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(3,23): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(3,29): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(7,4): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(7,8): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(7,10): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionAnnexB.ts(7,12): error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. +regularExpressionAnnexB.ts(7,14): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(7,18): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(7,22): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(7,24): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(7,28): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(7,30): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionAnnexB.ts(8,5): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(8,9): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(8,11): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionAnnexB.ts(8,13): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(8,15): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(8,19): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(8,23): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(8,25): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionAnnexB.ts(8,29): error TS1125: Hexadecimal digit expected. +regularExpressionAnnexB.ts(8,31): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionAnnexB.ts(9,4): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionAnnexB.ts(9,7): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionAnnexB.ts(9,9): error TS1516: A character class range must not be bounded by another character class. +regularExpressionAnnexB.ts(23,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(23,8): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(24,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(24,9): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(25,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(25,10): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(26,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(26,5): error TS1506: Numbers out of order in quantifier. +regularExpressionAnnexB.ts(26,10): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(29,4): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionAnnexB.ts(30,4): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionAnnexB.ts(31,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(31,5): error TS1505: Incomplete quantifier. Digit expected. +regularExpressionAnnexB.ts(31,7): error TS1005: '}' expected. +regularExpressionAnnexB.ts(31,8): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(32,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(32,6): error TS1005: '}' expected. +regularExpressionAnnexB.ts(32,7): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(33,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(33,7): error TS1005: '}' expected. +regularExpressionAnnexB.ts(33,8): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(34,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(34,8): error TS1005: '}' expected. +regularExpressionAnnexB.ts(34,9): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(35,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(35,5): error TS1506: Numbers out of order in quantifier. +regularExpressionAnnexB.ts(35,8): error TS1005: '}' expected. +regularExpressionAnnexB.ts(35,9): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(36,4): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionAnnexB.ts(36,5): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionAnnexB.ts(37,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(37,5): error TS1505: Incomplete quantifier. Digit expected. +regularExpressionAnnexB.ts(37,8): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(38,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(38,5): error TS1505: Incomplete quantifier. Digit expected. +regularExpressionAnnexB.ts(38,9): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(39,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(39,8): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(40,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(40,9): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(41,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(41,10): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(42,4): error TS1507: There is nothing available for repetition. +regularExpressionAnnexB.ts(42,5): error TS1506: Numbers out of order in quantifier. +regularExpressionAnnexB.ts(42,10): error TS1507: There is nothing available for repetition. + + +==== regularExpressionAnnexB.ts (74 errors) ==== + const regexes: RegExp[] = [ + /\q\u\i\c\k\_\f\o\x\-\j\u\m\p\s/, + +!!! error TS1125: Hexadecimal digit expected. + +!!! error TS1125: Hexadecimal digit expected. + +!!! error TS1125: Hexadecimal digit expected. + /[\q\u\i\c\k\_\f\o\x\-\j\u\m\p\s]/, + +!!! error TS1125: Hexadecimal digit expected. + +!!! error TS1125: Hexadecimal digit expected. + +!!! error TS1125: Hexadecimal digit expected. + /\P[\P\w-_]/, + + // Compare to + /\q\u\i\c\k\_\f\o\x\-\j\u\m\p\s/u, + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + +!!! error TS1125: Hexadecimal digit expected. + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + +!!! error TS1125: Hexadecimal digit expected. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + +!!! error TS1125: Hexadecimal digit expected. + ~~ +!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. + /[\q\u\i\c\k\_\f\o\x\-\j\u\m\p\s]/u, + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + +!!! error TS1125: Hexadecimal digit expected. + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + +!!! error TS1125: Hexadecimal digit expected. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + +!!! error TS1125: Hexadecimal digit expected. + ~~ +!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. + /\P[\P\w-_]/u, + ~~ +!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. + ~~ +!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. + ~~ +!!! error TS1516: A character class range must not be bounded by another character class. + ]; + + const regexesWithBraces: RegExp[] = [ + /{??/, + /{,??/, + /{,1??/, + /{1??/, + /{1,??/, + /{1,2??/, + /{2,1??/, + /{}??/, + /{,}??/, + /{,1}??/, + /{1}??/, + ~~~~ +!!! error TS1507: There is nothing available for repetition. + ~ +!!! error TS1507: There is nothing available for repetition. + /{1,}??/, + ~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~ +!!! error TS1507: There is nothing available for repetition. + /{1,2}??/, + ~~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~ +!!! error TS1507: There is nothing available for repetition. + /{2,1}??/, + ~~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~~~ +!!! error TS1506: Numbers out of order in quantifier. + ~ +!!! error TS1507: There is nothing available for repetition. + + // Compare to + /{??/u, + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + /{,??/u, + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + /{,1??/u, + ~~~~ +!!! error TS1507: There is nothing available for repetition. + +!!! error TS1505: Incomplete quantifier. Digit expected. + +!!! error TS1005: '}' expected. + ~ +!!! error TS1507: There is nothing available for repetition. + /{1??/u, + ~~~ +!!! error TS1507: There is nothing available for repetition. + +!!! error TS1005: '}' expected. + ~ +!!! error TS1507: There is nothing available for repetition. + /{1,??/u, + ~~~~ +!!! error TS1507: There is nothing available for repetition. + +!!! error TS1005: '}' expected. + ~ +!!! error TS1507: There is nothing available for repetition. + /{1,2??/u, + ~~~~~ +!!! error TS1507: There is nothing available for repetition. + +!!! error TS1005: '}' expected. + ~ +!!! error TS1507: There is nothing available for repetition. + /{2,1??/u, + ~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~~~ +!!! error TS1506: Numbers out of order in quantifier. + +!!! error TS1005: '}' expected. + ~ +!!! error TS1507: There is nothing available for repetition. + /{}??/u, + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + /{,}??/u, + ~~~~ +!!! error TS1507: There is nothing available for repetition. + +!!! error TS1505: Incomplete quantifier. Digit expected. + ~ +!!! error TS1507: There is nothing available for repetition. + /{,1}??/u, + ~~~~~ +!!! error TS1507: There is nothing available for repetition. + +!!! error TS1505: Incomplete quantifier. Digit expected. + ~ +!!! error TS1507: There is nothing available for repetition. + /{1}??/u, + ~~~~ +!!! error TS1507: There is nothing available for repetition. + ~ +!!! error TS1507: There is nothing available for repetition. + /{1,}??/u, + ~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~ +!!! error TS1507: There is nothing available for repetition. + /{1,2}??/u, + ~~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~ +!!! error TS1507: There is nothing available for repetition. + /{2,1}??/u, + ~~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~~~ +!!! error TS1506: Numbers out of order in quantifier. + ~ +!!! error TS1507: There is nothing available for repetition. + ]; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionAnnexB.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionAnnexB.errors.txt.diff deleted file mode 100644 index fa48818b0d5..00000000000 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionAnnexB.errors.txt.diff +++ /dev/null @@ -1,273 +0,0 @@ ---- old.regularExpressionAnnexB.errors.txt -+++ new.regularExpressionAnnexB.errors.txt -@@= skipped -0, +0 lines =@@ --regularExpressionAnnexB.ts(2,8): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(2,22): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(2,28): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(3,9): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(3,23): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(3,29): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(7,4): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(7,8): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(7,10): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionAnnexB.ts(7,12): error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. --regularExpressionAnnexB.ts(7,14): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(7,18): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(7,22): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(7,24): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(7,28): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(7,30): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionAnnexB.ts(8,5): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(8,9): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(8,11): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionAnnexB.ts(8,13): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(8,15): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(8,19): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(8,23): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(8,25): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionAnnexB.ts(8,29): error TS1125: Hexadecimal digit expected. --regularExpressionAnnexB.ts(8,31): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionAnnexB.ts(9,4): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionAnnexB.ts(9,7): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionAnnexB.ts(9,9): error TS1516: A character class range must not be bounded by another character class. --regularExpressionAnnexB.ts(23,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(23,8): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(24,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(24,9): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(25,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(25,10): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(26,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(26,5): error TS1506: Numbers out of order in quantifier. --regularExpressionAnnexB.ts(26,10): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(29,4): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionAnnexB.ts(30,4): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionAnnexB.ts(31,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(31,5): error TS1505: Incomplete quantifier. Digit expected. --regularExpressionAnnexB.ts(31,7): error TS1005: '}' expected. --regularExpressionAnnexB.ts(31,8): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(32,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(32,6): error TS1005: '}' expected. --regularExpressionAnnexB.ts(32,7): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(33,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(33,7): error TS1005: '}' expected. --regularExpressionAnnexB.ts(33,8): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(34,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(34,8): error TS1005: '}' expected. --regularExpressionAnnexB.ts(34,9): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(35,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(35,5): error TS1506: Numbers out of order in quantifier. --regularExpressionAnnexB.ts(35,8): error TS1005: '}' expected. --regularExpressionAnnexB.ts(35,9): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(36,4): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionAnnexB.ts(36,5): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? --regularExpressionAnnexB.ts(37,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(37,5): error TS1505: Incomplete quantifier. Digit expected. --regularExpressionAnnexB.ts(37,8): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(38,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(38,5): error TS1505: Incomplete quantifier. Digit expected. --regularExpressionAnnexB.ts(38,9): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(39,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(39,8): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(40,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(40,9): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(41,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(41,10): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(42,4): error TS1507: There is nothing available for repetition. --regularExpressionAnnexB.ts(42,5): error TS1506: Numbers out of order in quantifier. --regularExpressionAnnexB.ts(42,10): error TS1507: There is nothing available for repetition. -- -- --==== regularExpressionAnnexB.ts (74 errors) ==== -- const regexes: RegExp[] = [ -- /\q\u\i\c\k\_\f\o\x\-\j\u\m\p\s/, -- --!!! error TS1125: Hexadecimal digit expected. -- --!!! error TS1125: Hexadecimal digit expected. -- --!!! error TS1125: Hexadecimal digit expected. -- /[\q\u\i\c\k\_\f\o\x\-\j\u\m\p\s]/, -- --!!! error TS1125: Hexadecimal digit expected. -- --!!! error TS1125: Hexadecimal digit expected. -- --!!! error TS1125: Hexadecimal digit expected. -- /\P[\P\w-_]/, -- -- // Compare to -- /\q\u\i\c\k\_\f\o\x\-\j\u\m\p\s/u, -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- --!!! error TS1125: Hexadecimal digit expected. -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- --!!! error TS1125: Hexadecimal digit expected. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- --!!! error TS1125: Hexadecimal digit expected. -- ~~ --!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -- /[\q\u\i\c\k\_\f\o\x\-\j\u\m\p\s]/u, -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- --!!! error TS1125: Hexadecimal digit expected. -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- --!!! error TS1125: Hexadecimal digit expected. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- --!!! error TS1125: Hexadecimal digit expected. -- ~~ --!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -- /\P[\P\w-_]/u, -- ~~ --!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -- ~~ --!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -- ~~ --!!! error TS1516: A character class range must not be bounded by another character class. -- ]; -- -- const regexesWithBraces: RegExp[] = [ -- /{??/, -- /{,??/, -- /{,1??/, -- /{1??/, -- /{1,??/, -- /{1,2??/, -- /{2,1??/, -- /{}??/, -- /{,}??/, -- /{,1}??/, -- /{1}??/, -- ~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{1,}??/, -- ~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{1,2}??/, -- ~~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{2,1}??/, -- ~~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~~~ --!!! error TS1506: Numbers out of order in quantifier. -- ~ --!!! error TS1507: There is nothing available for repetition. -- -- // Compare to -- /{??/u, -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- /{,??/u, -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- /{,1??/u, -- ~~~~ --!!! error TS1507: There is nothing available for repetition. -- --!!! error TS1505: Incomplete quantifier. Digit expected. -- --!!! error TS1005: '}' expected. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{1??/u, -- ~~~ --!!! error TS1507: There is nothing available for repetition. -- --!!! error TS1005: '}' expected. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{1,??/u, -- ~~~~ --!!! error TS1507: There is nothing available for repetition. -- --!!! error TS1005: '}' expected. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{1,2??/u, -- ~~~~~ --!!! error TS1507: There is nothing available for repetition. -- --!!! error TS1005: '}' expected. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{2,1??/u, -- ~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~~~ --!!! error TS1506: Numbers out of order in quantifier. -- --!!! error TS1005: '}' expected. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{}??/u, -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- /{,}??/u, -- ~~~~ --!!! error TS1507: There is nothing available for repetition. -- --!!! error TS1505: Incomplete quantifier. Digit expected. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{,1}??/u, -- ~~~~~ --!!! error TS1507: There is nothing available for repetition. -- --!!! error TS1505: Incomplete quantifier. Digit expected. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{1}??/u, -- ~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{1,}??/u, -- ~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{1,2}??/u, -- ~~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~ --!!! error TS1507: There is nothing available for repetition. -- /{2,1}??/u, -- ~~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~~~ --!!! error TS1506: Numbers out of order in quantifier. -- ~ --!!! error TS1507: There is nothing available for repetition. -- ]; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt new file mode 100644 index 00000000000..97eb5506e44 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt @@ -0,0 +1,67 @@ +regularExpressionCharacterClassRangeOrder.ts(7,4): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(7,11): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(8,11): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(9,11): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(11,4): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionCharacterClassRangeOrder.ts(11,14): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionCharacterClassRangeOrder.ts(11,25): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionCharacterClassRangeOrder.ts(11,25): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(11,35): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionCharacterClassRangeOrder.ts(12,25): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(13,25): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(15,10): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(15,37): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(16,31): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(17,31): error TS1517: Range out of order in character class. + + +==== regularExpressionCharacterClassRangeOrder.ts (15 errors) ==== + // The characters in the following regular expressions are ASCII-lookalike characters found in Unicode, including: + // - 𝘈 (U+1D608 Mathematical Sans-Serif Italic Capital A) + // - 𝘡 (U+1D621 Mathematical Sans-Serif Italic Capital Z) + // + // See https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols + const regexes: RegExp[] = [ + /[𝘈-𝘡][𝘡-𝘈]/, + ~~ +!!! error TS1517: Range out of order in character class. + ~~ +!!! error TS1517: Range out of order in character class. + /[𝘈-𝘡][𝘡-𝘈]/u, + ~~~ +!!! error TS1517: Range out of order in character class. + /[𝘈-𝘡][𝘡-𝘈]/v, + ~~~ +!!! error TS1517: Range out of order in character class. + + /[\u{1D608}-\u{1D621}][\u{1D621}-\u{1D608}]/, + ~~~~~~~~~ +!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1517: Range out of order in character class. + ~~~~~~~~~ +!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + /[\u{1D608}-\u{1D621}][\u{1D621}-\u{1D608}]/u, + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1517: Range out of order in character class. + /[\u{1D608}-\u{1D621}][\u{1D621}-\u{1D608}]/v, + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1517: Range out of order in character class. + + /[\uD835\uDE08-\uD835\uDE21][\uD835\uDE21-\uD835\uDE08]/, + ~~~~~~~~~~~~~ +!!! error TS1517: Range out of order in character class. + ~~~~~~~~~~~~~ +!!! error TS1517: Range out of order in character class. + /[\uD835\uDE08-\uD835\uDE21][\uD835\uDE21-\uD835\uDE08]/u, + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1517: Range out of order in character class. + /[\uD835\uDE08-\uD835\uDE21][\uD835\uDE21-\uD835\uDE08]/v, + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1517: Range out of order in character class. + ]; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt.diff index 09a02fe00bf..b12961b6457 100644 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt.diff @@ -3,69 +3,28 @@ @@= skipped -0, +0 lines =@@ -regularExpressionCharacterClassRangeOrder.ts(7,5): error TS1517: Range out of order in character class. -regularExpressionCharacterClassRangeOrder.ts(7,12): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(8,11): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(9,11): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(11,4): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionCharacterClassRangeOrder.ts(11,14): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionCharacterClassRangeOrder.ts(11,25): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionCharacterClassRangeOrder.ts(11,25): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(11,35): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionCharacterClassRangeOrder.ts(12,25): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(13,25): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(15,10): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(15,37): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(16,31): error TS1517: Range out of order in character class. --regularExpressionCharacterClassRangeOrder.ts(17,31): error TS1517: Range out of order in character class. -- -- --==== regularExpressionCharacterClassRangeOrder.ts (15 errors) ==== -- // The characters in the following regular expressions are ASCII-lookalike characters found in Unicode, including: -- // - 𝘈 (U+1D608 Mathematical Sans-Serif Italic Capital A) -- // - 𝘡 (U+1D621 Mathematical Sans-Serif Italic Capital Z) -- // -- // See https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols -- const regexes: RegExp[] = [ -- /[𝘈-𝘡][𝘡-𝘈]/, ++regularExpressionCharacterClassRangeOrder.ts(7,4): error TS1517: Range out of order in character class. ++regularExpressionCharacterClassRangeOrder.ts(7,11): error TS1517: Range out of order in character class. + regularExpressionCharacterClassRangeOrder.ts(8,11): error TS1517: Range out of order in character class. + regularExpressionCharacterClassRangeOrder.ts(9,11): error TS1517: Range out of order in character class. + regularExpressionCharacterClassRangeOrder.ts(11,4): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +@@= skipped -22, +22 lines =@@ + // See https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols + const regexes: RegExp[] = [ + /[𝘈-𝘡][𝘡-𝘈]/, - ~~~ --!!! error TS1517: Range out of order in character class. ++ ~~ + !!! error TS1517: Range out of order in character class. - ~~~ --!!! error TS1517: Range out of order in character class. -- /[𝘈-𝘡][𝘡-𝘈]/u, ++ ~~ + !!! error TS1517: Range out of order in character class. + /[𝘈-𝘡][𝘡-𝘈]/u, - ~~~~~ --!!! error TS1517: Range out of order in character class. -- /[𝘈-𝘡][𝘡-𝘈]/v, ++ ~~~ + !!! error TS1517: Range out of order in character class. + /[𝘈-𝘡][𝘡-𝘈]/v, - ~~~~~ --!!! error TS1517: Range out of order in character class. -- -- /[\u{1D608}-\u{1D621}][\u{1D621}-\u{1D608}]/, -- ~~~~~~~~~ --!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~~~~~~~ --!!! error TS1517: Range out of order in character class. -- ~~~~~~~~~ --!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- /[\u{1D608}-\u{1D621}][\u{1D621}-\u{1D608}]/u, -- ~~~~~~~~~~~~~~~~~~~ --!!! error TS1517: Range out of order in character class. -- /[\u{1D608}-\u{1D621}][\u{1D621}-\u{1D608}]/v, -- ~~~~~~~~~~~~~~~~~~~ --!!! error TS1517: Range out of order in character class. -- -- /[\uD835\uDE08-\uD835\uDE21][\uD835\uDE21-\uD835\uDE08]/, -- ~~~~~~~~~~~~~ --!!! error TS1517: Range out of order in character class. -- ~~~~~~~~~~~~~ --!!! error TS1517: Range out of order in character class. -- /[\uD835\uDE08-\uD835\uDE21][\uD835\uDE21-\uD835\uDE08]/u, -- ~~~~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS1517: Range out of order in character class. -- /[\uD835\uDE08-\uD835\uDE21][\uD835\uDE21-\uD835\uDE08]/v, -- ~~~~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS1517: Range out of order in character class. -- ]; -- -+ \ No newline at end of file ++ ~~~ + !!! error TS1517: Range out of order in character class. + + /[\u{1D608}-\u{1D621}][\u{1D621}-\u{1D608}]/, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionExtendedUnicodeEscapes.errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionExtendedUnicodeEscapes.errors.txt new file mode 100644 index 00000000000..6414010e5cc --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionExtendedUnicodeEscapes.errors.txt @@ -0,0 +1,15 @@ +regularExpressionExtendedUnicodeEscapes.ts(2,3): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionExtendedUnicodeEscapes.ts(2,13): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + + +==== regularExpressionExtendedUnicodeEscapes.ts (2 errors) ==== + const regexes: RegExp[] = [ + /\u{10000}[\u{10000}]/, + ~~~~~~~~~ +!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + /\u{10000}[\u{10000}]/u, + /\u{10000}[\u{10000}]/v, + ]; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionExtendedUnicodeEscapes.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionExtendedUnicodeEscapes.errors.txt.diff deleted file mode 100644 index af46f29a92f..00000000000 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionExtendedUnicodeEscapes.errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.regularExpressionExtendedUnicodeEscapes.errors.txt -+++ new.regularExpressionExtendedUnicodeEscapes.errors.txt -@@= skipped -0, +0 lines =@@ --regularExpressionExtendedUnicodeEscapes.ts(2,3): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionExtendedUnicodeEscapes.ts(2,13): error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- -- --==== regularExpressionExtendedUnicodeEscapes.ts (2 errors) ==== -- const regexes: RegExp[] = [ -- /\u{10000}[\u{10000}]/, -- ~~~~~~~~~ --!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1538: Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- /\u{10000}[\u{10000}]/u, -- /\u{10000}[\u{10000}]/v, -- ]; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionGroupNameSuggestions.errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionGroupNameSuggestions.errors.txt new file mode 100644 index 00000000000..b900c35fe69 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionGroupNameSuggestions.errors.txt @@ -0,0 +1,12 @@ +regularExpressionGroupNameSuggestions.ts(1,18): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionGroupNameSuggestions.ts(1,27): error TS1532: There is no capturing group named 'Foo' in this regular expression. + + +==== regularExpressionGroupNameSuggestions.ts (2 errors) ==== + const regex = /(?)\k/; + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~ +!!! error TS1532: There is no capturing group named 'Foo' in this regular expression. +!!! related TS1369: Did you mean 'foo'? + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionGroupNameSuggestions.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionGroupNameSuggestions.errors.txt.diff deleted file mode 100644 index d269c48fd15..00000000000 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionGroupNameSuggestions.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.regularExpressionGroupNameSuggestions.errors.txt -+++ new.regularExpressionGroupNameSuggestions.errors.txt -@@= skipped -0, +0 lines =@@ --regularExpressionGroupNameSuggestions.ts(1,18): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionGroupNameSuggestions.ts(1,27): error TS1532: There is no capturing group named 'Foo' in this regular expression. -- -- --==== regularExpressionGroupNameSuggestions.ts (2 errors) ==== -- const regex = /(?)\k/; -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~ --!!! error TS1532: There is no capturing group named 'Foo' in this regular expression. --!!! related TS1369: Did you mean 'foo'? -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es2015).errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es2015).errors.txt new file mode 100644 index 00000000000..a32fb1567c5 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es2015).errors.txt @@ -0,0 +1,709 @@ +regularExpressionScanning.ts(3,7): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(3,9): error TS1501: This regular expression flag is only available when targeting 'es2018' or later. +regularExpressionScanning.ts(3,10): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. +regularExpressionScanning.ts(3,11): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,12): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,13): error TS1500: Duplicate regular expression flag. +regularExpressionScanning.ts(3,14): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,15): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. +regularExpressionScanning.ts(3,16): error TS1501: This regular expression flag is only available when targeting 'es2022' or later. +regularExpressionScanning.ts(3,17): error TS1500: Duplicate regular expression flag. +regularExpressionScanning.ts(3,18): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,19): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,20): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,21): error TS1500: Duplicate regular expression flag. +regularExpressionScanning.ts(3,22): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(5,6): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(5,7): error TS1509: This regular expression flag cannot be toggled within a subpattern. +regularExpressionScanning.ts(5,10): error TS1509: This regular expression flag cannot be toggled within a subpattern. +regularExpressionScanning.ts(5,11): error TS1500: Duplicate regular expression flag. +regularExpressionScanning.ts(8,4): error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. +regularExpressionScanning.ts(9,4): error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. +regularExpressionScanning.ts(12,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(12,24): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. +regularExpressionScanning.ts(12,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(12,29): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. +regularExpressionScanning.ts(12,33): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. +regularExpressionScanning.ts(12,36): error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. +regularExpressionScanning.ts(12,42): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. +regularExpressionScanning.ts(12,47): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(12,48): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. +regularExpressionScanning.ts(12,53): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(12,54): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. +regularExpressionScanning.ts(13,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,24): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. +regularExpressionScanning.ts(13,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(13,29): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. +regularExpressionScanning.ts(13,33): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. +regularExpressionScanning.ts(13,36): error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. +regularExpressionScanning.ts(13,42): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. +regularExpressionScanning.ts(13,47): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,48): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. +regularExpressionScanning.ts(13,53): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,54): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. +regularExpressionScanning.ts(14,5): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,14): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,29): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(14,57): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,15): error TS1532: There is no capturing group named 'absent' in this regular expression. +regularExpressionScanning.ts(15,24): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,36): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,58): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. +regularExpressionScanning.ts(15,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. +regularExpressionScanning.ts(17,31): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(17,32): error TS1506: Numbers out of order in quantifier. +regularExpressionScanning.ts(17,40): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(19,12): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,15): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,28): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(20,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(20,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,72): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(23,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(23,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(24,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(25,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,67): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(26,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(28,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,59): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(31,3): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,6): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,15): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(31,20): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,23): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,3): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,10): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,14): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,24): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,3): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(34,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. +regularExpressionScanning.ts(34,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,46): error TS1005: '}' expected. +regularExpressionScanning.ts(34,47): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(36,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,55): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,76): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(38,8): error TS1005: '--' expected. +regularExpressionScanning.ts(38,9): error TS1520: Expected a class set operand. +regularExpressionScanning.ts(38,11): error TS1520: Expected a class set operand. +regularExpressionScanning.ts(38,12): error TS1005: '--' expected. +regularExpressionScanning.ts(38,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,50): error TS1520: Expected a class set operand. +regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(38,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,67): error TS1005: '--' expected. +regularExpressionScanning.ts(38,70): error TS1520: Expected a class set operand. +regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,85): error TS1520: Expected a class set 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,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. +regularExpressionScanning.ts(41,30): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(41,83): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(42,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,77): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(43,95): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(44,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,95): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(45,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,89): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(46,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,91): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. +regularExpressionScanning.ts(47,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + + +==== regularExpressionScanning.ts (219 errors) ==== + const regexes: RegExp[] = [ + // Flags + /foo/visualstudiocode, + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2018' or later. + ~ +!!! error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1500: Duplicate regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2022' or later. + ~ +!!! error TS1500: Duplicate regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1500: Duplicate regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + // Pattern modifiers + /(?med-ium:bar)/, + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1509: This regular expression flag cannot be toggled within a subpattern. + ~ +!!! error TS1509: This regular expression flag cannot be toggled within a subpattern. + ~ +!!! error TS1500: Duplicate regular expression flag. + // Capturing groups + /\0/, + /\1/, + ~ +!!! error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. + /\2/, + ~ +!!! error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. + /(hi)\1/, + /(hi) (hello) \2/, + /\2()(\12)(foo)\1\0[\0\1\01\123\08\8](\3\03)\5\005\9\009/, + ~~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~ +!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. + ~~~~ +!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. + ~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. + ~~ +!!! error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. + ~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. + ~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. + /\2()(\12)(foo)\1\0[\0\1\01\123\08\8](\3\03)\5\005\9\009/u, + ~~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~ +!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. + ~~~~ +!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. + ~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. + ~~ +!!! error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. + ~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. + ~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. + /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, + ~~~~~~ +!!! error TS1532: There is no capturing group named 'absent' in this regular expression. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~~~ +!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. + ~~~ +!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. + // Quantifiers + /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, + ~~~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~~~~~ +!!! error TS1506: Numbers out of order in quantifier. + ~~~~~~~~~ +!!! error TS1507: There is nothing available for repetition. + // Character classes + /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~~~ +!!! error TS1517: Range out of order in character class. + /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~~~ +!!! error TS1524: Unknown Unicode property name. + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1525: Expected a Unicode property value. + ~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1525: Expected a Unicode property value. + ~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1523: Expected a Unicode property name. + ~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1527: Expected a Unicode property name or value. + ~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1527: Expected a Unicode property name or value. + ~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1527: Expected a Unicode property name or value. + /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, + ~~~~~~~~~~~~~~~ +!!! error TS1524: Unknown Unicode property name. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1525: Expected a Unicode property value. + +!!! error TS1525: Expected a Unicode property value. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1527: Expected a Unicode property name or value. + ~~ +!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. + ~~ +!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. + +!!! error TS1527: Expected a Unicode property name or value. + +!!! error TS1527: Expected a Unicode property name or value. + /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, + ~~~~~~~~~~~~~~~ +!!! error TS1524: Unknown Unicode property name. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1525: Expected a Unicode property value. + +!!! error TS1525: Expected a Unicode property value. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1527: Expected a Unicode property name or value. + ~~ +!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. + ~~ +!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. + +!!! error TS1527: Expected a Unicode property name or value. + +!!! error TS1527: Expected a Unicode property name or value. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, + ~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, + ~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + // Character escapes + /\c[\c0\ca\cQ\c\C]\c1\C/, + /\c[\c0\ca\cQ\c\C]\c1\C/u, + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, + /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, + ~~ +!!! error TS1511: '\q' is only available inside character class. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1521: '\q' must be followed by string alternatives enclosed in braces. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + +!!! error TS1005: '}' expected. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + // Unicode sets notation + /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~ +!!! error TS1517: Range out of order in character class. + /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~ +!!! error TS1517: Range out of order in character class. + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + ~~~ +!!! error TS1517: Range out of order in character class. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, + +!!! error TS1005: '--' expected. + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + +!!! error TS1005: '--' expected. + ~~ +!!! error TS1522: A character class must not contain a reserved double punctuator. 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 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 TS1520: Expected a class set operand. + ~~ +!!! error TS1511: '\q' is only available inside character class. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1005: '--' expected. + +!!! 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. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /[[^\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 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, + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /[^\p{RGI_Emoji}\p{Emoji}][^\p{RGI_Emoji}--\p{Emoji}][^\p{RGI_Emoji}&&\p{Emoji}]/v, + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~ +!!! 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, + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /[^[[\p{RGI_Emoji}]]\p{Emoji}][^[[\p{RGI_Emoji}]]--\p{Emoji}][^[[\p{RGI_Emoji}]]&&\p{Emoji}]/v, + ~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, + ~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, + ~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~ +!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. + ]; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es2015).errors.txt.diff deleted file mode 100644 index c0d8a52a11d..00000000000 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es2015).errors.txt.diff +++ /dev/null @@ -1,713 +0,0 @@ ---- old.regularExpressionScanning(target=es2015).errors.txt -+++ new.regularExpressionScanning(target=es2015).errors.txt -@@= skipped -0, +0 lines =@@ --regularExpressionScanning.ts(3,7): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(3,9): error TS1501: This regular expression flag is only available when targeting 'es2018' or later. --regularExpressionScanning.ts(3,10): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. --regularExpressionScanning.ts(3,11): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,12): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,13): error TS1500: Duplicate regular expression flag. --regularExpressionScanning.ts(3,14): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,15): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. --regularExpressionScanning.ts(3,16): error TS1501: This regular expression flag is only available when targeting 'es2022' or later. --regularExpressionScanning.ts(3,17): error TS1500: Duplicate regular expression flag. --regularExpressionScanning.ts(3,18): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,19): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,20): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,21): error TS1500: Duplicate regular expression flag. --regularExpressionScanning.ts(3,22): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(5,6): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(5,7): error TS1509: This regular expression flag cannot be toggled within a subpattern. --regularExpressionScanning.ts(5,10): error TS1509: This regular expression flag cannot be toggled within a subpattern. --regularExpressionScanning.ts(5,11): error TS1500: Duplicate regular expression flag. --regularExpressionScanning.ts(8,4): error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. --regularExpressionScanning.ts(9,4): error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. --regularExpressionScanning.ts(12,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(12,24): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. --regularExpressionScanning.ts(12,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. --regularExpressionScanning.ts(12,29): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. --regularExpressionScanning.ts(12,33): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. --regularExpressionScanning.ts(12,36): error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. --regularExpressionScanning.ts(12,42): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. --regularExpressionScanning.ts(12,47): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(12,48): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. --regularExpressionScanning.ts(12,53): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(12,54): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. --regularExpressionScanning.ts(13,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(13,24): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. --regularExpressionScanning.ts(13,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. --regularExpressionScanning.ts(13,29): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. --regularExpressionScanning.ts(13,33): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. --regularExpressionScanning.ts(13,36): error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. --regularExpressionScanning.ts(13,42): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. --regularExpressionScanning.ts(13,47): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(13,48): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. --regularExpressionScanning.ts(13,53): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(13,54): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. --regularExpressionScanning.ts(14,5): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(14,14): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(14,29): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(14,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(14,57): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(15,15): error TS1532: There is no capturing group named 'absent' in this regular expression. --regularExpressionScanning.ts(15,24): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(15,36): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(15,45): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(15,58): error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. --regularExpressionScanning.ts(15,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. --regularExpressionScanning.ts(17,31): error TS1507: There is nothing available for repetition. --regularExpressionScanning.ts(17,32): error TS1506: Numbers out of order in quantifier. --regularExpressionScanning.ts(17,40): error TS1507: There is nothing available for repetition. --regularExpressionScanning.ts(19,12): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(19,15): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(19,28): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(20,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,28): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(20,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,62): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(21,28): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(21,62): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(22,28): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(22,62): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(22,72): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(23,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,6): error TS1524: Unknown Unicode property name. --regularExpressionScanning.ts(23,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,31): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(23,32): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(23,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,39): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(23,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,43): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(23,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,52): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(23,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,62): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(23,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,66): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(24,6): error TS1524: Unknown Unicode property name. --regularExpressionScanning.ts(24,31): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(24,32): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(24,39): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(24,43): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(24,52): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(24,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionScanning.ts(24,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionScanning.ts(24,62): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(24,66): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(25,6): error TS1524: Unknown Unicode property name. --regularExpressionScanning.ts(25,31): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(25,32): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(25,39): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(25,43): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(25,52): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(25,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionScanning.ts(25,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionScanning.ts(25,62): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(25,66): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(25,67): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(26,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(27,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(27,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(27,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(27,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(28,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(28,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(28,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(28,59): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(31,3): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionScanning.ts(31,6): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionScanning.ts(31,15): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionScanning.ts(31,17): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(31,20): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionScanning.ts(31,23): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,3): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,7): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,10): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,14): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,17): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,21): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,24): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,39): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(33,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(33,43): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,3): error TS1511: '\q' is only available inside character class. --regularExpressionScanning.ts(34,7): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. --regularExpressionScanning.ts(34,17): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,21): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,39): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,43): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,46): error TS1005: '}' expected. --regularExpressionScanning.ts(34,47): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(36,4): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(36,8): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(36,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(36,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(36,63): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(37,4): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(37,8): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(37,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,55): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,63): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(37,76): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(38,8): error TS1005: '--' expected. --regularExpressionScanning.ts(38,9): error TS1520: Expected a class set operand. --regularExpressionScanning.ts(38,11): error TS1520: Expected a class set operand. --regularExpressionScanning.ts(38,12): error TS1005: '--' expected. --regularExpressionScanning.ts(38,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,50): error TS1520: Expected a class set operand. --regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside character class. --regularExpressionScanning.ts(38,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,67): error TS1005: '--' expected. --regularExpressionScanning.ts(38,70): error TS1520: Expected a class set operand. --regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,85): error TS1520: Expected a class set 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,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. --regularExpressionScanning.ts(41,30): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(41,83): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(42,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(42,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(42,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(42,77): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(43,95): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(44,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(44,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(44,95): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(45,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(45,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(45,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(45,89): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(46,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(46,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(46,91): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. --regularExpressionScanning.ts(47,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(47,101): error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- -- --==== regularExpressionScanning.ts (219 errors) ==== -- const regexes: RegExp[] = [ -- // Flags -- /foo/visualstudiocode, -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2018' or later. -- ~ --!!! error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1500: Duplicate regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2022' or later. -- ~ --!!! error TS1500: Duplicate regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1500: Duplicate regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- // Pattern modifiers -- /(?med-ium:bar)/, -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1509: This regular expression flag cannot be toggled within a subpattern. -- ~ --!!! error TS1509: This regular expression flag cannot be toggled within a subpattern. -- ~ --!!! error TS1500: Duplicate regular expression flag. -- // Capturing groups -- /\0/, -- /\1/, -- ~ --!!! error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. -- /\2/, -- ~ --!!! error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. -- /(hi)\1/, -- /(hi) (hello) \2/, -- /\2()(\12)(foo)\1\0[\0\1\01\123\08\8](\3\03)\5\005\9\009/, -- ~~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~ --!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -- ~~~~ --!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. -- ~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. -- ~~ --!!! error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -- ~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -- ~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. -- /\2()(\12)(foo)\1\0[\0\1\01\123\08\8](\3\03)\5\005\9\009/u, -- ~~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~ --!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -- ~~~~ --!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. -- ~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. -- ~~ --!!! error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -- ~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -- ~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. -- /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, -- ~~~~~~ --!!! error TS1532: There is no capturing group named 'absent' in this regular expression. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~~~ --!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. -- ~~~ --!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. -- // Quantifiers -- /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, -- ~~~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~~~~~ --!!! error TS1506: Numbers out of order in quantifier. -- ~~~~~~~~~ --!!! error TS1507: There is nothing available for repetition. -- // Character classes -- /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~~~ --!!! error TS1517: Range out of order in character class. -- /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, -- ~~~~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~~~ --!!! error TS1524: Unknown Unicode property name. -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1525: Expected a Unicode property value. -- ~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1525: Expected a Unicode property value. -- ~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1523: Expected a Unicode property name. -- ~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1527: Expected a Unicode property name or value. -- /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, -- ~~~~~~~~~~~~~~~ --!!! error TS1524: Unknown Unicode property name. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1525: Expected a Unicode property value. -- --!!! error TS1525: Expected a Unicode property value. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~~ --!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -- ~~ --!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -- --!!! error TS1527: Expected a Unicode property name or value. -- --!!! error TS1527: Expected a Unicode property name or value. -- /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, -- ~~~~~~~~~~~~~~~ --!!! error TS1524: Unknown Unicode property name. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1525: Expected a Unicode property value. -- --!!! error TS1525: Expected a Unicode property value. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~~ --!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -- ~~ --!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -- --!!! error TS1527: Expected a Unicode property name or value. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, -- ~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, -- ~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- // Character escapes -- /\c[\c0\ca\cQ\c\C]\c1\C/, -- /\c[\c0\ca\cQ\c\C]\c1\C/u, -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, -- /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, -- ~~ --!!! error TS1511: '\q' is only available inside character class. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1521: '\q' must be followed by string alternatives enclosed in braces. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- --!!! error TS1005: '}' expected. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- // Unicode sets notation -- /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~ --!!! error TS1517: Range out of order in character class. -- /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, -- --!!! error TS1005: '--' expected. -- --!!! error TS1520: Expected a class set operand. -- --!!! error TS1520: Expected a class set operand. -- --!!! error TS1005: '--' expected. -- ~~ --!!! error TS1522: A character class must not contain a reserved double punctuator. 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 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 TS1520: Expected a class set operand. -- ~~ --!!! error TS1511: '\q' is only available inside character class. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? -- --!!! error TS1005: '--' expected. -- --!!! 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. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /[[^\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 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, -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /[^\p{RGI_Emoji}\p{Emoji}][^\p{RGI_Emoji}--\p{Emoji}][^\p{RGI_Emoji}&&\p{Emoji}]/v, -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~ --!!! 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, -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /[^[[\p{RGI_Emoji}]]\p{Emoji}][^[[\p{RGI_Emoji}]]--\p{Emoji}][^[[\p{RGI_Emoji}]]&&\p{Emoji}]/v, -- ~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, -- ~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, -- ~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, -- ~~~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~ --!!! error TS1501: This regular expression flag is only available when targeting 'es2024' or later. -- ]; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=esnext).errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=esnext).errors.txt new file mode 100644 index 00000000000..c2d144d42c5 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=esnext).errors.txt @@ -0,0 +1,631 @@ +regularExpressionScanning.ts(3,10): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. +regularExpressionScanning.ts(3,11): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,12): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,13): error TS1500: Duplicate regular expression flag. +regularExpressionScanning.ts(3,14): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,15): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. +regularExpressionScanning.ts(3,17): error TS1500: Duplicate regular expression flag. +regularExpressionScanning.ts(3,18): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,19): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,20): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(3,21): error TS1500: Duplicate regular expression flag. +regularExpressionScanning.ts(3,22): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(5,6): error TS1499: Unknown regular expression flag. +regularExpressionScanning.ts(5,7): error TS1509: This regular expression flag cannot be toggled within a subpattern. +regularExpressionScanning.ts(5,10): error TS1509: This regular expression flag cannot be toggled within a subpattern. +regularExpressionScanning.ts(5,11): error TS1500: Duplicate regular expression flag. +regularExpressionScanning.ts(8,4): error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. +regularExpressionScanning.ts(9,4): error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. +regularExpressionScanning.ts(12,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(12,24): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. +regularExpressionScanning.ts(12,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(12,29): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. +regularExpressionScanning.ts(12,33): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. +regularExpressionScanning.ts(12,36): error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. +regularExpressionScanning.ts(12,42): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. +regularExpressionScanning.ts(12,47): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(12,48): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. +regularExpressionScanning.ts(12,53): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(12,54): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. +regularExpressionScanning.ts(13,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,24): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. +regularExpressionScanning.ts(13,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. +regularExpressionScanning.ts(13,29): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. +regularExpressionScanning.ts(13,33): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. +regularExpressionScanning.ts(13,36): error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. +regularExpressionScanning.ts(13,42): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. +regularExpressionScanning.ts(13,47): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,48): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. +regularExpressionScanning.ts(13,53): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. +regularExpressionScanning.ts(13,54): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. +regularExpressionScanning.ts(15,15): error TS1532: There is no capturing group named 'absent' in this regular expression. +regularExpressionScanning.ts(15,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. +regularExpressionScanning.ts(17,31): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(17,32): error TS1506: Numbers out of order in quantifier. +regularExpressionScanning.ts(17,40): error TS1507: There is nothing available for repetition. +regularExpressionScanning.ts(19,12): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,15): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(19,28): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(20,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(20,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(20,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(21,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,28): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(22,62): error TS1529: Unknown Unicode property name or value. +regularExpressionScanning.ts(23,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(23,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(23,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(23,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(23,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(23,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(24,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(24,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(24,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(24,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(24,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,6): error TS1524: Unknown Unicode property name. +regularExpressionScanning.ts(25,31): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,32): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,39): error TS1525: Expected a Unicode property value. +regularExpressionScanning.ts(25,43): error TS1523: Expected a Unicode property name. +regularExpressionScanning.ts(25,52): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. +regularExpressionScanning.ts(25,62): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(25,66): error TS1527: Expected a Unicode property name or value. +regularExpressionScanning.ts(26,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(26,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(27,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(28,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(28,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(31,3): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,6): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,15): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(31,20): error TS1512: '\c' must be followed by an ASCII letter. +regularExpressionScanning.ts(31,23): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,3): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,10): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,14): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,24): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(33,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(33,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,3): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(34,7): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. +regularExpressionScanning.ts(34,17): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,21): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,39): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,43): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(34,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(34,46): error TS1005: '}' expected. +regularExpressionScanning.ts(36,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(36,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. +regularExpressionScanning.ts(36,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,4): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,8): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,55): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(37,63): error TS1517: Range out of order in character class. +regularExpressionScanning.ts(37,76): error TS1535: This character cannot be escaped in a regular expression. +regularExpressionScanning.ts(38,8): error TS1005: '--' expected. +regularExpressionScanning.ts(38,9): error TS1520: Expected a class set operand. +regularExpressionScanning.ts(38,11): error TS1520: Expected a class set operand. +regularExpressionScanning.ts(38,12): error TS1005: '--' expected. +regularExpressionScanning.ts(38,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. +regularExpressionScanning.ts(38,50): error TS1520: Expected a class set operand. +regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside character class. +regularExpressionScanning.ts(38,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,67): error TS1005: '--' expected. +regularExpressionScanning.ts(38,70): error TS1520: Expected a class set operand. +regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? +regularExpressionScanning.ts(38,85): error TS1520: Expected a class set 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(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. +regularExpressionScanning.ts(42,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(42,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(44,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(45,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(46,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. +regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + + +==== regularExpressionScanning.ts (193 errors) ==== + const regexes: RegExp[] = [ + // Flags + /foo/visualstudiocode, + ~ +!!! error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1500: Duplicate regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. + ~ +!!! error TS1500: Duplicate regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1500: Duplicate regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + // Pattern modifiers + /(?med-ium:bar)/, + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1509: This regular expression flag cannot be toggled within a subpattern. + ~ +!!! error TS1509: This regular expression flag cannot be toggled within a subpattern. + ~ +!!! error TS1500: Duplicate regular expression flag. + // Capturing groups + /\0/, + /\1/, + ~ +!!! error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. + /\2/, + ~ +!!! error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. + /(hi)\1/, + /(hi) (hello) \2/, + /\2()(\12)(foo)\1\0[\0\1\01\123\08\8](\3\03)\5\005\9\009/, + ~~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~ +!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. + ~~~~ +!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. + ~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. + ~~ +!!! error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. + ~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. + ~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. + /\2()(\12)(foo)\1\0[\0\1\01\123\08\8](\3\03)\5\005\9\009/u, + ~~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~ +!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. + ~~~~ +!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. + ~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. + ~~ +!!! error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. + ~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. + ~ +!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. + ~~~ +!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. + /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, + /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, + ~~~~~~ +!!! error TS1532: There is no capturing group named 'absent' in this regular expression. + ~~~ +!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. + // Quantifiers + /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, + ~~~~~~~ +!!! error TS1507: There is nothing available for repetition. + ~~~~~ +!!! error TS1506: Numbers out of order in quantifier. + ~~~~~~~~~ +!!! error TS1507: There is nothing available for repetition. + // Character classes + /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~~~ +!!! error TS1517: Range out of order in character class. + /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + ~~~~~~~ +!!! error TS1529: Unknown Unicode property name or value. + /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~~~ +!!! error TS1524: Unknown Unicode property name. + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1525: Expected a Unicode property value. + ~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1525: Expected a Unicode property value. + ~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1523: Expected a Unicode property name. + ~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1527: Expected a Unicode property name or value. + ~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1527: Expected a Unicode property name or value. + ~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + +!!! error TS1527: Expected a Unicode property name or value. + /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, + ~~~~~~~~~~~~~~~ +!!! error TS1524: Unknown Unicode property name. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1525: Expected a Unicode property value. + +!!! error TS1525: Expected a Unicode property value. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1527: Expected a Unicode property name or value. + ~~ +!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. + ~~ +!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. + +!!! error TS1527: Expected a Unicode property name or value. + +!!! error TS1527: Expected a Unicode property name or value. + /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, + ~~~~~~~~~~~~~~~ +!!! error TS1524: Unknown Unicode property name. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1525: Expected a Unicode property value. + +!!! error TS1525: Expected a Unicode property value. + +!!! error TS1523: Expected a Unicode property name. + +!!! error TS1527: Expected a Unicode property name or value. + ~~ +!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. + ~~ +!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. + +!!! error TS1527: Expected a Unicode property name or value. + +!!! error TS1527: Expected a Unicode property name or value. + /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, + ~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + ~~~~~~~~~ +!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. + /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, + ~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + // Character escapes + /\c[\c0\ca\cQ\c\C]\c1\C/, + /\c[\c0\ca\cQ\c\C]\c1\C/u, + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1512: '\c' must be followed by an ASCII letter. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, + /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, + ~~ +!!! error TS1511: '\q' is only available inside character class. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1521: '\q' must be followed by string alternatives enclosed in braces. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + +!!! error TS1005: '}' expected. + // Unicode sets notation + /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~~~ +!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. + ~~~ +!!! error TS1517: Range out of order in character class. + /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, + ~~~ +!!! error TS1517: Range out of order in character class. + ~~~ +!!! error TS1517: Range out of order in character class. + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + ~~~ +!!! error TS1517: Range out of order in character class. + ~~ +!!! error TS1535: This character cannot be escaped in a regular expression. + /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, + +!!! error TS1005: '--' expected. + +!!! error TS1520: Expected a class set operand. + +!!! error TS1520: Expected a class set operand. + +!!! error TS1005: '--' expected. + ~~ +!!! error TS1522: A character class must not contain a reserved double punctuator. 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 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 TS1520: Expected a class set operand. + ~~ +!!! error TS1511: '\q' is only available inside character class. + ~ +!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + ~ +!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? + +!!! error TS1005: '--' expected. + +!!! 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. + /[[^\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. + /[^\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, + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + /[^\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, + ~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, + ~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, + ~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ~~~~~~~~~ +!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. + ]; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=esnext).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=esnext).errors.txt.diff deleted file mode 100644 index 427334cc4b8..00000000000 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=esnext).errors.txt.diff +++ /dev/null @@ -1,635 +0,0 @@ ---- old.regularExpressionScanning(target=esnext).errors.txt -+++ new.regularExpressionScanning(target=esnext).errors.txt -@@= skipped -0, +0 lines =@@ --regularExpressionScanning.ts(3,10): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. --regularExpressionScanning.ts(3,11): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,12): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,13): error TS1500: Duplicate regular expression flag. --regularExpressionScanning.ts(3,14): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,15): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. --regularExpressionScanning.ts(3,17): error TS1500: Duplicate regular expression flag. --regularExpressionScanning.ts(3,18): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,19): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,20): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(3,21): error TS1500: Duplicate regular expression flag. --regularExpressionScanning.ts(3,22): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(5,6): error TS1499: Unknown regular expression flag. --regularExpressionScanning.ts(5,7): error TS1509: This regular expression flag cannot be toggled within a subpattern. --regularExpressionScanning.ts(5,10): error TS1509: This regular expression flag cannot be toggled within a subpattern. --regularExpressionScanning.ts(5,11): error TS1500: Duplicate regular expression flag. --regularExpressionScanning.ts(8,4): error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. --regularExpressionScanning.ts(9,4): error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. --regularExpressionScanning.ts(12,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(12,24): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. --regularExpressionScanning.ts(12,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. --regularExpressionScanning.ts(12,29): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. --regularExpressionScanning.ts(12,33): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. --regularExpressionScanning.ts(12,36): error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. --regularExpressionScanning.ts(12,42): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. --regularExpressionScanning.ts(12,47): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(12,48): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. --regularExpressionScanning.ts(12,53): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(12,54): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. --regularExpressionScanning.ts(13,9): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(13,24): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. --regularExpressionScanning.ts(13,26): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. --regularExpressionScanning.ts(13,29): error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. --regularExpressionScanning.ts(13,33): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. --regularExpressionScanning.ts(13,36): error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. --regularExpressionScanning.ts(13,42): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. --regularExpressionScanning.ts(13,47): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(13,48): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. --regularExpressionScanning.ts(13,53): error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. --regularExpressionScanning.ts(13,54): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. --regularExpressionScanning.ts(15,15): error TS1532: There is no capturing group named 'absent' in this regular expression. --regularExpressionScanning.ts(15,59): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. --regularExpressionScanning.ts(17,31): error TS1507: There is nothing available for repetition. --regularExpressionScanning.ts(17,32): error TS1506: Numbers out of order in quantifier. --regularExpressionScanning.ts(17,40): error TS1507: There is nothing available for repetition. --regularExpressionScanning.ts(19,12): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(19,15): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(19,28): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(20,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,8): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,25): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,28): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(20,37): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,50): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(20,62): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(21,28): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(21,62): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(22,28): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(22,62): error TS1529: Unknown Unicode property name or value. --regularExpressionScanning.ts(23,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,6): error TS1524: Unknown Unicode property name. --regularExpressionScanning.ts(23,28): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,31): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(23,32): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(23,33): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,39): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(23,40): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,43): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(23,49): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,52): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(23,59): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,62): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(23,63): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(23,66): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(24,6): error TS1524: Unknown Unicode property name. --regularExpressionScanning.ts(24,31): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(24,32): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(24,39): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(24,43): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(24,52): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(24,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionScanning.ts(24,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionScanning.ts(24,62): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(24,66): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(25,6): error TS1524: Unknown Unicode property name. --regularExpressionScanning.ts(25,31): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(25,32): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(25,39): error TS1525: Expected a Unicode property value. --regularExpressionScanning.ts(25,43): error TS1523: Expected a Unicode property name. --regularExpressionScanning.ts(25,52): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(25,53): error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionScanning.ts(25,57): error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. --regularExpressionScanning.ts(25,62): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(25,66): error TS1527: Expected a Unicode property name or value. --regularExpressionScanning.ts(26,3): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,16): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,31): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,44): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(26,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(27,6): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(27,19): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(27,34): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(27,47): error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(28,19): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(28,31): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(28,47): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(31,3): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionScanning.ts(31,6): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionScanning.ts(31,15): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionScanning.ts(31,17): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(31,20): error TS1512: '\c' must be followed by an ASCII letter. --regularExpressionScanning.ts(31,23): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,3): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,7): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,10): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,14): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,17): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,21): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,24): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,39): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(33,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(33,43): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(33,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,3): error TS1511: '\q' is only available inside character class. --regularExpressionScanning.ts(34,7): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,10): error TS1521: '\q' must be followed by string alternatives enclosed in braces. --regularExpressionScanning.ts(34,17): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,21): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,23): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,38): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,39): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,41): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,42): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,43): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(34,45): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(34,46): error TS1005: '}' expected. --regularExpressionScanning.ts(36,4): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(36,8): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(36,34): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(36,42): error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. --regularExpressionScanning.ts(36,63): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(37,4): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(37,8): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(37,19): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,50): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,51): error TS1508: Unexpected ']'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,55): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(37,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(37,63): error TS1517: Range out of order in character class. --regularExpressionScanning.ts(37,76): error TS1535: This character cannot be escaped in a regular expression. --regularExpressionScanning.ts(38,8): error TS1005: '--' expected. --regularExpressionScanning.ts(38,9): error TS1520: Expected a class set operand. --regularExpressionScanning.ts(38,11): error TS1520: Expected a class set operand. --regularExpressionScanning.ts(38,12): error TS1005: '--' expected. --regularExpressionScanning.ts(38,15): error TS1522: A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,20): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,28): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,40): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,47): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,49): error TS1519: Operators must not be mixed within a character class. Wrap it in a nested class instead. --regularExpressionScanning.ts(38,50): error TS1520: Expected a class set operand. --regularExpressionScanning.ts(38,55): error TS1511: '\q' is only available inside character class. --regularExpressionScanning.ts(38,57): error TS1508: Unexpected '{'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,61): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,66): error TS1508: Unexpected '-'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,67): error TS1005: '--' expected. --regularExpressionScanning.ts(38,70): error TS1520: Expected a class set operand. --regularExpressionScanning.ts(38,75): error TS1508: Unexpected '&'. Did you mean to escape it with backslash? --regularExpressionScanning.ts(38,85): error TS1520: Expected a class set 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(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. --regularExpressionScanning.ts(42,28): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(42,53): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(44,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(44,34): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(45,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(45,32): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(45,61): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(46,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(46,79): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(47,5): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. --regularExpressionScanning.ts(47,89): error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- -- --==== regularExpressionScanning.ts (193 errors) ==== -- const regexes: RegExp[] = [ -- // Flags -- /foo/visualstudiocode, -- ~ --!!! error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1500: Duplicate regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously. -- ~ --!!! error TS1500: Duplicate regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1500: Duplicate regular expression flag. -- ~ --!!! error TS1499: Unknown regular expression flag. -- // Pattern modifiers -- /(?med-ium:bar)/, -- ~ --!!! error TS1499: Unknown regular expression flag. -- ~ --!!! error TS1509: This regular expression flag cannot be toggled within a subpattern. -- ~ --!!! error TS1509: This regular expression flag cannot be toggled within a subpattern. -- ~ --!!! error TS1500: Duplicate regular expression flag. -- // Capturing groups -- /\0/, -- /\1/, -- ~ --!!! error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. -- /\2/, -- ~ --!!! error TS1534: This backreference refers to a group that does not exist. There are no capturing groups in this regular expression. -- /(hi)\1/, -- /(hi) (hello) \2/, -- /\2()(\12)(foo)\1\0[\0\1\01\123\08\8](\3\03)\5\005\9\009/, -- ~~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~ --!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -- ~~~~ --!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. -- ~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. -- ~~ --!!! error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -- ~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -- ~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. -- /\2()(\12)(foo)\1\0[\0\1\01\123\08\8](\3\03)\5\005\9\009/u, -- ~~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~ --!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x01' instead. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'. -- ~~~~ --!!! error TS1536: Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '\x53' instead. -- ~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. -- ~~ --!!! error TS1537: Decimal escape sequences and backreferences are not allowed in a character class. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x03'. -- ~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'. -- ~ --!!! error TS1533: This backreference refers to a group that does not exist. There are only 4 capturing groups in this regular expression. -- ~~~ --!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'. -- /(?)((?bar)bar)(?baz)|(foo(?foo))(?)/, -- /(\k)\k(?foo)|(?)((?)|(bar(?bar)))/, -- ~~~~~~ --!!! error TS1532: There is no capturing group named 'absent' in this regular expression. -- ~~~ --!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other. -- // Quantifiers -- /{}{1,2}_{3}.{4,}?(foo){008}${32,16}\b{064,128}.+&*?\???\n{,256}{\\{,/, -- ~~~~~~~ --!!! error TS1507: There is nothing available for repetition. -- ~~~~~ --!!! error TS1506: Numbers out of order in quantifier. -- ~~~~~~~~~ --!!! error TS1507: There is nothing available for repetition. -- // Character classes -- /[-A-Za-z-z-aZ-A\d_-\d-.-.\r-\n\w-\W]/, -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~~~ --!!! error TS1517: Range out of order in character class. -- /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/, -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/u, -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- /\p{L}\p{gc=L}\p{ASCII}\p{Invalid}[\p{L}\p{gc=L}\P{ASCII}\p{Invalid}]/v, -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- ~~~~~~~ --!!! error TS1529: Unknown Unicode property name or value. -- /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/, -- ~~~~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~~~ --!!! error TS1524: Unknown Unicode property name. -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1525: Expected a Unicode property value. -- ~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1525: Expected a Unicode property value. -- ~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1523: Expected a Unicode property name. -- ~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- --!!! error TS1527: Expected a Unicode property name or value. -- /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/u, -- ~~~~~~~~~~~~~~~ --!!! error TS1524: Unknown Unicode property name. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1525: Expected a Unicode property value. -- --!!! error TS1525: Expected a Unicode property value. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~~ --!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -- ~~ --!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -- --!!! error TS1527: Expected a Unicode property name or value. -- --!!! error TS1527: Expected a Unicode property name or value. -- /\p{InvalidProperty=Value}\p{=}\p{sc=}\P{=foo}[\p{}\p\\\P\P{]\p{/v, -- ~~~~~~~~~~~~~~~ --!!! error TS1524: Unknown Unicode property name. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1525: Expected a Unicode property value. -- --!!! error TS1525: Expected a Unicode property value. -- --!!! error TS1523: Expected a Unicode property name. -- --!!! error TS1527: Expected a Unicode property name or value. -- ~~ --!!! error TS1531: '\p' must be followed by a Unicode property value expression enclosed in braces. -- ~~ --!!! error TS1531: '\P' must be followed by a Unicode property value expression enclosed in braces. -- --!!! error TS1527: Expected a Unicode property name or value. -- --!!! error TS1527: Expected a Unicode property name or value. -- /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/, -- ~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/u, -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- ~~~~~~~~~ --!!! error TS1528: Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set. -- /\p{RGI_Emoji}\P{RGI_Emoji}[^\p{RGI_Emoji}\P{RGI_Emoji}]/v, -- ~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- // Character escapes -- /\c[\c0\ca\cQ\c\C]\c1\C/, -- /\c[\c0\ca\cQ\c\C]\c1\C/u, -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1512: '\c' must be followed by an ASCII letter. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/, -- /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/u, -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- /\q\\\`[\q\\\`[\Q\\\Q{\q{foo|bar|baz]\q{]\q{/v, -- ~~ --!!! error TS1511: '\q' is only available inside character class. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1521: '\q' must be followed by string alternatives enclosed in braces. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- --!!! error TS1005: '}' expected. -- // Unicode sets notation -- /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/, -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~~~ --!!! error TS1530: Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. -- ~~~ --!!! error TS1517: Range out of order in character class. -- /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/u, -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected ']'. Did you mean to escape it with backslash? -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- ~~~ --!!! error TS1517: Range out of order in character class. -- ~~ --!!! error TS1535: This character cannot be escaped in a regular expression. -- /[a--b[--][\d++[]]&&[[&0-9--]&&[\p{L}]--\P{L}-_-]]&&&\q{foo}[0---9][&&q&&&\q{bar}&&]/v, -- --!!! error TS1005: '--' expected. -- --!!! error TS1520: Expected a class set operand. -- --!!! error TS1520: Expected a class set operand. -- --!!! error TS1005: '--' expected. -- ~~ --!!! error TS1522: A character class must not contain a reserved double punctuator. 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 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 TS1520: Expected a class set operand. -- ~~ --!!! error TS1511: '\q' is only available inside character class. -- ~ --!!! error TS1508: Unexpected '{'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- ~ --!!! error TS1508: Unexpected '-'. Did you mean to escape it with backslash? -- --!!! error TS1005: '--' expected. -- --!!! 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. -- /[[^\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. -- /[^\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, -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- /[^\p{RGI_Emoji}\q{foo}][^\p{RGI_Emoji}--\q{foo}][^\p{RGI_Emoji}&&\q{foo}]/v, -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- /[^\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, -- ~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- /[^[[\p{RGI_Emoji}]]\q{foo}][^[[\p{RGI_Emoji}]]--\q{foo}][^[[\p{RGI_Emoji}]]&&\q{foo}]/v, -- ~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- /[^\q{foo|bar|baz}--\q{foo}--\q{bar}--\q{baz}][^\p{L}--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, -- ~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- /[^[[\q{foo|bar|baz}]]--\q{foo}--\q{bar}--\q{baz}][^[^[^\p{L}]]--\q{foo}--[\q{bar}]--[^[\q{baz}]]]/v, -- ~~~~~~~~~~~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ~~~~~~~~~ --!!! error TS1518: Anything that would possibly match more than a single character is invalid inside a negated character class. -- ]; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions(target=es2015).errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions(target=es2015).errors.txt new file mode 100644 index 00000000000..cf811c2d94e --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions(target=es2015).errors.txt @@ -0,0 +1,25 @@ +regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,19): error TS1529: Unknown Unicode property name or value. +regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,28): error TS1524: Unknown Unicode property name. +regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,45): error TS1526: Unknown Unicode property value. +regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,57): error TS1524: Unknown Unicode property name. +regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,93): error TS1526: Unknown Unicode property value. + + +==== regularExpressionUnicodePropertyValueExpressionSuggestions.ts (5 errors) ==== + const regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}\p{Script_Declensions=Inherited}\p{scx=inherit}/u; + ~~~~~ +!!! error TS1529: Unknown Unicode property name or value. +!!! related TS1369: Did you mean 'ASCII'? + ~~ +!!! error TS1524: Unknown Unicode property name. +!!! related TS1369: Did you mean 'sc'? + ~~~~~~~~ +!!! error TS1526: Unknown Unicode property value. +!!! related TS1369: Did you mean 'Unknown'? + ~~~~~~~~~~~~~~~~~~ +!!! error TS1524: Unknown Unicode property name. +!!! related TS1369: Did you mean 'Script_Extensions'? + ~~~~~~~ +!!! error TS1526: Unknown Unicode property value. +!!! related TS1369: Did you mean 'Inherited'? + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions(target=es2015).errors.txt.diff deleted file mode 100644 index 5c6454b8273..00000000000 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions(target=es2015).errors.txt.diff +++ /dev/null @@ -1,29 +0,0 @@ ---- old.regularExpressionUnicodePropertyValueExpressionSuggestions(target=es2015).errors.txt -+++ new.regularExpressionUnicodePropertyValueExpressionSuggestions(target=es2015).errors.txt -@@= skipped -0, +0 lines =@@ --regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,19): error TS1529: Unknown Unicode property name or value. --regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,28): error TS1524: Unknown Unicode property name. --regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,45): error TS1526: Unknown Unicode property value. --regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,57): error TS1524: Unknown Unicode property name. --regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,93): error TS1526: Unknown Unicode property value. -- -- --==== regularExpressionUnicodePropertyValueExpressionSuggestions.ts (5 errors) ==== -- const regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}\p{Script_Declensions=Inherited}\p{scx=inherit}/u; -- ~~~~~ --!!! error TS1529: Unknown Unicode property name or value. --!!! related TS1369: Did you mean 'ASCII'? -- ~~ --!!! error TS1524: Unknown Unicode property name. --!!! related TS1369: Did you mean 'sc'? -- ~~~~~~~~ --!!! error TS1526: Unknown Unicode property value. --!!! related TS1369: Did you mean 'Unknown'? -- ~~~~~~~~~~~~~~~~~~ --!!! error TS1524: Unknown Unicode property name. --!!! related TS1369: Did you mean 'Script_Extensions'? -- ~~~~~~~ --!!! error TS1526: Unknown Unicode property value. --!!! related TS1369: Did you mean 'Inherited'? -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt new file mode 100644 index 00000000000..e17836b0ddc --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt @@ -0,0 +1,29 @@ +regularExpressionWithNonBMPFlags.ts(7,23): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,25): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,28): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,41): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,43): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,45): error TS1499: Unknown regular expression flag. + + +==== regularExpressionWithNonBMPFlags.ts (6 errors) ==== + // The characters in the following regular expression are ASCII-lookalike characters found in Unicode, including: + // - 𝘴 (U+1D634 Mathematical Sans-Serif Italic Small S) + // - 𝘪 (U+1D62A Mathematical Sans-Serif Italic Small I) + // - 𝘮 (U+1D62E Mathematical Sans-Serif Italic Small M) + // + // See https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols + const 𝘳𝘦𝘨𝘦𝘹 = /(?𝘴𝘪-𝘮:^𝘧𝘰𝘰.)/𝘨𝘮𝘶; + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + ~ +!!! error TS1499: Unknown regular expression flag. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt.diff index cd423f64ac8..c80909e6d74 100644 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt.diff @@ -1,22 +1,9 @@ --- old.regularExpressionWithNonBMPFlags.errors.txt +++ new.regularExpressionWithNonBMPFlags.errors.txt -@@= skipped -0, +0 lines =@@ --regularExpressionWithNonBMPFlags.ts(7,23): error TS1499: Unknown regular expression flag. --regularExpressionWithNonBMPFlags.ts(7,25): error TS1499: Unknown regular expression flag. --regularExpressionWithNonBMPFlags.ts(7,28): error TS1499: Unknown regular expression flag. --regularExpressionWithNonBMPFlags.ts(7,41): error TS1499: Unknown regular expression flag. --regularExpressionWithNonBMPFlags.ts(7,43): error TS1499: Unknown regular expression flag. --regularExpressionWithNonBMPFlags.ts(7,45): error TS1499: Unknown regular expression flag. -- -- --==== regularExpressionWithNonBMPFlags.ts (6 errors) ==== -- // The characters in the following regular expression are ASCII-lookalike characters found in Unicode, including: -- // - 𝘴 (U+1D634 Mathematical Sans-Serif Italic Small S) -- // - 𝘪 (U+1D62A Mathematical Sans-Serif Italic Small I) -- // - 𝘮 (U+1D62E Mathematical Sans-Serif Italic Small M) -- // -- // See https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols -- const 𝘳𝘦𝘨𝘦𝘹 = /(?𝘴𝘪-𝘮:^𝘧𝘰𝘰.)/𝘨𝘮𝘶; +@@= skipped -13, +13 lines =@@ + // + // See https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols + const 𝘳𝘦𝘨𝘦𝘹 = /(?𝘴𝘪-𝘮:^𝘧𝘰𝘰.)/𝘨𝘮𝘶; - ~~ -!!! error TS1499: Unknown regular expression flag. - ~~ @@ -28,6 +15,16 @@ - ~~ -!!! error TS1499: Unknown regular expression flag. - ~~ --!!! error TS1499: Unknown regular expression flag. -- -+ \ No newline at end of file ++ ~ ++!!! error TS1499: Unknown regular expression flag. ++ ~ ++!!! error TS1499: Unknown regular expression flag. ++ ~ ++!!! error TS1499: Unknown regular expression flag. ++ ~ ++!!! error TS1499: Unknown regular expression flag. ++ ~ ++!!! error TS1499: Unknown regular expression flag. ++ ~ + !!! error TS1499: Unknown regular expression flag. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt b/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt index 3540eee22fa..6e8015ba664 100644 --- a/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt @@ -1,32 +1,46 @@ 1.ts(1,7): error TS1199: Unterminated Unicode escape sequence. 10.ts(1,5): error TS1125: Hexadecimal digit expected. 11.ts(1,5): error TS1125: Hexadecimal digit expected. +12.ts(1,5): error TS1125: Hexadecimal digit expected. 13.ts(1,5): error TS1125: Hexadecimal digit expected. 14.ts(1,5): error TS1125: Hexadecimal digit expected. 15.ts(1,5): error TS1125: Hexadecimal digit expected. +16.ts(1,5): error TS1125: Hexadecimal digit expected. +16.ts(1,12): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? 17.ts(1,4): error TS1125: Hexadecimal digit expected. 18.ts(1,4): error TS1125: Hexadecimal digit expected. 19.ts(1,4): error TS1125: Hexadecimal digit expected. 2.ts(1,7): error TS1199: Unterminated Unicode escape sequence. +20.ts(1,4): error TS1125: Hexadecimal digit expected. 21.ts(1,4): error TS1125: Hexadecimal digit expected. 22.ts(1,4): error TS1125: Hexadecimal digit expected. 23.ts(1,4): error TS1125: Hexadecimal digit expected. +24.ts(1,4): error TS1125: Hexadecimal digit expected. 25.ts(1,11): error TS1199: Unterminated Unicode escape sequence. 26.ts(1,11): error TS1199: Unterminated Unicode escape sequence. 27.ts(1,11): error TS1199: Unterminated Unicode escape sequence. +28.ts(1,11): error TS1199: Unterminated Unicode escape sequence. +28.ts(1,12): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? 3.ts(1,7): error TS1199: Unterminated Unicode escape sequence. 37.ts(1,7): error TS1199: Unterminated Unicode escape sequence. 38.ts(1,7): error TS1199: Unterminated Unicode escape sequence. 39.ts(1,7): error TS1199: Unterminated Unicode escape sequence. +4.ts(1,7): error TS1199: Unterminated Unicode escape sequence. +4.ts(1,12): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +40.ts(1,7): error TS1199: Unterminated Unicode escape sequence. +40.ts(1,13): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? 41.ts(1,6): error TS1125: Hexadecimal digit expected. 42.ts(1,6): error TS1125: Hexadecimal digit expected. 43.ts(1,6): error TS1125: Hexadecimal digit expected. +44.ts(1,6): error TS1125: Hexadecimal digit expected. 45.ts(1,5): error TS1125: Hexadecimal digit expected. 46.ts(1,5): error TS1125: Hexadecimal digit expected. 47.ts(1,5): error TS1125: Hexadecimal digit expected. +48.ts(1,5): error TS1125: Hexadecimal digit expected. 5.ts(1,6): error TS1125: Hexadecimal digit expected. 6.ts(1,6): error TS1125: Hexadecimal digit expected. 7.ts(1,6): error TS1125: Hexadecimal digit expected. +8.ts(1,6): error TS1125: Hexadecimal digit expected. 9.ts(1,5): error TS1125: Hexadecimal digit expected. @@ -45,8 +59,12 @@ !!! error TS1199: Unterminated Unicode escape sequence. -==== 4.ts (0 errors) ==== +==== 4.ts (2 errors) ==== /\u{10_ffff}/u + +!!! error TS1199: Unterminated Unicode escape sequence. + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? ==== 5.ts (1 errors) ==== "\uff_ff" @@ -63,8 +81,10 @@ !!! error TS1125: Hexadecimal digit expected. -==== 8.ts (0 errors) ==== +==== 8.ts (1 errors) ==== /\uff_ff/u + +!!! error TS1125: Hexadecimal digit expected. ==== 9.ts (1 errors) ==== "\xf_f" @@ -81,8 +101,10 @@ !!! error TS1125: Hexadecimal digit expected. -==== 12.ts (0 errors) ==== +==== 12.ts (1 errors) ==== /\xf_f/u + +!!! error TS1125: Hexadecimal digit expected. ==== 13.ts (1 errors) ==== "\u{_10ffff}" @@ -99,8 +121,12 @@ !!! error TS1125: Hexadecimal digit expected. -==== 16.ts (0 errors) ==== +==== 16.ts (2 errors) ==== /\u{_10ffff}/u + +!!! error TS1125: Hexadecimal digit expected. + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? ==== 17.ts (1 errors) ==== "\u_ffff" @@ -117,8 +143,10 @@ !!! error TS1125: Hexadecimal digit expected. -==== 20.ts (0 errors) ==== +==== 20.ts (1 errors) ==== /\u_ffff/u + +!!! error TS1125: Hexadecimal digit expected. ==== 21.ts (1 errors) ==== "\x_ff" @@ -135,8 +163,10 @@ !!! error TS1125: Hexadecimal digit expected. -==== 24.ts (0 errors) ==== +==== 24.ts (1 errors) ==== /\x_ff/u + +!!! error TS1125: Hexadecimal digit expected. ==== 25.ts (1 errors) ==== "\u{10ffff_}" @@ -153,8 +183,12 @@ !!! error TS1199: Unterminated Unicode escape sequence. -==== 28.ts (0 errors) ==== +==== 28.ts (2 errors) ==== /\u{10ffff_}/u + +!!! error TS1199: Unterminated Unicode escape sequence. + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? ==== 29.ts (0 errors) ==== "\uffff_" @@ -195,8 +229,12 @@ !!! error TS1199: Unterminated Unicode escape sequence. -==== 40.ts (0 errors) ==== +==== 40.ts (2 errors) ==== /\u{10__ffff}/u + +!!! error TS1199: Unterminated Unicode escape sequence. + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? ==== 41.ts (1 errors) ==== "\uff__ff" @@ -213,8 +251,10 @@ !!! error TS1125: Hexadecimal digit expected. -==== 44.ts (0 errors) ==== +==== 44.ts (1 errors) ==== /\uff__ff/u + +!!! error TS1125: Hexadecimal digit expected. ==== 45.ts (1 errors) ==== "\xf__f" @@ -231,6 +271,8 @@ !!! error TS1125: Hexadecimal digit expected. -==== 48.ts (0 errors) ==== +==== 48.ts (1 errors) ==== /\xf__f/u + +!!! error TS1125: Hexadecimal digit expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt.diff deleted file mode 100644 index 474fe947cef..00000000000 --- a/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt.diff +++ /dev/null @@ -1,175 +0,0 @@ ---- old.parser.numericSeparators.unicodeEscape.errors.txt -+++ new.parser.numericSeparators.unicodeEscape.errors.txt -@@= skipped -0, +0 lines =@@ - 1.ts(1,7): error TS1199: Unterminated Unicode escape sequence. - 10.ts(1,5): error TS1125: Hexadecimal digit expected. - 11.ts(1,5): error TS1125: Hexadecimal digit expected. --12.ts(1,5): error TS1125: Hexadecimal digit expected. - 13.ts(1,5): error TS1125: Hexadecimal digit expected. - 14.ts(1,5): error TS1125: Hexadecimal digit expected. - 15.ts(1,5): error TS1125: Hexadecimal digit expected. --16.ts(1,5): error TS1125: Hexadecimal digit expected. --16.ts(1,12): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? - 17.ts(1,4): error TS1125: Hexadecimal digit expected. - 18.ts(1,4): error TS1125: Hexadecimal digit expected. - 19.ts(1,4): error TS1125: Hexadecimal digit expected. - 2.ts(1,7): error TS1199: Unterminated Unicode escape sequence. --20.ts(1,4): error TS1125: Hexadecimal digit expected. - 21.ts(1,4): error TS1125: Hexadecimal digit expected. - 22.ts(1,4): error TS1125: Hexadecimal digit expected. - 23.ts(1,4): error TS1125: Hexadecimal digit expected. --24.ts(1,4): error TS1125: Hexadecimal digit expected. - 25.ts(1,11): error TS1199: Unterminated Unicode escape sequence. - 26.ts(1,11): error TS1199: Unterminated Unicode escape sequence. - 27.ts(1,11): error TS1199: Unterminated Unicode escape sequence. --28.ts(1,11): error TS1199: Unterminated Unicode escape sequence. --28.ts(1,12): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? - 3.ts(1,7): error TS1199: Unterminated Unicode escape sequence. - 37.ts(1,7): error TS1199: Unterminated Unicode escape sequence. - 38.ts(1,7): error TS1199: Unterminated Unicode escape sequence. - 39.ts(1,7): error TS1199: Unterminated Unicode escape sequence. --4.ts(1,7): error TS1199: Unterminated Unicode escape sequence. --4.ts(1,12): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? --40.ts(1,7): error TS1199: Unterminated Unicode escape sequence. --40.ts(1,13): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? - 41.ts(1,6): error TS1125: Hexadecimal digit expected. - 42.ts(1,6): error TS1125: Hexadecimal digit expected. - 43.ts(1,6): error TS1125: Hexadecimal digit expected. --44.ts(1,6): error TS1125: Hexadecimal digit expected. - 45.ts(1,5): error TS1125: Hexadecimal digit expected. - 46.ts(1,5): error TS1125: Hexadecimal digit expected. - 47.ts(1,5): error TS1125: Hexadecimal digit expected. --48.ts(1,5): error TS1125: Hexadecimal digit expected. - 5.ts(1,6): error TS1125: Hexadecimal digit expected. - 6.ts(1,6): error TS1125: Hexadecimal digit expected. - 7.ts(1,6): error TS1125: Hexadecimal digit expected. --8.ts(1,6): error TS1125: Hexadecimal digit expected. - 9.ts(1,5): error TS1125: Hexadecimal digit expected. - - -@@= skipped -58, +44 lines =@@ - - !!! error TS1199: Unterminated Unicode escape sequence. - --==== 4.ts (2 errors) ==== -+==== 4.ts (0 errors) ==== - /\u{10_ffff}/u -- --!!! error TS1199: Unterminated Unicode escape sequence. -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? - - ==== 5.ts (1 errors) ==== - "\uff_ff" -@@= skipped -22, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. - --==== 8.ts (1 errors) ==== -+==== 8.ts (0 errors) ==== - /\uff_ff/u -- --!!! error TS1125: Hexadecimal digit expected. - - ==== 9.ts (1 errors) ==== - "\xf_f" -@@= skipped -20, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. - --==== 12.ts (1 errors) ==== -+==== 12.ts (0 errors) ==== - /\xf_f/u -- --!!! error TS1125: Hexadecimal digit expected. - - ==== 13.ts (1 errors) ==== - "\u{_10ffff}" -@@= skipped -20, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. - --==== 16.ts (2 errors) ==== -+==== 16.ts (0 errors) ==== - /\u{_10ffff}/u -- --!!! error TS1125: Hexadecimal digit expected. -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? - - ==== 17.ts (1 errors) ==== - "\u_ffff" -@@= skipped -22, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. - --==== 20.ts (1 errors) ==== -+==== 20.ts (0 errors) ==== - /\u_ffff/u -- --!!! error TS1125: Hexadecimal digit expected. - - ==== 21.ts (1 errors) ==== - "\x_ff" -@@= skipped -20, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. - --==== 24.ts (1 errors) ==== -+==== 24.ts (0 errors) ==== - /\x_ff/u -- --!!! error TS1125: Hexadecimal digit expected. - - ==== 25.ts (1 errors) ==== - "\u{10ffff_}" -@@= skipped -20, +18 lines =@@ - - !!! error TS1199: Unterminated Unicode escape sequence. - --==== 28.ts (2 errors) ==== -+==== 28.ts (0 errors) ==== - /\u{10ffff_}/u -- --!!! error TS1199: Unterminated Unicode escape sequence. -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? - - ==== 29.ts (0 errors) ==== - "\uffff_" -@@= skipped -46, +42 lines =@@ - - !!! error TS1199: Unterminated Unicode escape sequence. - --==== 40.ts (2 errors) ==== -+==== 40.ts (0 errors) ==== - /\u{10__ffff}/u -- --!!! error TS1199: Unterminated Unicode escape sequence. -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? - - ==== 41.ts (1 errors) ==== - "\uff__ff" -@@= skipped -22, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. - --==== 44.ts (1 errors) ==== -+==== 44.ts (0 errors) ==== - /\uff__ff/u -- --!!! error TS1125: Hexadecimal digit expected. - - ==== 45.ts (1 errors) ==== - "\xf__f" -@@= skipped -20, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. - --==== 48.ts (1 errors) ==== -+==== 48.ts (0 errors) ==== - /\xf__f/u -- --!!! error TS1125: Hexadecimal digit expected. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parser579071.errors.txt b/testdata/baselines/reference/submodule/conformance/parser579071.errors.txt new file mode 100644 index 00000000000..577810615d8 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parser579071.errors.txt @@ -0,0 +1,7 @@ +parser579071.ts(1,14): error TS1005: ')' expected. + + +==== parser579071.ts (1 errors) ==== + var x = /fo(o/; + +!!! error TS1005: ')' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parser579071.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parser579071.errors.txt.diff deleted file mode 100644 index b5039f71917..00000000000 --- a/testdata/baselines/reference/submodule/conformance/parser579071.errors.txt.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.parser579071.errors.txt -+++ new.parser579071.errors.txt -@@= skipped -0, +0 lines =@@ --parser579071.ts(1,14): error TS1005: ')' expected. -- -- --==== parser579071.ts (1 errors) ==== -- var x = /fo(o/; -- --!!! error TS1005: ')' expected. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRegularExpressionDivideAmbiguity3.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRegularExpressionDivideAmbiguity3.errors.txt index 1c021a9ba8d..8c8babab6a1 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRegularExpressionDivideAmbiguity3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRegularExpressionDivideAmbiguity3.errors.txt @@ -1,7 +1,10 @@ +parserRegularExpressionDivideAmbiguity3.ts(1,16): error TS1499: Unknown regular expression flag. parserRegularExpressionDivideAmbiguity3.ts(1,18): error TS2339: Property 'foo' does not exist on type 'RegExp'. -==== parserRegularExpressionDivideAmbiguity3.ts (1 errors) ==== +==== parserRegularExpressionDivideAmbiguity3.ts (2 errors) ==== if (1) /regexp/a.foo(); + ~ +!!! error TS1499: Unknown regular expression flag. ~~~ !!! error TS2339: Property 'foo' does not exist on type 'RegExp'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRegularExpressionDivideAmbiguity3.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRegularExpressionDivideAmbiguity3.errors.txt.diff deleted file mode 100644 index 8834a567f08..00000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRegularExpressionDivideAmbiguity3.errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.parserRegularExpressionDivideAmbiguity3.errors.txt -+++ new.parserRegularExpressionDivideAmbiguity3.errors.txt -@@= skipped -0, +0 lines =@@ --parserRegularExpressionDivideAmbiguity3.ts(1,16): error TS1499: Unknown regular expression flag. - parserRegularExpressionDivideAmbiguity3.ts(1,18): error TS2339: Property 'foo' does not exist on type 'RegExp'. - - --==== parserRegularExpressionDivideAmbiguity3.ts (2 errors) ==== -+==== parserRegularExpressionDivideAmbiguity3.ts (1 errors) ==== - if (1) /regexp/a.foo(); -- ~ --!!! error TS1499: Unknown regular expression flag. - ~~~ - !!! error TS2339: Property 'foo' does not exist on type 'RegExp'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt new file mode 100644 index 00000000000..51228e4c875 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt @@ -0,0 +1,10 @@ +unicodeExtendedEscapesInRegularExpressions07.ts(3,13): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + + +==== unicodeExtendedEscapesInRegularExpressions07.ts (1 errors) ==== + // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) + // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. + var x = /\u{110000}/gu; + ~~~~~~ +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt.diff deleted file mode 100644 index 095c977c6bb..00000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt -@@= skipped -0, +0 lines =@@ --unicodeExtendedEscapesInRegularExpressions07.ts(3,13): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. -- -- --==== unicodeExtendedEscapesInRegularExpressions07.ts (1 errors) ==== -- // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) -- // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. -- var x = /\u{110000}/gu; -- ~~~~~~ --!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt new file mode 100644 index 00000000000..71bc964c777 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt @@ -0,0 +1,8 @@ +unicodeExtendedEscapesInRegularExpressions12.ts(1,13): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + + +==== unicodeExtendedEscapesInRegularExpressions12.ts (1 errors) ==== + var x = /\u{FFFFFFFF}/gu; + ~~~~~~~~ +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt.diff deleted file mode 100644 index 3ce7eaec315..00000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt -@@= skipped -0, +0 lines =@@ --unicodeExtendedEscapesInRegularExpressions12.ts(1,13): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. -- -- --==== unicodeExtendedEscapesInRegularExpressions12.ts (1 errors) ==== -- var x = /\u{FFFFFFFF}/gu; -- ~~~~~~~~ --!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt new file mode 100644 index 00000000000..2f7010fdb3d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt @@ -0,0 +1,12 @@ +unicodeExtendedEscapesInRegularExpressions14.ts(2,13): error TS1125: Hexadecimal digit expected. +unicodeExtendedEscapesInRegularExpressions14.ts(2,18): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + + +==== unicodeExtendedEscapesInRegularExpressions14.ts (2 errors) ==== + // Shouldn't work, negatives are not allowed. + var x = /\u{-DDDD}/gu; + +!!! error TS1125: Hexadecimal digit expected. + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt.diff deleted file mode 100644 index 0dfb17a99f9..00000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt -@@= skipped -0, +0 lines =@@ --unicodeExtendedEscapesInRegularExpressions14.ts(2,13): error TS1125: Hexadecimal digit expected. --unicodeExtendedEscapesInRegularExpressions14.ts(2,18): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- -- --==== unicodeExtendedEscapesInRegularExpressions14.ts (2 errors) ==== -- // Shouldn't work, negatives are not allowed. -- var x = /\u{-DDDD}/gu; -- --!!! error TS1125: Hexadecimal digit expected. -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt new file mode 100644 index 00000000000..25e6af14987 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt @@ -0,0 +1,23 @@ +unicodeExtendedEscapesInRegularExpressions17.ts(1,13): error TS1125: Hexadecimal digit expected. +unicodeExtendedEscapesInRegularExpressions17.ts(1,14): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +unicodeExtendedEscapesInRegularExpressions17.ts(1,18): error TS1125: Hexadecimal digit expected. +unicodeExtendedEscapesInRegularExpressions17.ts(1,19): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +unicodeExtendedEscapesInRegularExpressions17.ts(1,23): error TS1125: Hexadecimal digit expected. +unicodeExtendedEscapesInRegularExpressions17.ts(1,24): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + + +==== unicodeExtendedEscapesInRegularExpressions17.ts (6 errors) ==== + var x = /\u{r}\u{n}\u{t}/gu; + +!!! error TS1125: Hexadecimal digit expected. + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + +!!! error TS1125: Hexadecimal digit expected. + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + +!!! error TS1125: Hexadecimal digit expected. + ~ +!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt.diff deleted file mode 100644 index 87176ce8574..00000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt -@@= skipped -0, +0 lines =@@ --unicodeExtendedEscapesInRegularExpressions17.ts(1,13): error TS1125: Hexadecimal digit expected. --unicodeExtendedEscapesInRegularExpressions17.ts(1,14): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? --unicodeExtendedEscapesInRegularExpressions17.ts(1,18): error TS1125: Hexadecimal digit expected. --unicodeExtendedEscapesInRegularExpressions17.ts(1,19): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? --unicodeExtendedEscapesInRegularExpressions17.ts(1,23): error TS1125: Hexadecimal digit expected. --unicodeExtendedEscapesInRegularExpressions17.ts(1,24): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- -- --==== unicodeExtendedEscapesInRegularExpressions17.ts (6 errors) ==== -- var x = /\u{r}\u{n}\u{t}/gu; -- --!!! error TS1125: Hexadecimal digit expected. -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- --!!! error TS1125: Hexadecimal digit expected. -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- --!!! error TS1125: Hexadecimal digit expected. -- ~ --!!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es6).errors.txt new file mode 100644 index 00000000000..dadcab40d98 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es6).errors.txt @@ -0,0 +1,8 @@ +unicodeExtendedEscapesInRegularExpressions19.ts(1,13): error TS1125: Hexadecimal digit expected. + + +==== unicodeExtendedEscapesInRegularExpressions19.ts (1 errors) ==== + var x = /\u{}/gu; + +!!! error TS1125: Hexadecimal digit expected. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es6).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es6).errors.txt.diff deleted file mode 100644 index 347886dd631..00000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es6).errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions19(target=es6).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions19(target=es6).errors.txt -@@= skipped -0, +0 lines =@@ --unicodeExtendedEscapesInRegularExpressions19.ts(1,13): error TS1125: Hexadecimal digit expected. -- -- --==== unicodeExtendedEscapesInRegularExpressions19.ts (1 errors) ==== -- var x = /\u{}/gu; -- --!!! error TS1125: Hexadecimal digit expected. -- -+ \ No newline at end of file diff --git a/testdata/submoduleAccepted.txt b/testdata/submoduleAccepted.txt index c0d0157bdf7..ba9fbbeb06f 100644 --- a/testdata/submoduleAccepted.txt +++ b/testdata/submoduleAccepted.txt @@ -57,3 +57,6 @@ fourslash/inlayHints/inlayHintsInteractiveVariableTypes1.baseline.diff fourslash/inlayHints/inlayHintsInteractiveVariableTypes2.baseline.diff fourslash/inlayHints/inlayHintsVariableTypes3.baseline.diff fourslash/inlayHints/inlayHintsInteractiveFunctionParameterTypes1.baseline.diff + +## regex checking ## + diff --git a/testdata/tests/cases/compiler/regularExpressionQuantifierBounds1.ts b/testdata/tests/cases/compiler/regularExpressionQuantifierBounds1.ts new file mode 100644 index 00000000000..84792247ee9 --- /dev/null +++ b/testdata/tests/cases/compiler/regularExpressionQuantifierBounds1.ts @@ -0,0 +1,11 @@ +// @strict: true +// @target: esnext + +const regexes: RegExp[] = [ + /a{7,8}/, + /a{9223372036854775807,9223372036854775808}/, + /a{8,7}/, + /a{9223372036854775808,9223372036854775807}/, + /a{8,8}/, + /a{9223372036854775808,9223372036854775808}/, +];