diff --git a/mode/sh.py b/mode/sh.py index 0b84169..fcaf7dd 100644 --- a/mode/sh.py +++ b/mode/sh.py @@ -18,11 +18,11 @@ class ShGrammar(Grammar): PatternRule(r'delimiter', r";;|[\[\]\(\);\{\}|&><]"), RegionRule(r'eval', '`', StringGrammar, '`'), 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"\$(?=\()"), - RegionRule(r'string', "'", Grammar(), "'"), + RegionRule(r'string', "'", Grammar, "'"), RegionRule(r'string', '"', StringGrammar, '"'), PatternRule(r'comment', r'#.*$'), PatternRule(r'bareword', r'[a-zA-Z0-9_-]+'), @@ -75,6 +75,7 @@ class Sh(mode2.Fundamental): 'string.start': ('green', 'default'), 'string.variable': ('yellow', 'default'), + 'string.escaped': ('magenta', 'default'), 'string.null': ('green', 'default'), 'string.end': ('green', 'default'),