Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Suggested changes to #2026 (Implement RegExp literal syntax checking)#2107

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
graphemecluster wants to merge20 commits intomicrosoft:jabaile/regexp-errors
base:jabaile/regexp-errors
Choose a base branch
Loading
fromgraphemecluster:regexp-errors

Conversation

@graphemecluster
Copy link

@graphemeclustergraphemecluster commentedNov 17, 2025
edited
Loading

The merge target of this PR isjabaile/regexp-errors, notmain. It is intended as a supplement of#2026.
Feel free to fast-forward/cherry-pick/rebase some of the commits here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This file is frommicrosoft/TypeScript#60249; I should've extract the changes out as a separate Strada PR

Comment on lines -1101 to -1102
}else {
v.error(diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash,v.pos,1,string(ch))
Copy link
Author

@graphemeclustergraphemeclusterNov 17, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is removed in order to partially get rid ofmicrosoft/TypeScript#62707 (not a full fix). I won't portmicrosoft/TypeScript#62716 until it gets a minimal review

atomStart:=v.pos
atom:=v.scanClassAtom()
ifv.charAtOffset(0)=='-'&&v.charAtOffset(1)!=']'{
ifv.charAtOffset(0)=='-' {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Redundant check

}
ifv.charAtOffset(0)=='}' {
v.pos++
}elseifhasDigits{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Redundant check

ifv.anyUnicodeModeOrNonAnnexB {
v.error(diagnostics.X_c_must_be_followed_by_an_ASCII_letter,v.pos-2,2)
}elseifatomEscape{
}else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is weird, but in Annex B,\c are really two characters regardless of whether it is an atom escape. I believe it is due to theClassAtomNoDash production.
Also some changes frommicrosoft/TypeScript#60249; didn't file a separate PR due to insignificance.

Comment on lines -621 to +652
ifch!=0&&(scanner.IsIdentifierStart(ch)||ch=='_'||ch=='$') {
ifch!=0&&scanner.IsIdentifierStart(ch) {
v.pos++
forv.pos<v.end {
ch=v.charAtOffset(0)
ifscanner.IsIdentifierPart(ch)||ch=='_'||ch=='$'{
ifscanner.IsIdentifierPart(ch) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Again, some redundant checks


propertyNameOrValueStart:=v.pos
v.scanIdentifier(v.charAtOffset(0))
v.scanWordCharacters(v.charAtOffset(0))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm not sure if your original intention in relaxing the checks was to suppress the "Expected '}'" error when the} appears after a several exotic identifier characters. If so, you might want to revert that commit.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@graphemecluster

[8]ページ先頭

©2009-2025 Movatter.jp