-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Inference for Regular Expressions #60249
Open
graphemecluster
wants to merge
31
commits into
microsoft:main
Choose a base branch
from
graphemecluster:regex-type-infer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+91,640
−50,077
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
c44a057
Type Inference for Regular Expressions
graphemecluster c435526
Fix Incorrect Disjunction Alternative Visibility
graphemecluster 24c16f9
Add Test Cases for Duplicate Capturing Group Name
graphemecluster 13cfe15
Performance optimization: Reduce type creation
graphemecluster 6aeac05
Fix incorrect type for `/{0?/` etc. in non-Unicode mode
graphemecluster b828249
Fix: `i` modifier is not removed if no flags are added
graphemecluster bd74623
Remove more redundant literals esp. `"" | string`
graphemecluster a6e0b98
Fix: Incorrect characters included for `/\c/` & `/[\c]/` in Annex B
graphemecluster a31ddcb
Refactor: Rename variables and modify type of reduced union
graphemecluster 42a6568
Refactor: Fast path character classes
graphemecluster 9ce54aa
Refine types for cases where the cross product size is too large
graphemecluster bb0e808
Refactor: Type `RegularExpressionAnyString` as a unique symbol for be…
graphemecluster 524f291
Expand test cases in `regularExpressionLiteralTypes.ts`
graphemecluster 48f86ff
Fix: missing `"-"` in `/[+-]/`
graphemecluster 3ddc5da
Mark `RegExpDigits` as character class (for fast path)
graphemecluster 9dc953c
Correct lib types & Refine type checking test case
graphemecluster 0cf763d
Separate type checking test case into 2 files which tests for differe…
graphemecluster 53425e5
Add test case for `String#matchAll`
graphemecluster 12e875b
Collapse consecutive string types in template literals
graphemecluster 5dfdb56
Merge remote-tracking branch 'upstream/main' into regex-type-infer
graphemecluster 09ad9c3
Fix up all baselines
graphemecluster 61fc428
Fix up all self check errors
graphemecluster 402760c
Separate the type checking test case further
graphemecluster 99355c0
Temporarily exclude `RegExp` & `RegExpExecArray` from `checkNoTypeArg…
graphemecluster 80dd5d0
Revert "Temporarily exclude `RegExp` & `RegExpExecArray` from `checkN…
graphemecluster b251992
Fix self check in a more ugly way due to build issue
graphemecluster 5bd7951
Temporarily slience a few `no-unnecessary-type-assertion` lint lines …
graphemecluster 037ef8e
Fix minor incorrect fix in self check
graphemecluster e51e144
Temporarily shrink type checking test case due to timeout
graphemecluster 2989429
Inline `RegularExpressionAnyString` to avoid `export` keywords in `ty…
graphemecluster 8cc6840
Keep `RegularExpressionAnyString` but export as internal
graphemecluster File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, a new message can’t take the place of an old, unused one right?
(TS1513 never actually appears as TS1161 would have been emitted at the same position if a RegExp is unterminated, so replacing the message shouldn’t cause any problems.)