Skip to content

Commit 0bbf987

Browse files
committed
Add tests for comments in multi-line regexp strings.
1 parent 2d5d68d commit 0bbf987

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

Diff for: test/regexp/python5.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
r'foo#not a comment'
2+
r'''
3+
(?x) # multi-line regexp
4+
foo # comment
5+
'''
6+
R'''
7+
(?x) # not a
8+
foo # comment
9+
'''
10+
11+
12+
13+
r : source.python, storage.type.string.python, string.regexp.quoted.single.python
14+
' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python
15+
foo#not a comment : source.python, string.regexp.quoted.single.python
16+
' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python
17+
r : source.python, storage.type.string.python, string.regexp.quoted.triple.python
18+
''' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.triple.python
19+
: source.python, string.regexp.quoted.triple.python
20+
(?x) : source.python, storage.modifier.flag.regexp, string.regexp.quoted.triple.python
21+
: source.python, string.regexp.quoted.triple.python
22+
# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.triple.python
23+
multi-line regexp : comment.line.number-sign.python, source.python, string.regexp.quoted.triple.python
24+
foo : source.python, string.regexp.quoted.triple.python
25+
# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.triple.python
26+
comment : comment.line.number-sign.python, source.python, string.regexp.quoted.triple.python
27+
''' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.triple.python
28+
R : source.python, storage.type.string.python, string.quoted.triple.raw.python
29+
''' : punctuation.definition.string.begin.python, source.python, string.quoted.triple.raw.python
30+
(?x) # not a : source.python, string.quoted.triple.raw.python
31+
foo # comment : source.python, string.quoted.triple.raw.python
32+
''' : punctuation.definition.string.end.python, source.python, string.quoted.triple.raw.python

Diff for: test/regexp/python6.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
r"foo#not a comment"
2+
r"""
3+
(?x) # multi-line regexp
4+
foo # comment
5+
"""
6+
R"""
7+
(?x) # not a
8+
foo # comment
9+
"""
10+
11+
12+
13+
r : source.python, storage.type.string.python, string.regexp.quoted.double.python
14+
" : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.double.python
15+
foo#not a comment : source.python, string.regexp.quoted.double.python
16+
" : punctuation.definition.string.end.python, source.python, string.regexp.quoted.double.python
17+
r : source.python, storage.type.string.python, string.regexp.quoted.triple.python
18+
""" : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.triple.python
19+
: source.python, string.regexp.quoted.triple.python
20+
(?x) : source.python, storage.modifier.flag.regexp, string.regexp.quoted.triple.python
21+
: source.python, string.regexp.quoted.triple.python
22+
# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.triple.python
23+
multi-line regexp : comment.line.number-sign.python, source.python, string.regexp.quoted.triple.python
24+
foo : source.python, string.regexp.quoted.triple.python
25+
# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.triple.python
26+
comment : comment.line.number-sign.python, source.python, string.regexp.quoted.triple.python
27+
""" : punctuation.definition.string.end.python, source.python, string.regexp.quoted.triple.python
28+
R : source.python, storage.type.string.python, string.quoted.triple.raw.python
29+
""" : punctuation.definition.string.begin.python, source.python, string.quoted.triple.raw.python
30+
(?x) # not a : source.python, string.quoted.triple.raw.python
31+
foo # comment : source.python, string.quoted.triple.raw.python
32+
""" : punctuation.definition.string.end.python, source.python, string.quoted.triple.raw.python

0 commit comments

Comments
 (0)