fixed varname bug and highlighting bug

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-07-24 16:25:15 +00:00
parent 8db9126c65
commit d57ca798bc
1 changed files with 3 additions and 2 deletions

View File

@ -18,11 +18,11 @@ class ShGrammar(Grammar):
PatternRule(r'delimiter', r";;|[\[\]\(\);\{\}|&><]"), PatternRule(r'delimiter', r";;|[\[\]\(\);\{\}|&><]"),
RegionRule(r'eval', '`', StringGrammar, '`'), RegionRule(r'eval', '`', StringGrammar, '`'),
RegionRule(r'neval', r'\$\(', StringGrammar, r'\)'), RegionRule(r'neval', r'\$\(', StringGrammar, r'\)'),
PatternRule(r'variable', r"(?:^|(?<= ))[a-zA-Z_][a-zA-Z_][a-zA-Z0-9_]*(?==)"), PatternRule(r'variable', r"(?:^|(?<= ))[a-zA-Z_][a-zA-Z0-9_]*(?==)"),
PatternRule(r'variable', r"\${(?:[a-zA-Z0-9_]+|\?\$)}"), PatternRule(r'variable', r"\${(?:[a-zA-Z0-9_]+|\?\$)}"),
PatternRule(r"variable", r"\$[^({][a-zA-Z0-9_]*"), PatternRule(r"variable", r"\$[^({][a-zA-Z0-9_]*"),
PatternRule(r'variable', r"\$(?=\()"), PatternRule(r'variable', r"\$(?=\()"),
RegionRule(r'string', "'", Grammar(), "'"), RegionRule(r'string', "'", Grammar, "'"),
RegionRule(r'string', '"', StringGrammar, '"'), RegionRule(r'string', '"', StringGrammar, '"'),
PatternRule(r'comment', r'#.*$'), PatternRule(r'comment', r'#.*$'),
PatternRule(r'bareword', r'[a-zA-Z0-9_-]+'), PatternRule(r'bareword', r'[a-zA-Z0-9_-]+'),
@ -75,6 +75,7 @@ class Sh(mode2.Fundamental):
'string.start': ('green', 'default'), 'string.start': ('green', 'default'),
'string.variable': ('yellow', 'default'), 'string.variable': ('yellow', 'default'),
'string.escaped': ('magenta', 'default'),
'string.null': ('green', 'default'), 'string.null': ('green', 'default'),
'string.end': ('green', 'default'), 'string.end': ('green', 'default'),