summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2009-01-03 13:20:49 +0100
committergbrandl <devnull@localhost>2009-01-03 13:20:49 +0100
commitc7652480e4d44ace027bb0ef83d5a8a12e07feba (patch)
tree52776c83d22fbcee401aeb8873d2e60b631f95c0
parent0eacd2de7a66de2f770bd5f37ac3ae0008a9a9e7 (diff)
downloadpygments-c7652480e4d44ace027bb0ef83d5a8a12e07feba.tar.gz
Update Mako lexer from Mako trunk.
-rw-r--r--pygments/lexers/templates.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/pygments/lexers/templates.py b/pygments/lexers/templates.py
index fd84073f..125ecd31 100644
--- a/pygments/lexers/templates.py
+++ b/pygments/lexers/templates.py
@@ -5,7 +5,7 @@
Lexers for various template engines' markup.
- :copyright: 2006-2008 by Armin Ronacher, Georg Brandl, Matt Good,
+ :copyright: 2006-2009 by Armin Ronacher, Georg Brandl, Matt Good,
Ben Bangert.
:license: BSD, see LICENSE for more details.
"""
@@ -412,21 +412,23 @@ class MakoLexer(RegexLexer):
bygroups(Text, Comment.Preproc, Keyword, Other)),
(r'(\s*)(%)([^\n]*)(\n|\Z)',
bygroups(Text, Comment.Preproc, using(PythonLexer), Other)),
- (r'(\s*)(#[^\n]*)(\n|\Z)',
- bygroups(Text, Comment.Preproc, Other)),
- (r'(<%)(def|call|namespace|text)',
+ (r'(\s*)(##[^\n]*)(\n|\Z)',
+ bygroups(Text, Comment.Preproc, Other)),
+ (r'(?s)<%doc>.*?</%doc>', Comment.Preproc),
+ (r'(<%)([\w\.\:]+)',
bygroups(Comment.Preproc, Name.Builtin), 'tag'),
- (r'(</%)(def|call|namespace|text)(>)',
+ (r'(</%)([\w\.\:]+)(>)',
bygroups(Comment.Preproc, Name.Builtin, Comment.Preproc)),
- (r'<%(?=(include|inherit|namespace|page))', Comment.Preproc, 'ondeftags'),
+ (r'<%(?=([\w\.\:]+))', Comment.Preproc, 'ondeftags'),
(r'(<%(?:!?))(.*?)(%>)(?s)',
bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
- (r'(\$\{!?)(.*?)(\})(?s)',
+ (r'(\$\{)(.*?)(\})',
bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
(r'''(?sx)
(.+?) # anything, followed by:
(?:
- (?<=\n)(?=[%#]) | # an eval or comment line
+ (?<=\n)(?=%|##) | # an eval or comment line
+ (?=#\*) | # multiline comment
(?=</?%) | # a python block
# call start or end
(?=\$\{) | # a substitution