summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-10-06 19:56:15 -0700
committerTim Hatch <tim@timhatch.com>2014-10-06 19:56:15 -0700
commit594d4043564cd44bc652b1b484ef6ceb5afdd36a (patch)
treea956823d258ea2118ac6a69179a7e870b2516ec6 /pygments
parentdb54045f07300a47e4a603687fdcef89f29a2b12 (diff)
downloadpygments-594d4043564cd44bc652b1b484ef6ceb5afdd36a.tar.gz
SmartyLexer: Support nested curly braces.
Fixes #1039
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/templates.py5
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),