diff --git a/internal/checker/grammarchecks.go b/internal/checker/grammarchecks.go index ff30650d5d..f4b7d50468 100644 --- a/internal/checker/grammarchecks.go +++ b/internal/checker/grammarchecks.go @@ -11,6 +11,7 @@ import ( "github.com/microsoft/typescript-go/internal/debug" "github.com/microsoft/typescript-go/internal/diagnostics" "github.com/microsoft/typescript-go/internal/jsnum" + "github.com/microsoft/typescript-go/internal/regexpchecker" "github.com/microsoft/typescript-go/internal/scanner" "github.com/microsoft/typescript-go/internal/tspath" ) @@ -54,43 +55,30 @@ 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) && node.TokenFlags&ast.TokenFlagsUnterminated == 0 { + var lastError *ast.Diagnostic + + nodeStart := scanner.GetTokenPosOfNode(node.AsNode(), sourceFile, false) + onError := func(message *diagnostics.Message, start int, length int, args ...any) { + start += nodeStart + + if message.Category() == diagnostics.CategoryMessage && lastError != nil && + start == lastError.Pos() && length == lastError.Len() { + 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) + } + } + + regexpchecker.Check(node, sourceFile, c.languageVersion, onError) + + 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/collections/set.go b/internal/collections/set.go index 6dfd3c90d6..bc284cbc90 100644 --- a/internal/collections/set.go +++ b/internal/collections/set.go @@ -1,6 +1,9 @@ package collections -import "maps" +import ( + "maps" + "slices" +) type Set[T comparable] struct { M map[T]struct{} @@ -37,6 +40,10 @@ func (s *Set[T]) Keys() map[T]struct{} { return s.M } +func (s *Set[T]) KeysSlice() []T { + return slices.AppendSeq(make([]T, 0, len(s.M)), maps.Keys(s.M)) +} + func (s *Set[T]) Clear() { clear(s.M) } @@ -69,7 +76,7 @@ func (s *Set[T]) Equals(other *Set[T]) bool { } func NewSetFromItems[T comparable](items ...T) *Set[T] { - s := &Set[T]{} + s := NewSetWithSizeHint[T](len(items)) for _, item := range items { s.Add(item) } diff --git a/internal/regexpchecker/regexpchecker.go b/internal/regexpchecker/regexpchecker.go new file mode 100644 index 0000000000..244b5a1ebd --- /dev/null +++ b/internal/regexpchecker/regexpchecker.go @@ -0,0 +1,1351 @@ +package regexpchecker + +import ( + "fmt" + "maps" + "slices" + "strings" + "unicode/utf8" + + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/diagnostics" + "github.com/microsoft/typescript-go/internal/scanner" + "github.com/microsoft/typescript-go/internal/stringutil" +) + +// regExpFlags represents regexp flags (e.g., 'g', 'i', 'm', etc.) +type regExpFlags uint32 + +const ( + regExpFlagsNone regExpFlags = 0 + regExpFlagsGlobal regExpFlags = 1 << 0 // g + regExpFlagsIgnoreCase regExpFlags = 1 << 1 // i + regExpFlagsMultiline regExpFlags = 1 << 2 // m + regExpFlagsDotAll regExpFlags = 1 << 3 // s + regExpFlagsUnicode regExpFlags = 1 << 4 // u + regExpFlagsSticky regExpFlags = 1 << 5 // y + regExpFlagsHasIndices regExpFlags = 1 << 6 // d + regExpFlagsUnicodeSets regExpFlags = 1 << 7 // v + regExpFlagsModifiers regExpFlags = regExpFlagsIgnoreCase | regExpFlagsMultiline | regExpFlagsDotAll + regExpFlagsAnyUnicodeMode regExpFlags = regExpFlagsUnicode | regExpFlagsUnicodeSets +) + +var charCodeToRegExpFlag = map[rune]regExpFlags{ + 'd': regExpFlagsHasIndices, + 'g': regExpFlagsGlobal, + 'i': regExpFlagsIgnoreCase, + 'm': regExpFlagsMultiline, + 's': regExpFlagsDotAll, + 'u': regExpFlagsUnicode, + 'v': regExpFlagsUnicodeSets, + 'y': regExpFlagsSticky, +} + +// regExpValidator is used to validate regular expressions +type regExpValidator struct { + text string + pos int + end int + languageVersion core.ScriptTarget + languageVariant core.LanguageVariant + onError scanner.ErrorCallback + regExpFlags regExpFlags + annexB bool + unicodeSetsMode bool + anyUnicodeMode bool + anyUnicodeModeOrNonAnnexB bool + namedCaptureGroups bool + numberOfCapturingGroups int + groupSpecifiers map[string]bool + groupNameReferences []namedReference + decimalEscapes []decimalEscape + namedCapturingGroupsScopeStack []map[string]bool + topNamedCapturingGroupsScope map[string]bool + mayContainStrings bool + isCharacterComplement bool + tokenValue string + surrogateState *surrogatePairState // For non-Unicode mode: tracks partial surrogate pair +} + +// surrogatePairState tracks when we're in the middle of emitting a surrogate pair +// in non-Unicode mode (where literal characters >= U+10000 must be split into two UTF-16 code units) +type surrogatePairState struct { + lowSurrogate rune // The low surrogate value to return next + utf8Size int // Size of the UTF-8 character to advance past +} + +type namedReference struct { + pos int + end int + name string +} + +type decimalEscape struct { + pos int + end int + value int +} + +func Check( + node *ast.RegularExpressionLiteral, + sourceFile *ast.SourceFile, + languageVersion core.ScriptTarget, + onError scanner.ErrorCallback, +) { + text := node.Text + v := ®ExpValidator{ + text: text, + languageVersion: languageVersion, + languageVariant: sourceFile.LanguageVariant, + onError: onError, + } + + // Similar to the original scanRegularExpressionWorker, but since we are outside the scanner, + // we need to rescan for some information that the scanner previously calculated. + + bodyEnd := strings.LastIndexByte(text, '/') + if bodyEnd <= 0 { + panic("regexpchecker: regex must have closing '/' (scanner should have validated)") + } + + v.pos = bodyEnd + 1 + v.end = len(text) + v.regExpFlags = v.scanFlags(regExpFlagsNone, false) + v.pos = 1 + v.end = bodyEnd + + v.unicodeSetsMode = v.regExpFlags®ExpFlagsUnicodeSets != 0 + v.anyUnicodeMode = v.regExpFlags®ExpFlagsAnyUnicodeMode != 0 + v.annexB = true + v.anyUnicodeModeOrNonAnnexB = v.anyUnicodeMode || !v.annexB + v.namedCaptureGroups = v.detectNamedCaptureGroups() + + v.scanDisjunction(false) + v.validateGroupReferences() + v.validateDecimalEscapes() +} + +// detectNamedCaptureGroups performs a quick scan of the pattern to detect +// if it contains any named capture groups (?...). This is needed because +// the presence of named groups changes the interpretation of \k escapes: +// - Without named groups: \k is an identity escape (matches literal 'k') +// - With named groups: \k must be followed by or it's a syntax error +// This matches the behavior in scanner.ts's reScanSlashToken. +func (v *regExpValidator) detectNamedCaptureGroups() bool { + inEscape := false + inCharacterClass := false + text := v.text[v.pos:v.end] + + for i, ch := range text { + // Only check ASCII characters for the pattern (?< + if ch >= 0x80 { + continue + } + + if inEscape { + inEscape = false + } else if ch == '\\' { + inEscape = true + } else if ch == '[' { + inCharacterClass = true + } else if ch == ']' { + inCharacterClass = false + } else if !inCharacterClass && + ch == '(' && + i+3 < len(text) && + text[i+1] == '?' && + text[i+2] == '<' && + text[i+3] != '=' && + text[i+3] != '!' { + // Found (?< that's not (?<= or (?= v.end { + return 0, 0 + } + // Simple ASCII fast path + if ch := v.text[v.pos]; ch < 0x80 { + return rune(ch), 1 + } + // Decode multi-byte UTF-8 character + r, size := utf8.DecodeRuneInString(v.text[v.pos:]) + return r, size +} + +func (v *regExpValidator) charAtOffset(offset int) rune { + if v.pos+offset >= v.end { + return 0 + } + // Simple ASCII fast path + if ch := v.text[v.pos+offset]; ch < 0x80 { + return rune(ch) + } + // Decode multi-byte UTF-8 character + r, _ := utf8.DecodeRuneInString(v.text[v.pos+offset:]) + return r +} + +func (v *regExpValidator) error(message *diagnostics.Message, start, length int, args ...any) { + v.onError(message, start, length, args...) +} + +func (v *regExpValidator) checkRegularExpressionFlagAvailability(flag regExpFlags, size int) { + var availableFrom core.ScriptTarget + switch flag { + case regExpFlagsHasIndices: + availableFrom = core.ScriptTargetES2022 + case regExpFlagsDotAll: + availableFrom = core.ScriptTargetES2018 + case regExpFlagsUnicodeSets: + availableFrom = core.ScriptTargetES2024 + default: + return + } + + if v.languageVersion < availableFrom { + // !!! Old compiler lowercases these names. + v.error(diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, v.pos, size, strings.ToLower(availableFrom.String())) + } +} + +func (v *regExpValidator) scanDisjunction(isInGroup bool) { + for { + v.namedCapturingGroupsScopeStack = append(v.namedCapturingGroupsScopeStack, v.topNamedCapturingGroupsScope) + v.topNamedCapturingGroupsScope = nil + v.scanAlternative(isInGroup) + v.topNamedCapturingGroupsScope = v.namedCapturingGroupsScopeStack[len(v.namedCapturingGroupsScopeStack)-1] + v.namedCapturingGroupsScopeStack = v.namedCapturingGroupsScopeStack[:len(v.namedCapturingGroupsScopeStack)-1] + + if v.charAtOffset(0) != '|' { + return + } + v.pos++ + } +} + +func (v *regExpValidator) scanAlternative(isInGroup bool) { + isPreviousTermQuantifiable := false + for { + start := v.pos + ch := v.charAtOffset(0) + switch ch { + case 0: + return + case '^', '$': + v.pos++ + isPreviousTermQuantifiable = false + case '\\': + v.pos++ + switch v.charAtOffset(0) { + case 'b', 'B': + v.pos++ + isPreviousTermQuantifiable = false + default: + v.scanAtomEscape() + isPreviousTermQuantifiable = true + } + case '(': + v.pos++ + if v.charAtOffset(0) == '?' { + v.pos++ + switch v.charAtOffset(0) { + case '=', '!': + v.pos++ + isPreviousTermQuantifiable = !v.anyUnicodeModeOrNonAnnexB + case '<': + groupNameStart := v.pos + v.pos++ + switch v.charAtOffset(0) { + case '=', '!': + v.pos++ + isPreviousTermQuantifiable = false + default: + v.scanGroupName(false) + v.scanExpectedChar('>') + if v.languageVersion < core.ScriptTargetES2018 { + v.error(diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, v.pos-groupNameStart) + } + v.numberOfCapturingGroups++ + isPreviousTermQuantifiable = true + } + default: + start := v.pos + setFlags := v.scanPatternModifiers(regExpFlagsNone) + if v.charAtOffset(0) == '-' { + v.pos++ + v.scanPatternModifiers(setFlags) + if v.pos == start+1 { + v.error(diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start, v.pos-start) + } + } + v.scanExpectedChar(':') + isPreviousTermQuantifiable = true + } + } else { + v.numberOfCapturingGroups++ + isPreviousTermQuantifiable = true + } + v.scanDisjunction(true) + v.scanExpectedChar(')') + case '{': + v.pos++ + digitsStart := v.pos + v.scanDigits() + minVal := v.tokenValue + if !v.anyUnicodeModeOrNonAnnexB && minVal == "" { + isPreviousTermQuantifiable = true + break + } + if v.charAtOffset(0) == ',' { + v.pos++ + v.scanDigits() + maxVal := v.tokenValue + if minVal == "" { + if maxVal != "" || v.charAtOffset(0) == '}' { + v.error(diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0) + } else { + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start, 1, string(ch)) + isPreviousTermQuantifiable = true + break + } + } else if maxVal != "" { + minInt := 0 + maxInt := 0 + for _, c := range minVal { + minInt = minInt*10 + int(c-'0') + } + for _, c := range maxVal { + maxInt = maxInt*10 + int(c-'0') + } + if minInt > maxInt && (v.anyUnicodeModeOrNonAnnexB || v.charAtOffset(0) == '}') { + v.error(diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, v.pos-digitsStart) + } + } + } else if minVal == "" { + if v.anyUnicodeModeOrNonAnnexB { + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start, 1, string(ch)) + } + isPreviousTermQuantifiable = true + break + } + if v.charAtOffset(0) != '}' { + if v.anyUnicodeModeOrNonAnnexB { + v.error(diagnostics.X_0_expected, v.pos, 0, "}") + v.pos-- + } else { + isPreviousTermQuantifiable = true + break + } + } + fallthrough + case '*', '+', '?': + v.pos++ + if v.charAtOffset(0) == '?' { + v.pos++ + } + if !isPreviousTermQuantifiable { + v.error(diagnostics.There_is_nothing_available_for_repetition, start, v.pos-start) + } + isPreviousTermQuantifiable = false + case '.': + v.pos++ + isPreviousTermQuantifiable = true + case '[': + v.pos++ + if v.unicodeSetsMode { + v.scanClassSetExpression() + } else { + v.scanClassRanges() + } + v.scanExpectedChar(']') + isPreviousTermQuantifiable = true + case ')': + if isInGroup { + return + } + fallthrough + case ']', '}': + if v.anyUnicodeModeOrNonAnnexB || ch == ')' { + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, v.pos, 1, string(ch)) + } + v.pos++ + isPreviousTermQuantifiable = true + case '/', '|': + return + default: + v.scanSourceCharacter() + isPreviousTermQuantifiable = true + } + } +} + +func (v *regExpValidator) validateGroupReferences() { + for _, ref := range v.groupNameReferences { + if !v.groupSpecifiers[ref.name] { + v.error(diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, ref.pos, ref.end-ref.pos, ref.name) + // Provide spelling suggestions + if len(v.groupSpecifiers) > 0 { + // Convert map keys to slice + candidates := make([]string, 0, len(v.groupSpecifiers)) + for name := range v.groupSpecifiers { + candidates = append(candidates, name) + } + suggestion := core.GetSpellingSuggestion(ref.name, candidates, core.Identity[string]) + if suggestion != "" { + v.error(diagnostics.Did_you_mean_0, ref.pos, ref.end-ref.pos, suggestion) + } + } + } + } +} + +func (v *regExpValidator) validateDecimalEscapes() { + for _, escape := range v.decimalEscapes { + if escape.value > v.numberOfCapturingGroups { + if v.numberOfCapturingGroups > 0 { + v.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, v.numberOfCapturingGroups) + } else { + v.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) + } + } + } +} + +func (v *regExpValidator) scanDigits() { + start := v.pos + for v.pos < v.end && stringutil.IsDigit(v.charAtOffset(0)) { + v.pos++ + } + v.tokenValue = v.text[start:v.pos] +} + +func (v *regExpValidator) scanExpectedChar(expected rune) { + if v.charAtOffset(0) == expected { + v.pos++ + } else { + v.error(diagnostics.X_0_expected, v.pos, 0, string(expected)) + } +} + +// scanFlags scans regexp flags and validates them. +// If checkModifiers is true, only allows modifier flags (i, m, s). +func (v *regExpValidator) scanFlags(currFlags regExpFlags, checkModifiers bool) regExpFlags { + for { + ch, size := v.charAndSize() + if ch == 0 || !scanner.IsIdentifierPart(ch) { + break + } + flag, ok := charCodeToRegExpFlag[ch] + if !ok { + v.error(diagnostics.Unknown_regular_expression_flag, v.pos, size) + } else if currFlags&flag != 0 { + v.error(diagnostics.Duplicate_regular_expression_flag, v.pos, size) + } else if (currFlags|flag)®ExpFlagsAnyUnicodeMode == regExpFlagsAnyUnicodeMode { + v.error(diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, v.pos, size) + } else if checkModifiers && flag®ExpFlagsModifiers == 0 { + v.error(diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, v.pos, size) + } else { + currFlags |= flag + v.checkRegularExpressionFlagAvailability(flag, size) + } + v.pos += size + } + return currFlags +} + +func (v *regExpValidator) scanPatternModifiers(currFlags regExpFlags) regExpFlags { + return v.scanFlags(currFlags, true) +} + +func (v *regExpValidator) scanAtomEscape() { + switch v.charAtOffset(0) { + case 'k': + v.pos++ + if v.charAtOffset(0) == '<' { + v.pos++ + v.scanGroupName(true) + v.scanExpectedChar('>') + } else if v.anyUnicodeModeOrNonAnnexB || v.namedCaptureGroups { + v.error(diagnostics.X_k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, v.pos-2, 2) + } + case 'q': + if v.unicodeSetsMode { + v.pos++ + v.error(diagnostics.X_q_is_only_available_inside_character_class, v.pos-2, 2) + break + } + fallthrough + default: + if !v.scanCharacterClassEscape() && !v.scanDecimalEscape() { + v.scanCharacterEscape(true) + } + } +} + +func (v *regExpValidator) scanDecimalEscape() bool { + ch := v.charAtOffset(0) + if ch >= '1' && ch <= '9' { + start := v.pos + v.scanDigits() + value := 0 + for _, c := range v.tokenValue { + value = value*10 + int(c-'0') + } + v.decimalEscapes = append(v.decimalEscapes, decimalEscape{pos: start, end: v.pos, value: value}) + return true + } + return false +} + +func (v *regExpValidator) scanCharacterClassEscape() bool { + ch := v.charAtOffset(0) + isCharacterComplement := false + switch ch { + case 'd', 'D', 's', 'S', 'w', 'W': + v.pos++ + return true + case 'P': + isCharacterComplement = true + fallthrough + case 'p': + v.pos++ + if v.charAtOffset(0) == '{' { + v.pos++ + v.scanUnicodePropertyValueExpression(isCharacterComplement) + } else { + if v.anyUnicodeModeOrNonAnnexB { + v.error(diagnostics.X_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, v.pos-2, 2, string(ch)) + } else { + v.pos-- + } + } + return true + } + return false +} + +func (v *regExpValidator) scanUnicodePropertyValueExpression(isCharacterComplement bool) { + // start is at the first character after '{', so start-3 points to '\' before 'p' or 'P' + start := v.pos - 3 + + propertyNameOrValueStart := v.pos + v.scanIdentifier(v.charAtOffset(0)) + propertyNameOrValue := v.tokenValue + + if v.charAtOffset(0) == '=' { + // property=value syntax + propertyNameValid := true + if v.pos == propertyNameOrValueStart { + v.error(diagnostics.Expected_a_Unicode_property_name, propertyNameOrValueStart, 0) + propertyNameValid = false + } else if !isValidNonBinaryUnicodePropertyName(propertyNameOrValue) { + v.error(diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, v.pos-propertyNameOrValueStart) + // Provide spelling suggestion + candidates := make([]string, 0, len(nonBinaryUnicodePropertyNames)) + for key := range nonBinaryUnicodePropertyNames { + candidates = append(candidates, key) + } + suggestion := core.GetSpellingSuggestion(propertyNameOrValue, candidates, core.Identity[string]) + if suggestion != "" { + v.error(diagnostics.Did_you_mean_0, propertyNameOrValueStart, v.pos-propertyNameOrValueStart, suggestion) + } + propertyNameValid = false + } + v.pos++ + propertyValueStart := v.pos + v.scanIdentifier(v.charAtOffset(0)) + propertyValue := v.tokenValue + if v.pos == propertyValueStart { + v.error(diagnostics.Expected_a_Unicode_property_value, propertyValueStart, 0) + } else if propertyNameValid && !isValidUnicodeProperty(propertyNameOrValue, propertyValue) { + v.error(diagnostics.Unknown_Unicode_property_value, propertyValueStart, v.pos-propertyValueStart) + // Provide spelling suggestion based on the property name + canonicalName := nonBinaryUnicodePropertyNames[propertyNameOrValue] + var candidates []string + if canonicalName == "General_Category" { + candidates = generalCategoryValues.KeysSlice() + } else if canonicalName == "Script" || canonicalName == "Script_Extensions" { + candidates = scriptValues.KeysSlice() + } + if len(candidates) > 0 { + suggestion := core.GetSpellingSuggestion(propertyValue, candidates, core.Identity[string]) + if suggestion != "" { + v.error(diagnostics.Did_you_mean_0, propertyValueStart, v.pos-propertyValueStart, suggestion) + } + } + } + } else { + // property name alone + if v.pos == propertyNameOrValueStart { + v.error(diagnostics.Expected_a_Unicode_property_name_or_value, propertyNameOrValueStart, 0) + } else if binaryUnicodePropertiesOfStrings.Has(propertyNameOrValue) { + // Properties that match more than one character (strings) + if !v.unicodeSetsMode { + v.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, v.pos-propertyNameOrValueStart) + } else if isCharacterComplement { + v.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, v.pos-propertyNameOrValueStart) + } else { + v.mayContainStrings = true + } + } else if !isValidUnicodePropertyName(propertyNameOrValue) { + v.error(diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, v.pos-propertyNameOrValueStart) + // Provide spelling suggestion from general category values, binary properties, and binary properties of strings + candidates := make([]string, 0, generalCategoryValues.Len()+binaryUnicodeProperties.Len()+binaryUnicodePropertiesOfStrings.Len()) + candidates = slices.AppendSeq(candidates, maps.Keys(generalCategoryValues.M)) + candidates = slices.AppendSeq(candidates, maps.Keys(binaryUnicodeProperties.M)) + candidates = slices.AppendSeq(candidates, maps.Keys(binaryUnicodePropertiesOfStrings.M)) + suggestion := core.GetSpellingSuggestion(propertyNameOrValue, candidates, core.Identity) + if suggestion != "" { + v.error(diagnostics.Did_you_mean_0, propertyNameOrValueStart, v.pos-propertyNameOrValueStart, suggestion) + } + } + } + + // Scan the expected closing brace + v.scanExpectedChar('}') + + // Report the "only available when unicode mode" error AFTER validation + if !v.anyUnicodeMode { + v.error(diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start, v.pos-start) + } +} + +func (v *regExpValidator) scanIdentifier(ch rune) { + start := v.pos + if ch != 0 && (scanner.IsIdentifierStart(ch) || ch == '_' || ch == '$') { + v.pos++ + for v.pos < v.end { + ch = v.charAtOffset(0) + if scanner.IsIdentifierPart(ch) || ch == '_' || ch == '$' { + v.pos++ + } else { + break + } + } + } + v.tokenValue = v.text[start:v.pos] +} + +func (v *regExpValidator) scanCharacterEscape(atomEscape bool) string { + ch := v.charAtOffset(0) + switch ch { + case 0: + v.error(diagnostics.Undetermined_character_escape, v.pos-1, 1) + return "\\" + case 'c': + v.pos++ + ch = v.charAtOffset(0) + if stringutil.IsASCIILetter(ch) { + v.pos++ + return string(ch & 0x1f) + } + if v.anyUnicodeModeOrNonAnnexB { + v.error(diagnostics.X_c_must_be_followed_by_an_ASCII_letter, v.pos-2, 2) + } else if atomEscape { + v.pos-- + return "\\" + } + return string(ch) + case '^', '$', '/', '\\', '.', '*', '+', '?', '(', ')', '[', ']', '{', '}', '|': + v.pos++ + return string(ch) + default: + return v.scanEscapeSequence(atomEscape) + } +} + +func (v *regExpValidator) scanEscapeSequence(atomEscape bool) string { + // start points to the backslash (before the escape character) + start := v.pos - 1 + ch := v.charAtOffset(0) + if ch == 0 { + v.error(diagnostics.Unexpected_end_of_text, start, 1) + return "" + } + v.pos++ + + switch ch { + case '0': + // '\0' - null character, but check if followed by digit + if v.pos >= v.end || !stringutil.IsDigit(v.charAtOffset(0)) { + return "\x00" + } + // This is an octal escape starting with \0 + // falls through to handle as octal + if stringutil.IsOctalDigit(v.charAtOffset(0)) { + v.pos++ + } + fallthrough + + case '1', '2', '3': + // Can be up to 3 octal digits + if v.pos < v.end && stringutil.IsOctalDigit(v.charAtOffset(0)) { + v.pos++ + } + fallthrough + + case '4', '5', '6', '7': + // Can be 1 or 2 octal digits (already consumed one above for 1-3) + if v.pos < v.end && stringutil.IsOctalDigit(v.charAtOffset(0)) { + v.pos++ + } + // Always report errors for octal escapes in regexp mode + code := 0 + for i := start + 1; i < v.pos; i++ { + code = code*8 + int(v.text[i]-'0') + } + hexCode := fmt.Sprintf("\\x%02x", code) + if !atomEscape && ch != '0' { + v.error(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, v.pos-start, hexCode) + } else { + v.error(diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start, v.pos-start, hexCode) + } + return string(ch) + + case '8', '9': + // Invalid decimal escapes - always report in regexp mode + if !atomEscape { + v.error(diagnostics.Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class, start, v.pos-start) + } else { + v.error(diagnostics.Escape_sequence_0_is_not_allowed, start, v.pos-start, v.text[start:v.pos]) + } + return string(ch) + + case 'b': + return "\b" + case 't': + return "\t" + case 'n': + return "\n" + case 'v': + return "\v" + case 'f': + return "\f" + case 'r': + return "\r" + + case 'x': + // Hex escape '\xDD' + hexStart := v.pos + validHex := true + for range 2 { + if v.pos >= v.end || !stringutil.IsHexDigit(v.charAtOffset(0)) { + validHex = false + break + } + v.pos++ + } + if !validHex { + v.error(diagnostics.Hexadecimal_digit_expected, hexStart, v.pos-hexStart) + return v.text[start:v.pos] + } + code := parseHexValue(v.text, hexStart, v.pos) + return string(rune(code)) + + case 'u': + // Unicode escape '\uDDDD' or '\u{DDDDDD}' + if v.charAtOffset(0) == '{' { + // Extended unicode escape \u{DDDDDD} + v.pos++ + hexStart := v.pos + hasDigits := false + for v.pos < v.end && stringutil.IsHexDigit(v.charAtOffset(0)) { + hasDigits = true + v.pos++ + } + if !hasDigits { + v.error(diagnostics.Hexadecimal_digit_expected, hexStart, 0) + return v.text[start:v.pos] + } + if v.charAtOffset(0) == '}' { + v.pos++ + } else if hasDigits { + v.error(diagnostics.Unterminated_Unicode_escape_sequence, start, v.pos-start) + return v.text[start:v.pos] + } + // Parse hex value (-1 to skip closing brace) + code := parseHexValue(v.text, hexStart, v.pos-1) + // Validate the code point is within valid Unicode range + if code > 0x10FFFF { + v.error(diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, hexStart, v.pos-1-hexStart) + } + if !v.anyUnicodeMode { + v.error(diagnostics.Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start, v.pos-start) + } + return string(rune(code)) + } else { + // Standard unicode escape '\uDDDD' + hexStart := v.pos + validHex := true + for range 4 { + if v.pos >= v.end || !stringutil.IsHexDigit(v.charAtOffset(0)) { + validHex = false + break + } + v.pos++ + } + if !validHex { + v.error(diagnostics.Hexadecimal_digit_expected, hexStart, v.pos-hexStart) + return v.text[start:v.pos] + } + code := parseHexValue(v.text, hexStart, v.pos) + // For surrogates, we need to preserve the actual value since string(rune(surrogate)) + // converts to 0xFFFD. We encode the surrogate as UTF-16BE bytes. + var escapedValueString string + if isSurrogate(rune(code)) { + // Surrogate - encode as 2-byte sequence (UTF-16BE) + escapedValueString = encodeSurrogate(rune(code)) + } else { + escapedValueString = string(rune(code)) + } + // In Unicode mode, check for surrogate pairs + if v.anyUnicodeMode && isHighSurrogate(rune(code)) && + v.pos+6 <= v.end && v.text[v.pos:v.pos+2] == "\\u" { + // High surrogate followed by potential low surrogate + nextStart := v.pos + nextPos := v.pos + 2 + validNext := true + for range 4 { + if nextPos >= v.end || !stringutil.IsHexDigit(rune(v.text[nextPos])) { + validNext = false + break + } + nextPos++ + } + if validNext { + // Parse the next escape + nextCode := parseHexValue(v.text, nextStart+2, nextPos) + // Check if it's a low surrogate + if isLowSurrogate(rune(nextCode)) { + // Combine surrogates into a single code point + combinedCodePoint := combineSurrogatePair(rune(code), rune(nextCode)) + v.pos = nextPos + return string(combinedCodePoint) + } + } + } + return escapedValueString + } + + default: + // Identity escape or invalid escape + // Report error if: + // - In any Unicode mode, OR + // - In regexp mode, not Annex B, and ch is an identifier part + if v.anyUnicodeMode || (v.anyUnicodeModeOrNonAnnexB && scanner.IsIdentifierPart(ch)) { + v.error(diagnostics.This_character_cannot_be_escaped_in_a_regular_expression, start, v.pos-start) + } + return string(ch) + } +} + +// parseHexValue parses hexadecimal digits from text and returns the integer value +func parseHexValue(text string, start, end int) int { + code := 0 + for i := start; i < end; i++ { + digit := text[i] + if digit >= '0' && digit <= '9' { + code = code*16 + int(digit-'0') + } else if digit >= 'a' && digit <= 'f' { + code = code*16 + int(digit-'a'+10) + } else if digit >= 'A' && digit <= 'F' { + code = code*16 + int(digit-'A'+10) + } + } + return code +} + +func (v *regExpValidator) scanGroupName(isReference bool) { + tokenStart := v.pos + v.scanIdentifier(v.charAtOffset(0)) + if v.pos == tokenStart { + v.error(diagnostics.Expected_a_capturing_group_name, v.pos, 0) + } else if isReference { + v.groupNameReferences = append(v.groupNameReferences, namedReference{pos: tokenStart, end: v.pos, name: v.tokenValue}) + } else { + // Check for duplicate names in scope + if v.topNamedCapturingGroupsScope != nil && v.topNamedCapturingGroupsScope[v.tokenValue] { + v.error(diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, v.pos-tokenStart) + } else { + for _, scope := range v.namedCapturingGroupsScopeStack { + if scope != nil && scope[v.tokenValue] { + v.error(diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, v.pos-tokenStart) + break + } + } + } + if v.topNamedCapturingGroupsScope == nil { + v.topNamedCapturingGroupsScope = make(map[string]bool) + } + v.topNamedCapturingGroupsScope[v.tokenValue] = true + if v.groupSpecifiers == nil { + v.groupSpecifiers = make(map[string]bool) + } + v.groupSpecifiers[v.tokenValue] = true + } +} + +// scanSourceCharacter scans and returns a single "character" from the source. +// In Unicode mode (u or v flags), returns complete Unicode code points. +// In non-Unicode mode, mimics JavaScript's UTF-16 behavior where literal characters +// >= U+10000 are treated as surrogate pairs and consumed across two sequential calls. +func (v *regExpValidator) scanSourceCharacter() string { + // Check if we have a pending low surrogate from the previous call + if v.surrogateState != nil { + low := v.surrogateState.lowSurrogate + size := v.surrogateState.utf8Size + v.surrogateState = nil + v.pos += size + // Return the low surrogate encoded as UTF-16BE + return encodeSurrogate(low) + } + + // Decode the next UTF-8 character from the source + r, s := v.charAndSize() + + if v.anyUnicodeMode || r < supplementaryMin { + // In Unicode mode, or for BMP characters, consume and return normally + v.pos += s + return v.text[v.pos-s : v.pos] + } + + // In non-Unicode mode with a supplementary character (>= U+10000): + // JavaScript represents these as surrogate pairs (two UTF-16 code units). + // Return the high surrogate now and save the low surrogate for the next call. + high, low := splitToSurrogatePair(r) + + v.surrogateState = &surrogatePairState{ + lowSurrogate: low, + utf8Size: s, + } + + return encodeSurrogate(high) +} + +// ClassRanges ::= ClassAtom ('-' ClassAtom)? +// Scans character class content like [a-z] or [^0-9]. +// Follows ECMAScript regexp grammar +func (v *regExpValidator) scanClassRanges() { + isNegated := v.charAtOffset(0) == '^' + if isNegated { + v.pos++ + } + oldIsCharacterComplement := v.isCharacterComplement + v.isCharacterComplement = isNegated + defer func() { + v.isCharacterComplement = oldIsCharacterComplement + }() + for { + ch := v.charAtOffset(0) + if v.isClassContentExit(ch) { + return + } + atomStart := v.pos + atom := v.scanClassAtom() + if v.charAtOffset(0) == '-' && v.charAtOffset(1) != ']' { + v.pos++ + if v.isClassContentExit(v.charAtOffset(0)) { + return + } + // Check if min side of range is a character class escape + if atom == "" && v.anyUnicodeModeOrNonAnnexB { + v.error(diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, atomStart, v.pos-1-atomStart) + } + rangeEndStart := v.pos + rangeEnd := v.scanClassAtom() + // Check if max side of range is a character class escape + if rangeEnd == "" && v.anyUnicodeModeOrNonAnnexB { + v.error(diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, rangeEndStart, v.pos-rangeEndStart) + } + // Check range order + if atom != "" && rangeEnd != "" { + minCodePoint := decodeCodePoint(atom) + maxCodePoint := decodeCodePoint(rangeEnd) + + // Get the expected sizes (in UTF-16 code units) + minExpectedSize := charSize(minCodePoint) + maxExpectedSize := charSize(maxCodePoint) + + // Check if both are "complete" characters in JavaScript's UTF-16 representation. + // A character is complete if its UTF-16 length matches the expected size. + // In JavaScript, string.length returns the UTF-16 code unit count. + minUTF16Length := utf16Length(atom) + maxUTF16Length := utf16Length(rangeEnd) + + minIsComplete := minUTF16Length == minExpectedSize + maxIsComplete := maxUTF16Length == maxExpectedSize + + if minIsComplete && maxIsComplete && minCodePoint > maxCodePoint { + // In non-Unicode mode, literal characters >= 0x10000 are scanned + // as individual surrogates by scanSourceCharacter(), so the code + // points being compared are already the surrogate values (0xD800-0xDFFF). + // Escape sequences like \u{1D608} return the full character, so the + // code points are the actual values (>= 0x10000). + + // If there's a pending low surrogate from scanning the second atom, + // we need to account for its UTF-8 size in the error range. + errorEnd := v.pos + if v.surrogateState != nil { + errorEnd += v.surrogateState.utf8Size + } + length := errorEnd - atomStart + v.error(diagnostics.Range_out_of_order_in_character_class, atomStart, length) + } + } + } + } +} + +func (v *regExpValidator) isClassContentExit(ch rune) bool { + return ch == ']' || ch == 0 || v.pos >= v.end +} + +// ClassAtom ::= +// +// | SourceCharacter but not one of '\' or ']' +// | '\' ClassEscape +// +// ClassEscape ::= +// +// | 'b' +// | '-' +// | CharacterClassEscape +// | CharacterEscape +func (v *regExpValidator) scanClassAtom() string { + if v.charAtOffset(0) == '\\' { + v.pos++ + ch := v.charAtOffset(0) + switch ch { + case 'b': + v.pos++ + return "\b" // backspace character + case '-': + v.pos++ + return string(ch) // hyphen character + default: + if v.scanCharacterClassEscape() { + return "" + } + return v.scanCharacterEscape(false) + } + } + return v.scanSourceCharacter() +} + +type classSetExpressionType int + +const ( + classSetExpressionNone classSetExpressionType = iota + classSetExpressionSubtraction + classSetExpressionIntersection +) + +func (v *regExpValidator) scanClassSetExpression() { + isCharacterComplement := false + if v.charAtOffset(0) == '^' { + v.pos++ + isCharacterComplement = true + } + + oldIsCharacterComplement := v.isCharacterComplement + v.isCharacterComplement = isCharacterComplement + defer func() { + v.isCharacterComplement = oldIsCharacterComplement + }() + + expressionMayContainStrings := false + ch := v.charAtOffset(0) + if v.isClassContentExit(ch) { + return + } + + start := v.pos + var operand string + + // Check for operators at the start + slice := v.text[v.pos:min(v.pos+2, v.end)] + if slice == "--" || slice == "&&" { + v.error(diagnostics.Expected_a_class_set_operand, v.pos, 0) + v.mayContainStrings = false + } else { + operand = v.scanClassSetOperand() + } + + // Check what follows the first operand + switch v.charAtOffset(0) { + case '-': + if v.charAtOffset(1) == '-' { + if isCharacterComplement && v.mayContainStrings { + v.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start, v.pos-start) + } + expressionMayContainStrings = v.mayContainStrings + v.scanClassSetSubExpression(classSetExpressionSubtraction) + v.mayContainStrings = !isCharacterComplement && expressionMayContainStrings + return + } + case '&': + if v.charAtOffset(1) == '&' { + v.scanClassSetSubExpression(classSetExpressionIntersection) + if isCharacterComplement && v.mayContainStrings { + v.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start, v.pos-start) + } + expressionMayContainStrings = v.mayContainStrings + v.mayContainStrings = !isCharacterComplement && expressionMayContainStrings + return + } else { + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, v.pos, 1, string(ch)) + } + default: + if isCharacterComplement && v.mayContainStrings { + v.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start, v.pos-start) + } + expressionMayContainStrings = v.mayContainStrings + } + + // Continue scanning operands + for { + ch = v.charAtOffset(0) + if ch == 0 { + break + } + + switch ch { + case '-': + v.pos++ + ch = v.charAtOffset(0) + if v.isClassContentExit(ch) { + v.mayContainStrings = !isCharacterComplement && expressionMayContainStrings + return + } + if ch == '-' { + v.pos++ + v.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, v.pos-2, 2) + start = v.pos - 2 + operand = v.text[start:v.pos] + continue + } else { + if operand == "" { + v.error(diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start, v.pos-1-start) + } + secondStart := v.pos + secondOperand := v.scanClassSetOperand() + if isCharacterComplement && v.mayContainStrings { + v.error(diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, v.pos-secondStart) + } + expressionMayContainStrings = expressionMayContainStrings || v.mayContainStrings + if secondOperand == "" { + v.error(diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, v.pos-secondStart) + break + } + if operand == "" { + break + } + // Check range order + minRune, minSize := utf8.DecodeRuneInString(operand) + maxRune, maxSize := utf8.DecodeRuneInString(secondOperand) + if len(operand) == minSize && len(secondOperand) == maxSize && minRune > maxRune { + v.error(diagnostics.Range_out_of_order_in_character_class, start, v.pos-start) + } + } + + case '&': + start = v.pos + v.pos++ + if v.charAtOffset(0) == '&' { + v.pos++ + v.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, v.pos-2, 2) + if v.charAtOffset(0) == '&' { + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, v.pos, 1, string(ch)) + v.pos++ + } + } else { + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, v.pos-1, 1, string(ch)) + } + operand = v.text[start:v.pos] + continue + } + + if v.isClassContentExit(v.charAtOffset(0)) { + break + } + + start = v.pos + slice = v.text[v.pos:min(v.pos+2, v.end)] + if slice == "--" || slice == "&&" { + v.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, v.pos, 2) + v.pos += 2 + operand = v.text[start:v.pos] + } else { + operand = v.scanClassSetOperand() + } + } + v.mayContainStrings = !isCharacterComplement && expressionMayContainStrings +} + +func (v *regExpValidator) scanClassSetSubExpression(expressionType classSetExpressionType) { + expressionMayContainStrings := v.mayContainStrings + for { + ch := v.charAtOffset(0) + if v.isClassContentExit(ch) { + break + } + + // Provide user-friendly diagnostic messages + switch ch { + case '-': + v.pos++ + if v.charAtOffset(0) == '-' { + v.pos++ + if expressionType != classSetExpressionSubtraction { + v.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, v.pos-2, 2) + } + } else { + v.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, v.pos-1, 1) + } + case '&': + v.pos++ + if v.charAtOffset(0) == '&' { + v.pos++ + if expressionType != classSetExpressionIntersection { + v.error(diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, v.pos-2, 2) + } + if v.charAtOffset(0) == '&' { + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, v.pos, 1, string(ch)) + v.pos++ + } + } else { + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, v.pos-1, 1, string(ch)) + } + default: + switch expressionType { + case classSetExpressionSubtraction: + v.error(diagnostics.X_0_expected, v.pos, 0, "--") + case classSetExpressionIntersection: + v.error(diagnostics.X_0_expected, v.pos, 0, "&&") + } + } + + ch = v.charAtOffset(0) + if v.isClassContentExit(ch) { + v.error(diagnostics.Expected_a_class_set_operand, v.pos, 0) + break + } + v.scanClassSetOperand() + // Used only if expressionType is Intersection + expressionMayContainStrings = expressionMayContainStrings && v.mayContainStrings + } + v.mayContainStrings = expressionMayContainStrings +} + +// ClassSetOperand ::= +// +// | '[' ClassSetExpression ']' +// | '\' CharacterClassEscape +// | '\q{' ClassStringDisjunctionContents '}' +// | ClassSetCharacter +func (v *regExpValidator) scanClassSetOperand() string { + v.mayContainStrings = false + switch v.charAtOffset(0) { + case 0: + return "" + case '[': + v.pos++ + v.scanClassSetExpression() + v.scanExpectedChar(']') + return "" + case '\\': + v.pos++ + if v.scanCharacterClassEscape() { + return "" + } else if v.charAtOffset(0) == 'q' { + v.pos++ + if v.charAtOffset(0) == '{' { + v.pos++ + v.scanClassStringDisjunctionContents() + v.scanExpectedChar('}') + return "" + } else { + v.error(diagnostics.X_q_must_be_followed_by_string_alternatives_enclosed_in_braces, v.pos-2, 2) + return "q" + } + } + v.pos-- + // falls through + } + return v.scanClassSetCharacter() +} + +// ClassStringDisjunctionContents ::= ClassSetCharacter* ('|' ClassSetCharacter*)* +func (v *regExpValidator) scanClassStringDisjunctionContents() { + characterCount := 0 + for { + ch := v.charAtOffset(0) + switch ch { + case 0: + return + case '}': + if characterCount != 1 { + v.mayContainStrings = true + } + return + case '|': + if characterCount != 1 { + v.mayContainStrings = true + } + v.pos++ + characterCount = 0 + default: + v.scanClassSetCharacter() + characterCount++ + } + } +} + +// ClassSetCharacter ::= +// +// | SourceCharacter -- ClassSetSyntaxCharacter -- ClassSetReservedDoublePunctuator +// | '\' (CharacterEscape | ClassSetReservedPunctuator | 'b') +func (v *regExpValidator) scanClassSetCharacter() string { + ch := v.charAtOffset(0) + if ch == 0 { + return "" + } + + if ch == '\\' { + v.pos++ + ch = v.charAtOffset(0) + switch ch { + case 'b': + v.pos++ + return "\b" + case '&', '-', '!', '#', '%', ',', ':', ';', '<', '=', '>', '@', '`', '~': + v.pos++ + return string(ch) + default: + return v.scanCharacterEscape(false) + } + } else if ch == v.charAtOffset(1) { + // Check for reserved double punctuators + switch ch { + case '&', '!', '#', '%', '*', '+', ',', '.', ':', ';', '<', '=', '>', '?', '@', '`', '~': + v.error(diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, v.pos, 2) + v.pos += 2 + return v.text[v.pos-2 : v.pos] + } + } + + switch ch { + case '/', '(', ')', '[', ']', '{', '}', '-', '|': + v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, v.pos, 1, string(ch)) + v.pos++ + return string(ch) + } + + return v.scanSourceCharacter() +} diff --git a/internal/regexpchecker/tables.go b/internal/regexpchecker/tables.go new file mode 100644 index 0000000000..ddf554b31e --- /dev/null +++ b/internal/regexpchecker/tables.go @@ -0,0 +1,560 @@ +package regexpchecker + +import "github.com/microsoft/typescript-go/internal/collections" + +// 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 - General_Category values +var generalCategoryValues = 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", +) + +// Unicode 15.1 - Script values +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", +) + +// Map of non-binary property names to their canonical names +var nonBinaryUnicodePropertyNames = map[string]string{ + "General_Category": "General_Category", + "gc": "General_Category", + "Script": "Script", + "sc": "Script", + "Script_Extensions": "Script_Extensions", + "scx": "Script_Extensions", +} + +func isValidUnicodePropertyName(name string) bool { + return generalCategoryValues.Has(name) || binaryUnicodeProperties.Has(name) +} + +func isValidNonBinaryUnicodePropertyName(name string) bool { + _, ok := nonBinaryUnicodePropertyNames[name] + return ok +} + +func isValidUnicodeProperty(name, value string) bool { + canonicalName := nonBinaryUnicodePropertyNames[name] + if canonicalName == "General_Category" { + return generalCategoryValues.Has(value) + } + if canonicalName == "Script" || canonicalName == "Script_Extensions" { + return scriptValues.Has(value) + } + return false +} diff --git a/internal/regexpchecker/utf16.go b/internal/regexpchecker/utf16.go new file mode 100644 index 0000000000..3475a4ad82 --- /dev/null +++ b/internal/regexpchecker/utf16.go @@ -0,0 +1,134 @@ +package regexpchecker + +import ( + "unicode/utf16" + "unicode/utf8" +) + +// utf16.go contains utilities for handling UTF-16 surrogate pairs and encoding. +// JavaScript regular expressions use UTF-16 internally, so we need to mimic this +// behavior when validating regex patterns. This includes handling surrogate pairs +// and preserving surrogate values that would otherwise be invalid in Go strings. + +// UTF-16 surrogate pair constants (for cases where we need finer granularity than utf16 package) +const ( + highSurrogateMin = 0xD800 // Start of high surrogate range + highSurrogateMax = 0xDBFF // End of high surrogate range + lowSurrogateMin = 0xDC00 // Start of low surrogate range + lowSurrogateMax = 0xDFFF // End of low surrogate range + supplementaryMin = 0x10000 // First code point requiring surrogate pair +) + +// isSurrogate returns true if the code point is in the surrogate range. +// Delegates to stdlib utf16.IsSurrogate. +func isSurrogate(r rune) bool { + return utf16.IsSurrogate(r) +} + +// isHighSurrogate returns true if the code point is a high surrogate +func isHighSurrogate(r rune) bool { + return r >= highSurrogateMin && r <= highSurrogateMax +} + +// isLowSurrogate returns true if the code point is a low surrogate +func isLowSurrogate(r rune) bool { + return r >= lowSurrogateMin && r <= lowSurrogateMax +} + +// combineSurrogatePair combines a high and low surrogate into a code point. +// Delegates to stdlib utf16.DecodeRune. +func combineSurrogatePair(high, low rune) rune { + return utf16.DecodeRune(high, low) +} + +// splitToSurrogatePair splits a supplementary code point into high and low surrogates. +// Delegates to stdlib utf16.EncodeRune. +func splitToSurrogatePair(r rune) (high, low rune) { + return utf16.EncodeRune(r) +} + +// encodeSurrogate encodes a UTF-16 surrogate value as a 2-byte UTF-16BE sequence. +// This preserves the surrogate value (which would otherwise be invalid in UTF-8/UTF-32). +// Go's string(rune) converts invalid surrogates to U+FFFD, so we use this encoding +// to preserve the exact surrogate value for JavaScript regex semantics. +func encodeSurrogate(surrogate rune) string { + return string([]byte{byte(surrogate >> 8), byte(surrogate & 0xFF)}) +} + +// decodeSurrogate decodes a UTF-16BE encoded surrogate from a 2-byte string. +// Returns the surrogate value and true if successful, or 0 and false otherwise. +func decodeSurrogate(s string) (rune, bool) { + if len(s) == 2 { + code := rune((uint16(s[0]) << 8) | uint16(s[1])) + if isSurrogate(code) { + return code, true + } + } + return 0, false +} + +// decodeCodePoint returns the code point value from a character string. +// The string can be either a UTF-8 encoded character or a UTF-16BE encoded surrogate. +// Surrogates from escape sequences are encoded as 2-byte UTF-16BE sequences. +func decodeCodePoint(s string) rune { + if len(s) == 0 { + return 0 + } + // Check if this is a UTF-16BE encoded surrogate + if code, ok := decodeSurrogate(s); ok { + return code + } + first, _ := utf8.DecodeRuneInString(s) + return first +} + +// charSize returns the number of UTF-16 code units needed to represent a code point. +// This matches JavaScript's internal string representation. +// Similar to stdlib utf16.RuneLen but handles zero specially. +func charSize(ch rune) int { + if ch == 0 { + return 0 + } + // Use stdlib for consistency, but it returns -1 for invalid runes + if n := utf16.RuneLen(ch); n > 0 { + return n + } + return 1 // fallback for invalid runes +} + +// utf16Length returns the UTF-16 length of a string, matching JavaScript's string.length. +// This counts UTF-16 code units, where surrogate pairs count as 2 units. +// Handles both UTF-8 encoded strings and special 2-byte UTF-16BE surrogate encodings. +func utf16Length(s string) int { + // Check if this is a UTF-16BE surrogate encoding + // These are used to preserve surrogate values in patterns like \uD835 + if _, ok := decodeSurrogate(s); ok { + return 1 + } + + // Otherwise, count UTF-16 code units from UTF-8 runes + length := 0 + for _, r := range s { + length += charSize(r) + } + return length +} + +// regExpChar represents a single "character" in a regex pattern. +// In Unicode mode, this is a single code point. +// In non-Unicode mode, this matches JavaScript's UTF-16 representation, +// where supplementary characters are represented as surrogate pairs. +type regExpChar struct { + // The code point value. For surrogates, this is the surrogate value itself (0xD800-0xDFFF). + codePoint rune + // The UTF-16 length (1 for most characters, 2 for supplementary characters in Unicode mode) + utf16Length int +} + +// makeRegExpChar creates a regExpChar from a code point +func makeRegExpChar(codePoint rune) regExpChar { + return regExpChar{ + codePoint: codePoint, + utf16Length: charSize(codePoint), + } +} diff --git a/testdata/baselines/reference/compiler/regularExpressionBackslashK.errors.txt b/testdata/baselines/reference/compiler/regularExpressionBackslashK.errors.txt new file mode 100644 index 0000000000..7bfbf41421 --- /dev/null +++ b/testdata/baselines/reference/compiler/regularExpressionBackslashK.errors.txt @@ -0,0 +1,75 @@ +regularExpressionBackslashK.ts(7,28): error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. +regularExpressionBackslashK.ts(10,36): error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. +regularExpressionBackslashK.ts(16,27): error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. +regularExpressionBackslashK.ts(30,40): error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. +regularExpressionBackslashK.ts(33,27): error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. +regularExpressionBackslashK.ts(50,38): error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. + + +==== regularExpressionBackslashK.ts (6 errors) ==== + // Test that \k without < is an error when named groups are present + + // Valid: \k followed by with named groups + const validBackref = /(?a)\k/; + + // Invalid: \k not followed by < when named groups are present (even in non-Unicode mode) + const invalidK = /(?a)\k/; + ~~ +!!! error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. + + // Invalid: \k followed by other chars when named groups are present + const invalidKWithText = /(?x)\kb/; + ~~ +!!! error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. + + // Valid: \k without < is OK when there are NO named groups (identity escape) + const validIdentityEscape = /a\kb/; + + // Invalid: \k without < in Unicode mode (regardless of named groups) + const invalidKUnicode = /a\kb/u; + ~~ +!!! error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. + + // Edge cases + + // Multiple named groups, valid backreferences + const multiGroup = /(?x)(?y)\k\k/; + + // Named group in alternation with \k in different branch + const alternation = /(?a)|\k/; + + // Named group with \k in lookahead + const lookahead = /(?b)(?=\k)/; + + // Named group with bare \k - should error + const bareKWithGroups = /(?.)(?.)\k/; + ~~ +!!! error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. + + // Bare \k at start when named group comes later - should still error + const bareKBeforeGroup = /\k(?pattern)/; + ~~ +!!! error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. + + // Identity escape \k is valid when no named groups at all + const noNamedGroups = /\ka\kb/; + + // Unicode characters + + // Unicode characters before named group + const unicodeBefore = /šŸ˜€(?a)\k/; + + // Unicode characters after named group + const unicodeAfter = /(?b)\kšŸ˜€/; + + // Unicode characters in between + const unicodeMiddle = /(?.)šŸ˜€\k/; + + // Unicode with bare \k - should error + const unicodeWithBareK = /šŸ˜€(?.)\k/; + ~~ +!!! error TS1510: '\k' must be followed by a capturing group name enclosed in angle brackets. + + // Unicode without named groups and \k - should be OK + const unicodeNoGroups = /šŸ˜€\kšŸ˜€/; + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/regularExpressionBackslashK.js b/testdata/baselines/reference/compiler/regularExpressionBackslashK.js new file mode 100644 index 0000000000..ecadc21a40 --- /dev/null +++ b/testdata/baselines/reference/compiler/regularExpressionBackslashK.js @@ -0,0 +1,94 @@ +//// [tests/cases/compiler/regularExpressionBackslashK.ts] //// + +//// [regularExpressionBackslashK.ts] +// Test that \k without < is an error when named groups are present + +// Valid: \k followed by with named groups +const validBackref = /(?a)\k/; + +// Invalid: \k not followed by < when named groups are present (even in non-Unicode mode) +const invalidK = /(?a)\k/; + +// Invalid: \k followed by other chars when named groups are present +const invalidKWithText = /(?x)\kb/; + +// Valid: \k without < is OK when there are NO named groups (identity escape) +const validIdentityEscape = /a\kb/; + +// Invalid: \k without < in Unicode mode (regardless of named groups) +const invalidKUnicode = /a\kb/u; + +// Edge cases + +// Multiple named groups, valid backreferences +const multiGroup = /(?x)(?y)\k\k/; + +// Named group in alternation with \k in different branch +const alternation = /(?a)|\k/; + +// Named group with \k in lookahead +const lookahead = /(?b)(?=\k)/; + +// Named group with bare \k - should error +const bareKWithGroups = /(?.)(?.)\k/; + +// Bare \k at start when named group comes later - should still error +const bareKBeforeGroup = /\k(?pattern)/; + +// Identity escape \k is valid when no named groups at all +const noNamedGroups = /\ka\kb/; + +// Unicode characters + +// Unicode characters before named group +const unicodeBefore = /šŸ˜€(?a)\k/; + +// Unicode characters after named group +const unicodeAfter = /(?b)\kšŸ˜€/; + +// Unicode characters in between +const unicodeMiddle = /(?.)šŸ˜€\k/; + +// Unicode with bare \k - should error +const unicodeWithBareK = /šŸ˜€(?.)\k/; + +// Unicode without named groups and \k - should be OK +const unicodeNoGroups = /šŸ˜€\kšŸ˜€/; + + +//// [regularExpressionBackslashK.js] +// Test that \k without < is an error when named groups are present +// Valid: \k followed by with named groups +const validBackref = /(?a)\k/; +// Invalid: \k not followed by < when named groups are present (even in non-Unicode mode) +const invalidK = /(?a)\k/; +// Invalid: \k followed by other chars when named groups are present +const invalidKWithText = /(?x)\kb/; +// Valid: \k without < is OK when there are NO named groups (identity escape) +const validIdentityEscape = /a\kb/; +// Invalid: \k without < in Unicode mode (regardless of named groups) +const invalidKUnicode = /a\kb/u; +// Edge cases +// Multiple named groups, valid backreferences +const multiGroup = /(?x)(?y)\k\k/; +// Named group in alternation with \k in different branch +const alternation = /(?a)|\k/; +// Named group with \k in lookahead +const lookahead = /(?b)(?=\k)/; +// Named group with bare \k - should error +const bareKWithGroups = /(?.)(?.)\k/; +// Bare \k at start when named group comes later - should still error +const bareKBeforeGroup = /\k(?pattern)/; +// Identity escape \k is valid when no named groups at all +const noNamedGroups = /\ka\kb/; +// Unicode characters +// Unicode characters before named group +const unicodeBefore = /šŸ˜€(?a)\k/; +// Unicode characters after named group +const unicodeAfter = /(?b)\kšŸ˜€/; +// Unicode characters in between +const unicodeMiddle = /(?.)šŸ˜€\k/; +// Unicode with bare \k - should error +const unicodeWithBareK = /šŸ˜€(?.)\k/; +// Unicode without named groups and \k - should be OK +const unicodeNoGroups = /šŸ˜€\kšŸ˜€/; diff --git a/testdata/baselines/reference/compiler/regularExpressionBackslashK.symbols b/testdata/baselines/reference/compiler/regularExpressionBackslashK.symbols new file mode 100644 index 0000000000..12b72e8d06 --- /dev/null +++ b/testdata/baselines/reference/compiler/regularExpressionBackslashK.symbols @@ -0,0 +1,73 @@ +//// [tests/cases/compiler/regularExpressionBackslashK.ts] //// + +=== regularExpressionBackslashK.ts === +// Test that \k without < is an error when named groups are present + +// Valid: \k followed by with named groups +const validBackref = /(?a)\k/; +>validBackref : Symbol(validBackref, Decl(regularExpressionBackslashK.ts, 3, 5)) + +// Invalid: \k not followed by < when named groups are present (even in non-Unicode mode) +const invalidK = /(?a)\k/; +>invalidK : Symbol(invalidK, Decl(regularExpressionBackslashK.ts, 6, 5)) + +// Invalid: \k followed by other chars when named groups are present +const invalidKWithText = /(?x)\kb/; +>invalidKWithText : Symbol(invalidKWithText, Decl(regularExpressionBackslashK.ts, 9, 5)) + +// Valid: \k without < is OK when there are NO named groups (identity escape) +const validIdentityEscape = /a\kb/; +>validIdentityEscape : Symbol(validIdentityEscape, Decl(regularExpressionBackslashK.ts, 12, 5)) + +// Invalid: \k without < in Unicode mode (regardless of named groups) +const invalidKUnicode = /a\kb/u; +>invalidKUnicode : Symbol(invalidKUnicode, Decl(regularExpressionBackslashK.ts, 15, 5)) + +// Edge cases + +// Multiple named groups, valid backreferences +const multiGroup = /(?x)(?y)\k\k/; +>multiGroup : Symbol(multiGroup, Decl(regularExpressionBackslashK.ts, 20, 5)) + +// Named group in alternation with \k in different branch +const alternation = /(?a)|\k/; +>alternation : Symbol(alternation, Decl(regularExpressionBackslashK.ts, 23, 5)) + +// Named group with \k in lookahead +const lookahead = /(?b)(?=\k)/; +>lookahead : Symbol(lookahead, Decl(regularExpressionBackslashK.ts, 26, 5)) + +// Named group with bare \k - should error +const bareKWithGroups = /(?.)(?.)\k/; +>bareKWithGroups : Symbol(bareKWithGroups, Decl(regularExpressionBackslashK.ts, 29, 5)) + +// Bare \k at start when named group comes later - should still error +const bareKBeforeGroup = /\k(?pattern)/; +>bareKBeforeGroup : Symbol(bareKBeforeGroup, Decl(regularExpressionBackslashK.ts, 32, 5)) + +// Identity escape \k is valid when no named groups at all +const noNamedGroups = /\ka\kb/; +>noNamedGroups : Symbol(noNamedGroups, Decl(regularExpressionBackslashK.ts, 35, 5)) + +// Unicode characters + +// Unicode characters before named group +const unicodeBefore = /šŸ˜€(?a)\k/; +>unicodeBefore : Symbol(unicodeBefore, Decl(regularExpressionBackslashK.ts, 40, 5)) + +// Unicode characters after named group +const unicodeAfter = /(?b)\kšŸ˜€/; +>unicodeAfter : Symbol(unicodeAfter, Decl(regularExpressionBackslashK.ts, 43, 5)) + +// Unicode characters in between +const unicodeMiddle = /(?.)šŸ˜€\k/; +>unicodeMiddle : Symbol(unicodeMiddle, Decl(regularExpressionBackslashK.ts, 46, 5)) + +// Unicode with bare \k - should error +const unicodeWithBareK = /šŸ˜€(?.)\k/; +>unicodeWithBareK : Symbol(unicodeWithBareK, Decl(regularExpressionBackslashK.ts, 49, 5)) + +// Unicode without named groups and \k - should be OK +const unicodeNoGroups = /šŸ˜€\kšŸ˜€/; +>unicodeNoGroups : Symbol(unicodeNoGroups, Decl(regularExpressionBackslashK.ts, 52, 5)) + diff --git a/testdata/baselines/reference/compiler/regularExpressionBackslashK.types b/testdata/baselines/reference/compiler/regularExpressionBackslashK.types new file mode 100644 index 0000000000..960f33e5e9 --- /dev/null +++ b/testdata/baselines/reference/compiler/regularExpressionBackslashK.types @@ -0,0 +1,89 @@ +//// [tests/cases/compiler/regularExpressionBackslashK.ts] //// + +=== regularExpressionBackslashK.ts === +// Test that \k without < is an error when named groups are present + +// Valid: \k followed by with named groups +const validBackref = /(?a)\k/; +>validBackref : RegExp +>/(?a)\k/ : RegExp + +// Invalid: \k not followed by < when named groups are present (even in non-Unicode mode) +const invalidK = /(?a)\k/; +>invalidK : RegExp +>/(?a)\k/ : RegExp + +// Invalid: \k followed by other chars when named groups are present +const invalidKWithText = /(?x)\kb/; +>invalidKWithText : RegExp +>/(?x)\kb/ : RegExp + +// Valid: \k without < is OK when there are NO named groups (identity escape) +const validIdentityEscape = /a\kb/; +>validIdentityEscape : RegExp +>/a\kb/ : RegExp + +// Invalid: \k without < in Unicode mode (regardless of named groups) +const invalidKUnicode = /a\kb/u; +>invalidKUnicode : RegExp +>/a\kb/u : RegExp + +// Edge cases + +// Multiple named groups, valid backreferences +const multiGroup = /(?x)(?y)\k\k/; +>multiGroup : RegExp +>/(?x)(?y)\k\k/ : RegExp + +// Named group in alternation with \k in different branch +const alternation = /(?a)|\k/; +>alternation : RegExp +>/(?a)|\k/ : RegExp + +// Named group with \k in lookahead +const lookahead = /(?b)(?=\k)/; +>lookahead : RegExp +>/(?b)(?=\k)/ : RegExp + +// Named group with bare \k - should error +const bareKWithGroups = /(?.)(?.)\k/; +>bareKWithGroups : RegExp +>/(?.)(?.)\k/ : RegExp + +// Bare \k at start when named group comes later - should still error +const bareKBeforeGroup = /\k(?pattern)/; +>bareKBeforeGroup : RegExp +>/\k(?pattern)/ : RegExp + +// Identity escape \k is valid when no named groups at all +const noNamedGroups = /\ka\kb/; +>noNamedGroups : RegExp +>/\ka\kb/ : RegExp + +// Unicode characters + +// Unicode characters before named group +const unicodeBefore = /šŸ˜€(?a)\k/; +>unicodeBefore : RegExp +>/šŸ˜€(?a)\k/ : RegExp + +// Unicode characters after named group +const unicodeAfter = /(?b)\kšŸ˜€/; +>unicodeAfter : RegExp +>/(?b)\kšŸ˜€/ : RegExp + +// Unicode characters in between +const unicodeMiddle = /(?.)šŸ˜€\k/; +>unicodeMiddle : RegExp +>/(?.)šŸ˜€\k/ : RegExp + +// Unicode with bare \k - should error +const unicodeWithBareK = /šŸ˜€(?.)\k/; +>unicodeWithBareK : RegExp +>/šŸ˜€(?.)\k/ : RegExp + +// Unicode without named groups and \k - should be OK +const unicodeNoGroups = /šŸ˜€\kšŸ˜€/; +>unicodeNoGroups : RegExp +>/šŸ˜€\kšŸ˜€/ : RegExp + diff --git a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt b/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt index 5841b5eba3..0bc0cc1bc3 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. @@ -33,7 +39,7 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(43,32): error TS2550: Property ' doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. -==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (33 errors) ==== +==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (39 errors) ==== // es2016 const testIncludes = ["hello"].includes("world"); ~~~~~~~~ @@ -70,9 +76,21 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): 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 4eaabe249c..0000000000 --- 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 -31, +25 lines =@@ - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. - - --==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (39 errors) ==== -+==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (33 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 0000000000..86e97bc3ed --- /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 2b83180532..0000000000 --- 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=es5).errors.txt b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es5).errors.txt new file mode 100644 index 0000000000..86e97bc3ed --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es5).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=es5).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es5).errors.txt.diff deleted file mode 100644 index 9c16dffe26..0000000000 --- a/testdata/baselines/reference/submodule/compiler/regExpWithOpenBracketInCharClass(target=es5).errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.regExpWithOpenBracketInCharClass(target=es5).errors.txt -+++ new.regExpWithOpenBracketInCharClass(target=es5).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 0000000000..fb5540bc6b --- /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 52ebf56baa..0000000000 --- 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 0000000000..f08ceaf895 --- /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 fa48818b0d..0000000000 --- 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 0000000000..6a2614dc0e --- /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,9): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(8,9): error TS1517: Range out of order in character class. +regularExpressionCharacterClassRangeOrder.ts(9,9): 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 09a02fe00b..451d8be820 100644 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionCharacterClassRangeOrder.errors.txt.diff @@ -5,67 +5,30 @@ -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,9): error TS1517: Range out of order in character class. ++regularExpressionCharacterClassRangeOrder.ts(8,9): error TS1517: Range out of order in character class. ++regularExpressionCharacterClassRangeOrder.ts(9,9): 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. +@@= 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 0000000000..6414010e5c --- /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 af46f29a92..0000000000 --- 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 0000000000..b900c35fe6 --- /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 d269c48fd1..0000000000 --- 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 0000000000..a32fb1567c --- /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 c0d8a52a11..0000000000 --- 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=es5).errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es5).errors.txt new file mode 100644 index 0000000000..a32fb1567c --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es5).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=es5).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es5).errors.txt.diff deleted file mode 100644 index b91bf47cf6..0000000000 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionScanning(target=es5).errors.txt.diff +++ /dev/null @@ -1,713 +0,0 @@ ---- old.regularExpressionScanning(target=es5).errors.txt -+++ new.regularExpressionScanning(target=es5).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 0000000000..c2d144d42c --- /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 427334cc4b..0000000000 --- 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.errors.txt b/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt new file mode 100644 index 0000000000..cf811c2d94 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions.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.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt.diff deleted file mode 100644 index 48d7cfe763..0000000000 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt.diff +++ /dev/null @@ -1,29 +0,0 @@ ---- old.regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt -+++ new.regularExpressionUnicodePropertyValueExpressionSuggestions.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 0000000000..8bcee094eb --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt @@ -0,0 +1,29 @@ +regularExpressionWithNonBMPFlags.ts(7,18): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,19): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,21): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,30): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,31): error TS1499: Unknown regular expression flag. +regularExpressionWithNonBMPFlags.ts(7,32): 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 cd423f64ac..ffedaf83db 100644 --- a/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/regularExpressionWithNonBMPFlags.errors.txt.diff @@ -7,16 +7,19 @@ -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 š˜³š˜¦š˜Øš˜¦š˜¹ = /(?š˜“š˜Ŗ-š˜®:^š˜§š˜°š˜°.)/š˜Øš˜®š˜¶; ++regularExpressionWithNonBMPFlags.ts(7,18): error TS1499: Unknown regular expression flag. ++regularExpressionWithNonBMPFlags.ts(7,19): error TS1499: Unknown regular expression flag. ++regularExpressionWithNonBMPFlags.ts(7,21): error TS1499: Unknown regular expression flag. ++regularExpressionWithNonBMPFlags.ts(7,30): error TS1499: Unknown regular expression flag. ++regularExpressionWithNonBMPFlags.ts(7,31): error TS1499: Unknown regular expression flag. ++regularExpressionWithNonBMPFlags.ts(7,32): error TS1499: Unknown regular expression flag. + + + ==== regularExpressionWithNonBMPFlags.ts (6 errors) ==== +@@= skipped -13, +13 lines =@@ + // + // See https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols + const š˜³š˜¦š˜Øš˜¦š˜¹ = /(?š˜“š˜Ŗ-š˜®:^š˜§š˜°š˜°.)/š˜Øš˜®š˜¶; - ~~ -!!! error TS1499: Unknown regular expression flag. - ~~ @@ -28,6 +31,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 3540eee22f..10c3bfa576 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,4): 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,2): 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,2): error TS1199: Unterminated Unicode escape sequence. +4.ts(1,12): error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +40.ts(1,2): 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,4): 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,4): 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,4): 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 index 474fe947ce..0cce15a967 100644 --- a/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parser.numericSeparators.unicodeEscape.errors.txt.diff @@ -5,171 +5,104 @@ 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. ++12.ts(1,4): 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. +@@= skipped -18, +18 lines =@@ 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? ++28.ts(1,2): 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? ++4.ts(1,2): 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? ++40.ts(1,2): 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. ++44.ts(1,4): 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. ++48.ts(1,4): 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. ++8.ts(1,4): error TS1125: Hexadecimal digit expected. 9.ts(1,5): error TS1125: Hexadecimal digit expected. -@@= skipped -58, +44 lines =@@ - - !!! error TS1199: Unterminated Unicode escape sequence. +@@= skipped -42, +42 lines =@@ --==== 4.ts (2 errors) ==== -+==== 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" -@@= skipped -22, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. ++ ~~~~~ + !!! error TS1199: Unterminated Unicode escape sequence. + ~ + !!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +@@= skipped -22, +22 lines =@@ --==== 8.ts (1 errors) ==== -+==== 8.ts (0 errors) ==== + ==== 8.ts (1 errors) ==== /\uff_ff/u - --!!! error TS1125: Hexadecimal digit expected. ++ ~~ + !!! error TS1125: Hexadecimal digit expected. ==== 9.ts (1 errors) ==== - "\xf_f" -@@= skipped -20, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. +@@= skipped -20, +20 lines =@@ --==== 12.ts (1 errors) ==== -+==== 12.ts (0 errors) ==== + ==== 12.ts (1 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. + ==== 13.ts (1 errors) ==== +@@= skipped -82, +82 lines =@@ --==== 28.ts (2 errors) ==== -+==== 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_" -@@= skipped -46, +42 lines =@@ - ++ ~~~~~~~~~ !!! error TS1199: Unterminated Unicode escape sequence. + ~ + !!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +@@= skipped -46, +46 lines =@@ --==== 40.ts (2 errors) ==== -+==== 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" -@@= skipped -22, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. ++ ~~~~~ + !!! error TS1199: Unterminated Unicode escape sequence. + ~ + !!! error TS1508: Unexpected '}'. Did you mean to escape it with backslash? +@@= skipped -22, +22 lines =@@ --==== 44.ts (1 errors) ==== -+==== 44.ts (0 errors) ==== + ==== 44.ts (1 errors) ==== /\uff__ff/u - --!!! error TS1125: Hexadecimal digit expected. ++ ~~ + !!! error TS1125: Hexadecimal digit expected. ==== 45.ts (1 errors) ==== - "\xf__f" -@@= skipped -20, +18 lines =@@ - - !!! error TS1125: Hexadecimal digit expected. +@@= skipped -20, +20 lines =@@ --==== 48.ts (1 errors) ==== -+==== 48.ts (0 errors) ==== + ==== 48.ts (1 errors) ==== /\xf__f/u - --!!! error TS1125: Hexadecimal digit expected. ++ ~ + !!! 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 0000000000..577810615d --- /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 b5039f7191..0000000000 --- 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 1c021a9ba8..8c8babab6a 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 8834a567f0..0000000000 --- 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=es5).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es5).errors.txt new file mode 100644 index 0000000000..51228e4c87 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es5).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=es5).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es5).errors.txt.diff deleted file mode 100644 index 87410caeea..0000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es5).errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions07(target=es5).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions07(target=es5).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/unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions07(target=es6).errors.txt new file mode 100644 index 0000000000..51228e4c87 --- /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 095c977c6b..0000000000 --- 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=es5).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es5).errors.txt new file mode 100644 index 0000000000..71bc964c77 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es5).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=es5).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es5).errors.txt.diff deleted file mode 100644 index 654852c80b..0000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es5).errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions12(target=es5).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions12(target=es5).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/unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions12(target=es6).errors.txt new file mode 100644 index 0000000000..71bc964c77 --- /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 3ce7eaec31..0000000000 --- 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=es5).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es5).errors.txt new file mode 100644 index 0000000000..2f7010fdb3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es5).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=es5).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es5).errors.txt.diff deleted file mode 100644 index f943eef2ad..0000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es5).errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions14(target=es5).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions14(target=es5).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/unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions14(target=es6).errors.txt new file mode 100644 index 0000000000..2f7010fdb3 --- /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 0dfb17a99f..0000000000 --- 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=es5).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es5).errors.txt new file mode 100644 index 0000000000..25e6af1498 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es5).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=es5).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es5).errors.txt.diff deleted file mode 100644 index ca58b1dcb1..0000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es5).errors.txt.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions17(target=es5).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions17(target=es5).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/unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions17(target=es6).errors.txt new file mode 100644 index 0000000000..25e6af1498 --- /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 87176ce857..0000000000 --- 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=es5).errors.txt b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es5).errors.txt new file mode 100644 index 0000000000..dadcab40d9 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es5).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=es5).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es5).errors.txt.diff deleted file mode 100644 index 21a88600ef..0000000000 --- a/testdata/baselines/reference/submodule/conformance/unicodeExtendedEscapesInRegularExpressions19(target=es5).errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.unicodeExtendedEscapesInRegularExpressions19(target=es5).errors.txt -+++ new.unicodeExtendedEscapesInRegularExpressions19(target=es5).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/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 0000000000..dadcab40d9 --- /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 347886dd63..0000000000 --- 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/tests/cases/compiler/regularExpressionBackslashK.ts b/testdata/tests/cases/compiler/regularExpressionBackslashK.ts new file mode 100644 index 0000000000..4721ce7c1e --- /dev/null +++ b/testdata/tests/cases/compiler/regularExpressionBackslashK.ts @@ -0,0 +1,56 @@ +// @target: esnext +// @strict: true + +// Test that \k without < is an error when named groups are present + +// Valid: \k followed by with named groups +const validBackref = /(?a)\k/; + +// Invalid: \k not followed by < when named groups are present (even in non-Unicode mode) +const invalidK = /(?a)\k/; + +// Invalid: \k followed by other chars when named groups are present +const invalidKWithText = /(?x)\kb/; + +// Valid: \k without < is OK when there are NO named groups (identity escape) +const validIdentityEscape = /a\kb/; + +// Invalid: \k without < in Unicode mode (regardless of named groups) +const invalidKUnicode = /a\kb/u; + +// Edge cases + +// Multiple named groups, valid backreferences +const multiGroup = /(?x)(?y)\k\k/; + +// Named group in alternation with \k in different branch +const alternation = /(?a)|\k/; + +// Named group with \k in lookahead +const lookahead = /(?b)(?=\k)/; + +// Named group with bare \k - should error +const bareKWithGroups = /(?.)(?.)\k/; + +// Bare \k at start when named group comes later - should still error +const bareKBeforeGroup = /\k(?pattern)/; + +// Identity escape \k is valid when no named groups at all +const noNamedGroups = /\ka\kb/; + +// Unicode characters + +// Unicode characters before named group +const unicodeBefore = /šŸ˜€(?a)\k/; + +// Unicode characters after named group +const unicodeAfter = /(?b)\kšŸ˜€/; + +// Unicode characters in between +const unicodeMiddle = /(?.)šŸ˜€\k/; + +// Unicode with bare \k - should error +const unicodeWithBareK = /šŸ˜€(?.)\k/; + +// Unicode without named groups and \k - should be OK +const unicodeNoGroups = /šŸ˜€\kšŸ˜€/;