Skip to content

Commit 19af47f

Browse files
committed
Simplify regex scopes (drop single/double quote info)
1 parent 6c680fd commit 19af47f

13 files changed

+68
-68
lines changed

Diff for: grammars/MagicPython.YAML-tmLanguage

+2-2
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ repository:
375375
- include: '#regexp-double-quoted-single-line'
376376

377377
regexp-single-quoted-single-line:
378-
name: string.regexp.quoted.single.python
378+
name: string.regexp.quoted.python
379379
begin: \b(([uU]r)|([bB]r)|(r[bB]?))(\')
380380
end: (\')|(?<!\\)(\n)
381381
beginCaptures:
@@ -390,7 +390,7 @@ repository:
390390
- include: '#single-one-regexp-expression'
391391

392392
regexp-double-quoted-single-line:
393-
name: string.regexp.quoted.double.python
393+
name: string.regexp.quoted.python
394394
begin: \b(([uU]r)|([bB]r)|(r[bB]?))(\")
395395
end: (\")|(?<!\\)(\n)
396396
beginCaptures:

Diff for: grammars/MagicPython.cson

+2-2
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ repository:
509509
}
510510
]
511511
"regexp-single-quoted-single-line":
512-
name: "string.regexp.quoted.single.python"
512+
name: "string.regexp.quoted.python"
513513
begin: "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\')"
514514
end: "(\\')|(?<!\\\\)(\\n)"
515515
beginCaptures:
@@ -532,7 +532,7 @@ repository:
532532
}
533533
]
534534
"regexp-double-quoted-single-line":
535-
name: "string.regexp.quoted.double.python"
535+
name: "string.regexp.quoted.python"
536536
begin: "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\\")"
537537
end: "(\\\")|(?<!\\\\)(\\n)"
538538
beginCaptures:

Diff for: grammars/MagicPython.tmLanguage

+2-2
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@
790790
<key>regexp-single-quoted-single-line</key>
791791
<dict>
792792
<key>name</key>
793-
<string>string.regexp.quoted.single.python</string>
793+
<string>string.regexp.quoted.python</string>
794794
<key>begin</key>
795795
<string>\b(([uU]r)|([bB]r)|(r[bB]?))(\&apos;)</string>
796796
<key>end</key>
@@ -842,7 +842,7 @@
842842
<key>regexp-double-quoted-single-line</key>
843843
<dict>
844844
<key>name</key>
845-
<string>string.regexp.quoted.double.python</string>
845+
<string>string.regexp.quoted.python</string>
846846
<key>begin</key>
847847
<string>\b(([uU]r)|([bB]r)|(r[bB]?))(\&quot;)</string>
848848
<key>end</key>

Diff for: test/regexp/python1.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
a : source.python
77
= : keyword.operator.assignment.python, source.python
88
: source.python
9-
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
10-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
11-
[ : constant.other.set.regexp punctuation.character.set.begin.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.single.python
12-
a : constant.character.set.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.single.python
13-
- : constant.character.set.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.single.python
14-
z : constant.character.set.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.single.python
15-
] : constant.other.set.regexp punctuation.character.set.end.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.single.python
16-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
9+
r : source.python, storage.type.string.python, string.regexp.quoted.python
10+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
11+
[ : constant.other.set.regexp punctuation.character.set.begin.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.python
12+
a : constant.character.set.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.python
13+
- : constant.character.set.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.python
14+
z : constant.character.set.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.python
15+
] : constant.other.set.regexp punctuation.character.set.end.regexp, meta.character.set.regexp, source.python, string.regexp.quoted.python
16+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
1717
a : source.python
1818
= : keyword.operator.assignment.python, source.python
1919
: source.python

Diff for: test/regexp/python2.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
a : source.python
99
= : keyword.operator.assignment.python, source.python
1010
: source.python
11-
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
12-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
13-
: invalid.illegal.newline.python, source.python, string.regexp.quoted.single.python
11+
r : source.python, storage.type.string.python, string.regexp.quoted.python
12+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
13+
: invalid.illegal.newline.python, source.python, string.regexp.quoted.python
1414
: source.python
1515
( : punctuation.parenthesis.begin.python, source.python
1616
? : invalid.illegal.character.python, source.python

Diff for: test/regexp/python5.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
a : source.python
1414
= : keyword.operator.assignment.python, source.python
1515
: source.python
16-
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
17-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
18-
foo#not a comment : source.python, string.regexp.quoted.single.python
19-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
16+
r : source.python, storage.type.string.python, string.regexp.quoted.python
17+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
18+
foo#not a comment : source.python, string.regexp.quoted.python
19+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
2020
a : source.python
2121
= : keyword.operator.assignment.python, source.python
2222
: source.python

Diff for: test/regexp/python6.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
a : source.python
1414
= : keyword.operator.assignment.python, source.python
1515
: source.python
16-
r : source.python, storage.type.string.python, string.regexp.quoted.double.python
17-
" : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.double.python
18-
foo#not a comment : source.python, string.regexp.quoted.double.python
19-
" : punctuation.definition.string.end.python, source.python, string.regexp.quoted.double.python
16+
r : source.python, storage.type.string.python, string.regexp.quoted.python
17+
" : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
18+
foo#not a comment : source.python, string.regexp.quoted.python
19+
" : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
2020
a : source.python
2121
= : keyword.operator.assignment.python, source.python
2222
: source.python

Diff for: test/regexp/python7.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
a : source.python
1818
= : keyword.operator.assignment.python, source.python
1919
: source.python
20-
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
21-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
22-
( : punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp, source.python, string.regexp.quoted.single.python
23-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
20+
r : source.python, storage.type.string.python, string.regexp.quoted.python
21+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
22+
( : punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp, source.python, string.regexp.quoted.python
23+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
2424
1 : constant.numeric.dec.python, source.python
2525
: source.python
2626
a : source.python
2727
= : keyword.operator.assignment.python, source.python
2828
: source.python
29-
r : source.python, storage.type.string.python, string.regexp.quoted.double.python
30-
" : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.double.python
31-
( : keyword.operator.lookahead.regexp, punctuation.parenthesis.lookahead.begin.regexp, source.python, string.regexp.quoted.double.python
32-
?= : keyword.operator.lookahead.regexp, source.python, string.regexp.quoted.double.python
33-
" : punctuation.definition.string.end.python, source.python, string.regexp.quoted.double.python
29+
r : source.python, storage.type.string.python, string.regexp.quoted.python
30+
" : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
31+
( : keyword.operator.lookahead.regexp, punctuation.parenthesis.lookahead.begin.regexp, source.python, string.regexp.quoted.python
32+
?= : keyword.operator.lookahead.regexp, source.python, string.regexp.quoted.python
33+
" : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
3434
1 : constant.numeric.dec.python, source.python
3535
: source.python
3636
a : source.python

Diff for: test/regexp/python9.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
a : source.python
66
= : keyword.operator.assignment.python, source.python
77
: source.python
8-
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
9-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
10-
foo : source.python, string.regexp.quoted.single.python
11-
[^] : source.python, string.regexp.quoted.single.python
12-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
8+
r : source.python, storage.type.string.python, string.regexp.quoted.python
9+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
10+
foo : source.python, string.regexp.quoted.python
11+
[^] : source.python, string.regexp.quoted.python
12+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
1313
a : source.python
1414
= : keyword.operator.assignment.python, source.python
1515
: source.python
16-
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
17-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
18-
foo : source.python, string.regexp.quoted.single.python
19-
[] : source.python, string.regexp.quoted.single.python
20-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
16+
r : source.python, storage.type.string.python, string.regexp.quoted.python
17+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
18+
foo : source.python, string.regexp.quoted.python
19+
[] : source.python, string.regexp.quoted.python
20+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python

Diff for: test/strings/bad3.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ def foo(a=1): pass # doesn't break!
88
a : source.python
99
= : keyword.operator.assignment.python, source.python
1010
: source.python
11-
r : source.python, storage.type.string.python, string.regexp.quoted.double.python
12-
" : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.double.python
13-
bad string : source.python, string.regexp.quoted.double.python
14-
: invalid.illegal.newline.python, source.python, string.regexp.quoted.double.python
11+
r : source.python, storage.type.string.python, string.regexp.quoted.python
12+
" : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
13+
bad string : source.python, string.regexp.quoted.python
14+
: invalid.illegal.newline.python, source.python, string.regexp.quoted.python
1515
foo : source.python
1616
\ : separator.continuation.line.python, source.python
1717
' \" \a \b \c \f \n \r \t \v \5 \55 \555 \05 \005" : invalid.illegal.line.continuation.python, source.python

Diff for: test/strings/note1.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
a : source.python
1414
= : keyword.operator.assignment.python, source.python
1515
: source.python
16-
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
17-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
18-
XXX FIXME NB TODO : source.python, string.regexp.quoted.single.python
19-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
16+
r : source.python, storage.type.string.python, string.regexp.quoted.python
17+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
18+
XXX FIXME NB TODO : source.python, string.regexp.quoted.python
19+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
2020
a : source.python
2121
= : keyword.operator.assignment.python, source.python
2222
: source.python

Diff for: test/strings/prefixes1.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@
3030
a : source.python
3131
= : keyword.operator.assignment.python, source.python
3232
: source.python
33-
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
34-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
35-
s t r : source.python, string.regexp.quoted.single.python
36-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
33+
r : source.python, storage.type.string.python, string.regexp.quoted.python
34+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
35+
s t r : source.python, string.regexp.quoted.python
36+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
3737
a : source.python
3838
= : keyword.operator.assignment.python, source.python
3939
: source.python
40-
br : source.python, storage.type.string.python, string.regexp.quoted.single.python
41-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
42-
s t r : source.python, string.regexp.quoted.single.python
43-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
40+
br : source.python, storage.type.string.python, string.regexp.quoted.python
41+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
42+
s t r : source.python, string.regexp.quoted.python
43+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
4444
a : source.python
4545
= : keyword.operator.assignment.python, source.python
4646
: source.python
47-
rb : source.python, storage.type.string.python, string.regexp.quoted.single.python
48-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
49-
s t r : source.python, string.regexp.quoted.single.python
50-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
47+
rb : source.python, storage.type.string.python, string.regexp.quoted.python
48+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
49+
s t r : source.python, string.regexp.quoted.python
50+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python

Diff for: test/strings/prefixes3.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
a : source.python
1212
= : keyword.operator.assignment.python, source.python
1313
: source.python
14-
Ur : invalid.deprecated.prefix.python, source.python, string.regexp.quoted.single.python
15-
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
16-
S T R : source.python, string.regexp.quoted.single.python
17-
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
14+
Ur : invalid.deprecated.prefix.python, source.python, string.regexp.quoted.python
15+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.python
16+
S T R : source.python, string.regexp.quoted.python
17+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.python
1818
a : source.python
1919
= : keyword.operator.assignment.python, source.python
2020
: source.python

0 commit comments

Comments
 (0)