Skip to content

Commit 1b35a7f

Browse files
committed
Support u flag for regexp
Fixes #513
1 parent c1e19d3 commit 1b35a7f

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

TypeScript.YAML-tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ repository:
18341834
regex:
18351835
patterns:
18361836
- name: string.regexp.ts
1837-
begin: (?<=[=(:,\[?+!]|return|case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimy]*(?!\s*[a-zA-Z0-9_$]))
1837+
begin: (?<=[=(:,\[?+!]|return|case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimuy]*(?!\s*[a-zA-Z0-9_$]))
18381838
beginCaptures:
18391839
'1': {name: punctuation.definition.string.begin.ts}
18401840
end: (/)([gimuy]*)

TypeScript.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4994,7 +4994,7 @@
49944994
<key>name</key>
49954995
<string>string.regexp.ts</string>
49964996
<key>begin</key>
4997-
<string>(?&lt;=[=(:,\[?+!]|return|case|=&gt;|&amp;&amp;|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimy]*(?!\s*[a-zA-Z0-9_$]))</string>
4997+
<string>(?&lt;=[=(:,\[?+!]|return|case|=&gt;|&amp;&amp;|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimuy]*(?!\s*[a-zA-Z0-9_$]))</string>
49984998
<key>beginCaptures</key>
49994999
<dict>
50005000
<key>1</key>

TypeScriptReact.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4940,7 +4940,7 @@
49404940
<key>name</key>
49414941
<string>string.regexp.tsx</string>
49424942
<key>begin</key>
4943-
<string>(?&lt;=[=(:,\[?+!]|return|case|=&gt;|&amp;&amp;|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimy]*(?!\s*[a-zA-Z0-9_$]))</string>
4943+
<string>(?&lt;=[=(:,\[?+!]|return|case|=&gt;|&amp;&amp;|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimuy]*(?!\s*[a-zA-Z0-9_$]))</string>
49444944
<key>beginCaptures</key>
49454945
<dict>
49464946
<key>1</key>

tests/baselines/Issue513.baseline.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
original file
2+
-----------------------------------
3+
(/a/u);
4+
-----------------------------------
5+
6+
Grammar: TypeScript.tmLanguage
7+
-----------------------------------
8+
>(/a/u);
9+
^
10+
source.ts meta.brace.round.ts
11+
^
12+
source.ts string.regexp.ts punctuation.definition.string.begin.ts
13+
^
14+
source.ts string.regexp.ts
15+
^
16+
source.ts string.regexp.ts punctuation.definition.string.end.ts
17+
^
18+
source.ts string.regexp.ts keyword.other.ts
19+
^
20+
source.ts meta.brace.round.ts
21+
^
22+
source.ts punctuation.terminator.statement.ts

tests/cases/Issue513.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(/a/u);

0 commit comments

Comments
 (0)