diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-11-26 04:19:10 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-11-26 04:19:10 +0000 |
commit | 966517bb9505e847c789e2b64ea934121fb997cd (patch) | |
tree | 86d3e8b962599bfc081919e098c0c37faa31ef10 /lib/mako/lexer.py | |
parent | 063a9d8f6e6da72c101562d0af286b8c1b7f5eb4 (diff) | |
download | external_python_mako-966517bb9505e847c789e2b64ea934121fb997cd.tar.gz external_python_mako-966517bb9505e847c789e2b64ea934121fb997cd.tar.bz2 external_python_mako-966517bb9505e847c789e2b64ea934121fb997cd.zip |
text tag, adding "inheritable" flag to namespace
Diffstat (limited to 'lib/mako/lexer.py')
-rw-r--r-- | lib/mako/lexer.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/mako/lexer.py b/lib/mako/lexer.py index 0b1d2b7..4b59c26 100644 --- a/lib/mako/lexer.py +++ b/lib/mako/lexer.py @@ -103,9 +103,7 @@ class Lexer(object): (\w+) # keyword - \s+ # some space - - ((?:\w+|=|".*?"|'.*?')*) # attrname, = sign, string expression + ((?:\s+\w+|=|".*?"|'.*?')*) # attrname, = sign, string expression \s* # more whitespace @@ -126,14 +124,17 @@ class Lexer(object): self.append_node(parsetree.Tag, keyword, attributes) if isend: self.tag.pop() + else: + if keyword == 'text': + match = self.match(r'.*?(?=\</%text>)', re.S) + if not match: + raise exceptions.SyntaxException("Unclosed tag: <%%%s>" % self.tag[-1].keyword, self.matched_lineno, self.matched_charpos) + return self.match_tag_end() return True else: return False def match_tag_end(self): -# if not len(self.tag): -# return False -# match = self.match(r'\</%\s*(.+?)' + self.tag[-1].keyword + '\s*>') match = self.match(r'\</%\s*(.+?)\s*>') if match: if not len(self.tag): |