diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-01 11:35:47 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-01 11:35:47 -0400 |
commit | 70f561b14672d87855d7b2255804225b664093c3 (patch) | |
tree | e37f33595b87beb3fb4db5333ef8b14325f03428 | |
parent | e1086cd37e7075102fe9b895372ecacb98732457 (diff) | |
download | mako-70f561b14672d87855d7b2255804225b664093c3.tar.gz |
- [bug] Fixed issue where an old lexer rule prevented a template line
which looked like "#*" from being correctly parsed. [ticket:224]
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | mako/lexer.py | 2 | ||||
-rw-r--r-- | test/test_lexer.py | 6 |
3 files changed, 9 insertions, 2 deletions
@@ -7,6 +7,9 @@ instead of ``# -*- encoding:%s -*-``; the former is more common and compatible with emacs. Courtesy Martin Geisler. +- [bug] Fixed issue where an old lexer rule prevented a template line + which looked like "#*" from being correctly parsed. [ticket:224] + 0.9.0 - [bug] The Context.locals_() method becomes a private underscored method, as this method has a specific internal use. The purpose diff --git a/mako/lexer.py b/mako/lexer.py index 034caf7..42b9ecd 100644 --- a/mako/lexer.py +++ b/mako/lexer.py @@ -345,8 +345,6 @@ class Lexer(object): | (?=\${) # an expression | - (?=\#\*) # multiline comment - | (?=</?[%&]) # a substitution or block or call start or end # - don't consume | diff --git a/test/test_lexer.py b/test/test_lexer.py index 3076de4..3e97bef 100644 --- a/test/test_lexer.py +++ b/test/test_lexer.py @@ -155,6 +155,12 @@ class LexerTest(TemplateTest): ControlLine('if', 'endif', True, (7, 1)), Text(' ', (8, 1))])) + def test_old_multiline_comment(self): + template = """#*""" + node = Lexer(template).parse() + self._compare(node, TemplateNode({}, [Text('''#*''', (1, 1))])) + + def test_text_tag(self): template = \ """ |