Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c44a057
Type Inference for Regular Expressions
graphemecluster Oct 17, 2024
c435526
Fix Incorrect Disjunction Alternative Visibility
graphemecluster Nov 4, 2024
24c16f9
Add Test Cases for Duplicate Capturing Group Name
graphemecluster Nov 4, 2024
13cfe15
Performance optimization: Reduce type creation
graphemecluster Nov 6, 2024
6aeac05
Fix incorrect type for `/{0?/` etc. in non-Unicode mode
graphemecluster Nov 7, 2024
b828249
Fix: `i` modifier is not removed if no flags are added
graphemecluster Nov 7, 2024
bd74623
Remove more redundant literals esp. `"" | string`
graphemecluster Nov 7, 2024
a6e0b98
Fix: Incorrect characters included for `/\c/` & `/[\c]/` in Annex B
graphemecluster Nov 8, 2024
a31ddcb
Refactor: Rename variables and modify type of reduced union
graphemecluster Nov 8, 2024
42a6568
Refactor: Fast path character classes
graphemecluster Nov 9, 2024
9ce54aa
Refine types for cases where the cross product size is too large
graphemecluster Nov 9, 2024
bb0e808
Refactor: Type `RegularExpressionAnyString` as a unique symbol for be…
graphemecluster Nov 9, 2024
524f291
Expand test cases in `regularExpressionLiteralTypes.ts`
graphemecluster Nov 9, 2024
48f86ff
Fix: missing `"-"` in `/[+-]/`
graphemecluster Nov 9, 2024
3ddc5da
Mark `RegExpDigits` as character class (for fast path)
graphemecluster Nov 9, 2024
9dc953c
Correct lib types & Refine type checking test case
graphemecluster Nov 10, 2024
0cf763d
Separate type checking test case into 2 files which tests for differe…
graphemecluster Nov 10, 2024
53425e5
Add test case for `String#matchAll`
graphemecluster Nov 10, 2024
12e875b
Collapse consecutive string types in template literals
graphemecluster Nov 10, 2024
5dfdb56
Merge remote-tracking branch 'upstream/main' into regex-type-infer
graphemecluster Nov 10, 2024
09ad9c3
Fix up all baselines
graphemecluster Nov 10, 2024
61fc428
Fix up all self check errors
graphemecluster Nov 10, 2024
402760c
Separate the type checking test case further
graphemecluster Nov 10, 2024
99355c0
Temporarily exclude `RegExp` & `RegExpExecArray` from `checkNoTypeArg…
graphemecluster Nov 10, 2024
80dd5d0
Revert "Temporarily exclude `RegExp` & `RegExpExecArray` from `checkN…
graphemecluster Nov 10, 2024
b251992
Fix self check in a more ugly way due to build issue
graphemecluster Nov 10, 2024
5bd7951
Temporarily slience a few `no-unnecessary-type-assertion` lint lines …
graphemecluster Nov 10, 2024
037ef8e
Fix minor incorrect fix in self check
graphemecluster Nov 10, 2024
e51e144
Temporarily shrink type checking test case due to timeout
graphemecluster Nov 10, 2024
2989429
Inline `RegularExpressionAnyString` to avoid `export` keywords in `ty…
graphemecluster Nov 12, 2024
8cc6840
Keep `RegularExpressionAnyString` but export as internal
graphemecluster Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2816,10 +2816,8 @@ export interface RegularExpressionDisjunctionsScope extends Array<RegularExpress
currentAlternativeIndex: number;
}

type RegularExpressionAnyString = typeof RegExpAnyString;

/** @internal */
export type RegularExpressionPatternContent = string | RegularExpressionAnyString | RegularExpressionPatternUnion;
export type RegularExpressionPatternContent = string | typeof RegExpAnyString | RegularExpressionPatternUnion;

/** @internal */
export interface RegularExpressionPattern extends Array<RegularExpressionPatternContent> {
Expand All @@ -2835,15 +2833,15 @@ export interface RegularExpressionPatternUnion extends Set<string | RegularExpre
}

/** @internal */
export type RegularExpressionReducedContent = string | RegularExpressionAnyString | RegularExpressionReducedUnion | RegularExpressionReducedPattern;
export type RegularExpressionReducedContent = string | typeof RegExpAnyString | RegularExpressionReducedUnion | RegularExpressionReducedPattern;

/** @internal */
export interface RegularExpressionReducedUnion extends Set<string | RegularExpressionReducedPattern> {
_regularExpressionReducedUnionBrand: any;
}

/** @internal */
export interface RegularExpressionReducedPattern extends Array<string | RegularExpressionAnyString> {
export interface RegularExpressionReducedPattern extends Array<string | typeof RegExpAnyString> {
_regularExpressionReducedPatternBrand: any;
}

Expand Down
Loading
Loading