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/erlang.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/erlang.py')
-rw-r--r-- | pygments/lexers/erlang.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pygments/lexers/erlang.py b/pygments/lexers/erlang.py index b8ed7ff2..ccd94564 100644 --- a/pygments/lexers/erlang.py +++ b/pygments/lexers/erlang.py @@ -323,9 +323,9 @@ class ElixirLexer(RegexLexer): name_re = r'(?:\.\.\.|[a-z_]%s*[!\?]?)' % alnum modname_re = r'[A-Z]%(alnum)s*(?:\.[A-Z]%(alnum)s*)*' % {'alnum': alnum} complex_name_re = r'(?:%s|%s|%s)' % (name_re, modname_re, ops_re) - special_atom_re = r'(?:\.\.\.|<<>>|%{}|%|{})' + special_atom_re = r'(?:\.\.\.|<<>>|%\{\}|%|\{\})' - long_hex_char_re = r'(\\x{)([\da-fA-F]+)(})' + long_hex_char_re = r'(\\x\{)([\da-fA-F]+)(\})' hex_char_re = r'(\\x[\da-fA-F]{1,2})' escape_char_re = r'(\\[abdefnrstv])' @@ -387,8 +387,8 @@ class ElixirLexer(RegexLexer): include('sigils'), - (r'%{', Punctuation, 'map_key'), - (r'{', Punctuation, 'tuple'), + (r'%\{', Punctuation, 'map_key'), + (r'\{', Punctuation, 'tuple'), ], 'heredoc_double': [ (r'^\s*"""', String.Heredoc, '#pop'), @@ -417,17 +417,17 @@ class ElixirLexer(RegexLexer): (escape_char_re, String.Escape), ], 'interpol': [ - (r'#{', String.Interpol, 'interpol_string'), + (r'#\{', String.Interpol, 'interpol_string'), ], 'interpol_string': [ - (r'}', String.Interpol, "#pop"), + (r'\}', String.Interpol, "#pop"), include('root') ], 'map_key': [ include('root'), (r':', Punctuation, 'map_val'), (r'=>', Punctuation, 'map_val'), - (r'}', Punctuation, '#pop'), + (r'\}', Punctuation, '#pop'), ], 'map_val': [ include('root'), @@ -436,7 +436,7 @@ class ElixirLexer(RegexLexer): ], 'tuple': [ include('root'), - (r'}', Punctuation, '#pop'), + (r'\}', Punctuation, '#pop'), ], } tokens.update(gen_elixir_string_rules('double', '"', String.Double)) |