diff options
author | Tim Hatch <tim@timhatch.com> | 2014-10-06 19:56:15 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-10-06 19:56:15 -0700 |
commit | 594d4043564cd44bc652b1b484ef6ceb5afdd36a (patch) | |
tree | a956823d258ea2118ac6a69179a7e870b2516ec6 /pygments/lexers | |
parent | db54045f07300a47e4a603687fdcef89f29a2b12 (diff) | |
download | pygments-594d4043564cd44bc652b1b484ef6ceb5afdd36a.tar.gz |
SmartyLexer: Support nested curly braces.
Fixes #1039
Diffstat (limited to 'pygments/lexers')
-rw-r--r-- | pygments/lexers/templates.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pygments/lexers/templates.py b/pygments/lexers/templates.py index 67dbc4a7..4a8a89a2 100644 --- a/pygments/lexers/templates.py +++ b/pygments/lexers/templates.py @@ -170,10 +170,11 @@ class SmartyLexer(RegexLexer): ], 'smarty': [ (r'\s+', Text), - (r'\}', Comment.Preproc, '#pop'), + (r'{', Comment.Preproc, '#push'), + (r'}', Comment.Preproc, '#pop'), (r'#[a-zA-Z_]\w*#', Name.Variable), (r'\$[a-zA-Z_]\w*(\.\w+)*', Name.Variable), - (r'[~!%^&*()+=|\[\]:;,.<>/?{}@-]', Operator), + (r'[~!%^&*()+=|\[\]:;,.<>/?@-]', Operator), (r'(true|false|null)\b', Keyword.Constant), (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|" r"0[xX][0-9a-fA-F]+[Ll]?", Number), |