From 4d4ce90f738d00916f4b867302ee37dc8ecd1b66 Mon Sep 17 00:00:00 2001 From: guido Date: Sat, 10 Feb 2007 12:06:58 +0100 Subject: [PATCH] [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 --- py/apigen/source/color.py | 2 +- py/apigen/source/testing/test_color.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/py/apigen/source/color.py b/py/apigen/source/color.py index bae333ffe..3c9e59c32 100644 --- a/py/apigen/source/color.py +++ b/py/apigen/source/color.py @@ -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), diff --git a/py/apigen/source/testing/test_color.py b/py/apigen/source/testing/test_color.py index a1c972ce2..412b8ac7c 100644 --- a/py/apigen/source/testing/test_color.py +++ b/py/apigen/source/testing/test_color.py @@ -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'),