77#
88# To make the location information easier to understand, we generally put each
99# regexp on its own line, even though this is not idiomatic Python.
10- # Comments indicate cases we currently do not handle correctly .
10+ # Comments indicate the found locations relative to the call to `compile` .
1111
1212# plain string
13- re .compile (
13+ re .compile ( # $location=1:2
1414'[this] is a test'
1515)
1616
1717# raw string
18- re .compile (
18+ re .compile ( # $ location=1:3
1919r'[this] is a test'
2020)
2121
2222# byte string
23- re .compile (
23+ re .compile ( # $ location=1:3
2424b'[this] is a test'
2525)
2626
2727# byte raw string
28- re .compile (
28+ re .compile ( # $ location=1:4
2929br'[this] is a test'
3030)
3131
3232# multiline string
33- re .compile (
33+ re .compile ( # $ location=1:4
3434'''[this] is a test'''
3535)
3636
3737# multiline raw string
38- re .compile (
38+ re .compile ( # $ location=1:5
3939r'''[this] is a test'''
4040)
4141
4242# multiline byte string
43- re .compile (
43+ re .compile ( # $ location=1:5
4444b'''[this] is a test'''
4545)
4646
4747# multiline byte raw string
48- re .compile (
48+ re .compile ( # $ location=1:6
4949br'''[this] is a test'''
5050)
5151
52- # plain string with multiple parts (second [this] gets wrong column: 23 instead of 26)
53- re .compile (
52+ # plain string with multiple parts
53+ re .compile ( # $ location=1:2 SPURIOUS:location=1:23 MISSING:location=1:26
5454'[this] is a test' ' and [this] is another test'
5555)
5656
57- # plain string with multiple parts across lines (second [this] gets wrong location: 59:23 instead of 60:7)
58- re .compile (
57+ # plain string with multiple parts across lines
58+ re .compile ( # $ location=1:2 SPURIOUS:location=1:23 MISSING:location=2:7
5959'[this] is a test'
6060' and [this] is another test'
6161)
6262
63- # plain string with multiple parts across lines and comments (second [this] gets wrong location: 65:23 instead of 67:7)
64- re .compile (
63+ # plain string with multiple parts across lines and comments
64+ re .compile ( # $ location=1:2 SPURIOUS:location=1:23 MISSING:location=3:7
6565'[this] is a test'
6666# comment
6767' and [this] is another test'
6868)
6969
70- # actual multiline string (both [this]s get wrong location: 72:6 and 72:27 instead of 73:1 and 74:5)
71- re .compile (
70+ # actual multiline string
71+ re .compile ( # $ SPURIOUS:location=1:6 location=1:27 MISSING:location=2:1 location=3:5
7272r'''
7373[this] is a test
7474and [this] is another test
7575'''
7676)
7777
78- # plain string with escape sequences ([this] gets wrong location: 80:3 instead of 80:4)
79- re .compile (
78+ # plain string with escape sequences
79+ re .compile ( # $ SPURIOUS:location=1:3 MISSING:location=1:4
8080'\t [this] is a test'
8181)
8282
8383# raw string with escape sequences
84- re .compile (
84+ re .compile ( # $ location=1:5
8585r'\A[this] is a test'
8686)
8787
88- # plain string with escaped newline (second [this] gets wrong location: 90:23 instead of 91:6)
89- re .compile (
88+ # plain string with escaped newline
89+ re .compile ( # $ location=1:2 SPURIOUS:location=1:23 MISSING:location=2:6
9090'[this] is a test\
9191 and [this] is another test'
9292)
0 commit comments