[svn r38362] Fixed stupidity in the last checkin: only matching multi-line strings using
slashes if the slash is actually at the end of the line... :( --HG-- branch : trunk
This commit is contained in:
parent
e04e08718f
commit
4d4ce90f73
|
@ -71,7 +71,7 @@ class Tokenizer(object):
|
|||
j = schema.linejoin
|
||||
for d in schema.string + schema.multiline_string:
|
||||
self._re_strings_multiline.append(
|
||||
(re.compile('%s.*%s' % (d, j)),
|
||||
(re.compile('%s.*%s$' % (d, j)),
|
||||
re.compile('.*?%s' % (d,))))
|
||||
for d in schema.multiline_string:
|
||||
self._re_strings_multiline.append((re.compile('%s.*' % (d,), re.S),
|
||||
|
|
|
@ -83,6 +83,8 @@ class TestTokenizer(object):
|
|||
assert res == [Token("bar'", type='string')]
|
||||
res = list(t.tokenize("bar"))
|
||||
assert res == [Token('bar', type='word')]
|
||||
res = list(t.tokenize('"foo\\bar"'))
|
||||
assert res == [Token('"foo\\bar"', type="string")]
|
||||
|
||||
def test_string_following_printable(self):
|
||||
assert self.tokens('."foo"') == [Token('.', type='unknown'),
|
||||
|
|
Loading…
Reference in New Issue