diff options
author | Georg Brandl <georg@python.org> | 2014-10-15 21:32:31 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-15 21:32:31 +0200 |
commit | 10be9bec8a7969a40d4fa3483b8317e0131b1715 (patch) | |
tree | 7047dd543253b4a5f0002c377cce59e3589a2aeb /pygments/lexers/d.py | |
parent | 6095eb22ab78b1754aeb56d67754cc4cb401e843 (diff) | |
download | pygments-10be9bec8a7969a40d4fa3483b8317e0131b1715.tar.gz |
all lexers: fix unescaped { and } so that the "regex" module can compile our regexes
Diffstat (limited to 'pygments/lexers/d.py')
-rw-r--r-- | pygments/lexers/d.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pygments/lexers/d.py b/pygments/lexers/d.py index c3c3dc1d..3337e66a 100644 --- a/pygments/lexers/d.py +++ b/pygments/lexers/d.py @@ -104,11 +104,11 @@ class DLexer(RegexLexer): (r'q"\[', String, 'delimited_bracket'), (r'q"\(', String, 'delimited_parenthesis'), (r'q"<', String, 'delimited_angle'), - (r'q"{', String, 'delimited_curly'), + (r'q"\{', String, 'delimited_curly'), (r'q"([a-zA-Z_]\w*)\n.*?\n\1"', String), (r'q"(.).*?\1"', String), # -- TokenString - (r'q{', String, 'token_string'), + (r'q\{', String, 'token_string'), # Attributes (r'@([a-zA-Z_]\w*)?', Name.Decorator), # Tokens @@ -127,13 +127,13 @@ class DLexer(RegexLexer): (r'[+/]', Comment.Multiline), ], 'token_string': [ - (r'{', Punctuation, 'token_string_nest'), - (r'}', String, '#pop'), + (r'\{', Punctuation, 'token_string_nest'), + (r'\}', String, '#pop'), include('root'), ], 'token_string_nest': [ - (r'{', Punctuation, '#push'), - (r'}', Punctuation, '#pop'), + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), include('root'), ], 'delimited_bracket': [ @@ -168,13 +168,13 @@ class DLexer(RegexLexer): ], 'delimited_curly': [ (r'[^{}]+', String), - (r'{', String, 'delimited_inside_curly'), - (r'}"', String, '#pop'), + (r'\{', String, 'delimited_inside_curly'), + (r'\}"', String, '#pop'), ], 'delimited_inside_curly': [ (r'[^{}]+', String), - (r'{', String, '#push'), - (r'}', String, '#pop'), + (r'\{', String, '#push'), + (r'\}', String, '#pop'), ], } |