diff options
author | Tim Hatch <tim@timhatch.com> | 2014-10-15 22:13:59 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-10-15 22:13:59 -0700 |
commit | 86c2eee37cf292677032e02f553710d4c1eb1f04 (patch) | |
tree | 12de020d6fef10c028344a0fc320a6ab750f48d1 /pygments/lexers/resource.py | |
parent | 78e09bf1384aa4439f56811b08a2b79ddd440b77 (diff) | |
download | pygments-86c2eee37cf292677032e02f553710d4c1eb1f04.tar.gz |
Curly brace escaping, round 1.
These locations were all found by regexlint and done semi-manually, leaving
braces within [] alone (they aren't special in the 'regex' module).
Diffstat (limited to 'pygments/lexers/resource.py')
-rw-r--r-- | pygments/lexers/resource.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pygments/lexers/resource.py b/pygments/lexers/resource.py index 6a9e702e..681c4c6c 100644 --- a/pygments/lexers/resource.py +++ b/pygments/lexers/resource.py @@ -40,7 +40,7 @@ class ResourceLexer(RegexLexer): ], 'string': [ (r'(\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U00[0-9a-fA-F]{6}|' - r'\\[0-7]{1,3}|\\c.|\\[abtnvfre\'"?\\]|\\{|[^"{\\])+', String), + r'\\[0-7]{1,3}|\\c.|\\[abtnvfre\'"?\\]|\\\{|[^"{\\])+', String), (r'\{', String.Escape, 'msgname'), (r'"', String, '#pop') ], @@ -50,7 +50,7 @@ class ResourceLexer(RegexLexer): 'message': [ (r'\{', String.Escape, 'msgname'), (r'\}', String.Escape, '#pop'), - (r'(,)(\s*)([a-zA-Z]+)(\s*})', + (r'(,)(\s*)([a-zA-Z]+)(\s*\})', bygroups(Operator, String.Escape, Keyword, String.Escape), '#pop'), (r'(,)(\s*)([a-zA-Z]+)(\s*)(,)(\s*)(offset)(\s*)(:)(\s*)(-?\d+)(\s*)', bygroups(Operator, String.Escape, Keyword, String.Escape, Operator, @@ -62,9 +62,9 @@ class ResourceLexer(RegexLexer): (r'\s+', String.Escape) ], 'choice': [ - (r'(=|<|>|<=|>=|!=)(-?\d+)(\s*{)', + (r'(=|<|>|<=|>=|!=)(-?\d+)(\s*\{)', bygroups(Operator, Number.Integer, String.Escape), 'message'), - (r'([a-zA-Z]+)(\s*{)', bygroups(Keyword.Type, String.Escape), 'str'), + (r'([a-zA-Z]+)(\s*\{)', bygroups(Keyword.Type, String.Escape), 'str'), (r'\}', String.Escape, ('#pop', '#pop')), (r'\s+', String.Escape) ], |