fixed small sh mode eval highlighting bug
--HG-- branch : pmacs2
This commit is contained in:
parent
9f22f9dbc1
commit
c63e82e9a7
16
mode/sh.py
16
mode/sh.py
|
@ -11,6 +11,16 @@ class StringGrammar(Grammar):
|
|||
PatternRule(r'variable', r"\$(?=\()"),
|
||||
]
|
||||
|
||||
class EvalGrammar(Grammar):
|
||||
rules = [
|
||||
RegionRule(r'string', "'", Grammar, "'"),
|
||||
RegionRule(r'string', '"', StringGrammar, '"'),
|
||||
PatternRule(r'escaped', r'\\.'),
|
||||
PatternRule(r'variable', r"\${(?:[a-zA-Z0-9_]+|\?\$)}"),
|
||||
PatternRule(r"variable", r"\$[^({][a-zA-Z0-9_]*"),
|
||||
PatternRule(r'variable', r"\$(?=\()"),
|
||||
]
|
||||
|
||||
class CaseGrammar(Grammar):
|
||||
rules = [
|
||||
RegionRule(r'stanza', r'.+\)', Grammar, r';;'),
|
||||
|
@ -44,8 +54,10 @@ class ShGrammar(Grammar):
|
|||
RegionRule(r'test', r'test', TestGrammar, r'\n'),
|
||||
RegionRule(r'test2', r'\[', TestGrammar, r'\]'),
|
||||
PatternRule(r'delimiter', r";;|[();{}|&><]"),
|
||||
RegionRule(r'eval', r'`', StringGrammar, r'`'),
|
||||
RegionRule(r'neval', r'\$\(', StringGrammar, r'\)'),
|
||||
#RegionRule(r'eval', r'`', StringGrammar, r'`'),
|
||||
#RegionRule(r'neval', r'\$\(', StringGrammar, r'\)'),
|
||||
RegionRule(r'eval', r'`', EvalGrammar, r'`'),
|
||||
RegionRule(r'neval', r'\$\(', EvalGrammar, r'\)'),
|
||||
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_]*"),
|
||||
|
|
Loading…
Reference in New Issue