diff options
author | Gaurav Jain <gaurav@gauravjain.org> | 2014-05-12 11:55:29 -0400 |
---|---|---|
committer | Gaurav Jain <gaurav@gauravjain.org> | 2014-05-12 11:55:29 -0400 |
commit | 5bf77f380a525c335d9b76c34fade5b899ff86c0 (patch) | |
tree | 1467bdc96e5c74c4bc38e8b324de6e3c75a761ec /pygments/lexers/compiled.py | |
parent | 771db94c213953091daa4c1c73ec7f7e4a40dde9 (diff) | |
download | pygments-5bf77f380a525c335d9b76c34fade5b899ff86c0.tar.gz |
Fixed incorrect replacement in compressed regex expressions
Diffstat (limited to 'pygments/lexers/compiled.py')
-rw-r--r-- | pygments/lexers/compiled.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index d4615048..a34d5ee0 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -1417,26 +1417,26 @@ def objective(baselexer): ], 'oc_classname' : [ # interface definition that inherits - ('([a-zA-Z$_][w$]*)(\s*:\s*)([a-zA-Z$_][w$]*)?(\s*)({)', + ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)({)', bygroups(Name.Class, Text, Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')), - ('([a-zA-Z$_][w$]*)(\s*:\s*)([a-zA-Z$_][w$]*)?', + ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?', bygroups(Name.Class, Text, Name.Class), '#pop'), # interface definition for a category - ('([a-zA-Z$_][w$]*)(\s*)(\([a-zA-Z$_][w$]*\))(\s*)({)', + ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)({)', bygroups(Name.Class, Text, Name.Label, Text, Punctuation), ('#pop', 'oc_ivars')), - ('([a-zA-Z$_][w$]*)(\s*)(\([a-zA-Z$_][w$]*\))', + ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))', bygroups(Name.Class, Text, Name.Label), '#pop'), # simple interface / implementation - ('([a-zA-Z$_][w$]*)(\s*)({)', + ('([a-zA-Z$_][\w$]*)(\s*)({)', bygroups(Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')), - ('([a-zA-Z$_][w$]*)', Name.Class, '#pop') + ('([a-zA-Z$_][\w$]*)', Name.Class, '#pop') ], 'oc_forward_classname' : [ - ('([a-zA-Z$_][w$]*)(\s*,\s*)', + ('([a-zA-Z$_][\w$]*)(\s*,\s*)', bygroups(Name.Class, Text), 'oc_forward_classname'), - ('([a-zA-Z$_][w$]*)(\s*;?)', + ('([a-zA-Z$_][\w$]*)(\s*;?)', bygroups(Name.Class, Text), '#pop') ], 'oc_ivars' : [ @@ -1450,7 +1450,7 @@ def objective(baselexer): # methods (r'^([-+])(\s*)' # method marker r'(\(.*?\))?(\s*)' # return type - r'([a-zA-Z$_][w$]*:?)', # begin of method name + r'([a-zA-Z$_][\w$]*:?)', # begin of method name bygroups(Punctuation, Text, using(this), Text, Name.Function), 'method'), @@ -1462,9 +1462,9 @@ def objective(baselexer): # discussion in Issue 789 (r',', Punctuation), (r'\.\.\.', Punctuation), - (r'(\(.*?\))(\s*)([a-zA-Z$_][w$]*)', + (r'(\(.*?\))(\s*)([a-zA-Z$_][\w$]*)', bygroups(using(this), Text, Name.Variable)), - (r'[a-zA-Z$_][w$]*:', Name.Function), + (r'[a-zA-Z$_][\w$]*:', Name.Function), (';', Punctuation, '#pop'), ('{', Punctuation, 'function'), ('', Text, '#pop'), @@ -3838,12 +3838,12 @@ class LogosLexer(ObjectiveCppLexer): tokens = { 'statements': [ (r'(%orig|%log)\b', Keyword), - (r'(%c)\b(\()(\s*)([a-zA-Z$_][w$]*)(\s*)(\))', + (r'(%c)\b(\()(\s*)([a-zA-Z$_][\w$]*)(\s*)(\))', bygroups(Keyword, Punctuation, Text, Name.Class, Text, Punctuation)), (r'(%init)\b(\()', bygroups(Keyword, Punctuation), 'logos_init_directive'), (r'(%init)(?=\s*;)', bygroups(Keyword)), - (r'(%hook|%group)(\s+)([a-zA-Z$_][w$]+)', + (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)', bygroups(Keyword, Text, Name.Class), '#pop'), (r'(%subclass)(\s+)', bygroups(Keyword, Text), ('#pop', 'logos_classname')), @@ -3852,20 +3852,20 @@ class LogosLexer(ObjectiveCppLexer): 'logos_init_directive' : [ ('\s+', Text), (',', Punctuation, ('logos_init_directive', '#pop')), - ('([a-zA-Z$_][w$]*)(\s*)(=)(\s*)([^);]*)', + ('([a-zA-Z$_][\w$]*)(\s*)(=)(\s*)([^);]*)', bygroups(Name.Class, Text, Punctuation, Text, Text)), - ('([a-zA-Z$_][w$]*)', Name.Class), + ('([a-zA-Z$_][\w$]*)', Name.Class), ('\)', Punctuation, '#pop'), ], 'logos_classname' : [ - ('([a-zA-Z$_][w$]*)(\s*:\s*)([a-zA-Z$_][w$]*)?', + ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?', bygroups(Name.Class, Text, Name.Class), '#pop'), - ('([a-zA-Z$_][w$]*)', Name.Class, '#pop') + ('([a-zA-Z$_][\w$]*)', Name.Class, '#pop') ], 'root': [ (r'(%subclass)(\s+)', bygroups(Keyword, Text), 'logos_classname'), - (r'(%hook|%group)(\s+)([a-zA-Z$_][w$]+)', + (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)', bygroups(Keyword, Text, Name.Class)), (r'(%config)(\s*\(\s*)(\w+)(\s*=\s*)(.*?)(\s*\)\s*)', bygroups(Keyword, Text, Name.Variable, Text, String, Text)), |