Skip to content

Commit 259d51e

Browse files
committed
Exit matches early if the string is terminating
This can cause a false positive by matching the wrong string type but this is better than leaving the string open.
1 parent 780a970 commit 259d51e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Syntaxes/Regular Expressions (Python).tmLanguage

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
55
<key>comment</key>
@@ -44,7 +44,7 @@
4444
<key>begin</key>
4545
<string>\(\?\#</string>
4646
<key>end</key>
47-
<string>\)</string>
47+
<string>\)|(?="""|''')</string>
4848
<key>name</key>
4949
<string>comment.block.regexp</string>
5050
</dict>
@@ -105,7 +105,7 @@
105105
</dict>
106106
</dict>
107107
<key>end</key>
108-
<string>(\))</string>
108+
<string>(\))|(?="""|''')</string>
109109
<key>endCaptures</key>
110110
<dict>
111111
<key>1</key>
@@ -148,7 +148,7 @@
148148
<key>comment</key>
149149
<string>we can make this more sophisticated to match the | character that separates yes-pattern from no-pattern, but it's not really necessary.</string>
150150
<key>end</key>
151-
<string>(\))</string>
151+
<string>(\))|(?="""|''')</string>
152152
<key>name</key>
153153
<string>meta.group.assertion.conditional.regexp</string>
154154
<key>patterns</key>
@@ -191,7 +191,7 @@
191191
</dict>
192192
</dict>
193193
<key>end</key>
194-
<string>(\))</string>
194+
<string>(\))|(?="""|''')</string>
195195
<key>endCaptures</key>
196196
<dict>
197197
<key>1</key>
@@ -250,7 +250,7 @@
250250
</dict>
251251
</dict>
252252
<key>end</key>
253-
<string>(\])</string>
253+
<string>(\])|(?="""|''')</string>
254254
<key>endCaptures</key>
255255
<dict>
256256
<key>1</key>

0 commit comments

Comments
 (0)