fix some of the worst sh bugs

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2010-09-23 22:34:11 -04:00
parent 8468559e7f
commit 77d6d64602
1 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ CaseGrammar.rules = [
TestGrammar.rules = [ TestGrammar.rules = [
PatternRule(r'spaces', r' +'), PatternRule(r'spaces', r' +'),
PatternRule(r'sh_builtin', r"(?<![-a-zA-Z0-9_])(?:source|alias|bg|bind|break|builtin|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getops|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|readonly|read|return|set|shift|shopt|suspend|test|times|trap|type|ulimit|umask|unalias|unset|wait)(?![a-zA-Z0-9_=/])"), PatternRule(r'sh_builtin', r"(?<![-a-zA-Z0-9_=/])(?:source|alias|bg|bind|break|builtin|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getops|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|readonly|read|return|set|shift|shopt|suspend|times|trap|type|ulimit|umask|unalias|unset|wait)(?![a-zA-Z0-9_=/])"),
PatternRule(r'sh_reserved', r"(?:done|do|elif|else|esac|fi|for|function|if|in|select|then|until|while|time)(?![a-zA-Z0-9_=/])"), PatternRule(r'sh_reserved', r"(?:done|do|elif|else|esac|fi|for|function|if|in|select|then|until|while|time)(?![a-zA-Z0-9_=/])"),
PatternRule(r'binop', r'==|=|!='), PatternRule(r'binop', r'==|=|!='),
PatternRule(r'binop', r'-(?:nt|ot|ef|eq|ne|lt|gt|le|ge)(?!' + char + ')'), PatternRule(r'binop', r'-(?:nt|ot|ef|eq|ne|lt|gt|le|ge)(?!' + char + ')'),
@ -85,7 +85,7 @@ TestGrammar.rules = [
PatternRule(r'continuation', r'\\\n$'), PatternRule(r'continuation', r'\\\n$'),
PatternRule(r'redirect', r'<|>'), PatternRule(r'redirect', r'<|>'),
PatternRule(r'delimiter', r";;|[();{}|&><]"), PatternRule(r'delimiter', r";;|[();{}|&><]"),
RegionRule(r'test', r'test(?![a-zA-Z0-9_=/])', None, r';|\n'), RegionRule(r'test', r'(?<![^ \t])test(?![a-zA-Z0-9_=/])', None, r';|\n'),
RegionRule(r'test2', r'\[\[', None, r'\]\]'), RegionRule(r'test2', r'\[\[', None, r'\]\]'),
RegionRule(r'test3', r'\[', None, r'\]'), RegionRule(r'test3', r'\[', None, r'\]'),
RegionRule(r'eval', r'`', EvalGrammar, r'`'), RegionRule(r'eval', r'`', EvalGrammar, r'`'),
@ -114,7 +114,7 @@ ShGrammar.rules = [
PatternRule(r'sh_reserved', r"(?:done|do|elif|else|esac|fi|for|function|if|in|select|then|until|while|time)(?![a-zA-Z0-9_=/])"), PatternRule(r'sh_reserved', r"(?:done|do|elif|else|esac|fi|for|function|if|in|select|then|until|while|time)(?![a-zA-Z0-9_=/])"),
RegionRule(r'case', r'case', None, 'in', CaseGrammar, r'esac'), RegionRule(r'case', r'case', None, 'in', CaseGrammar, r'esac'),
PatternRule(r'sh_builtin', r"(?<![-a-zA-Z0-9_])(?:source|alias|bg|bind|break|builtin|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getops|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|readonly|read|return|set|shift|shopt|suspend|times|trap|type|ulimit|umask|unalias|unset|wait)(?![a-zA-Z0-9_=/])(?![-a-zA-Z0-9_])"), PatternRule(r'sh_builtin', r"(?<![-a-zA-Z0-9_])(?:source|alias|bg|bind|break|builtin|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getops|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|readonly|read|return|set|shift|shopt|suspend|times|trap|type|ulimit|umask|unalias|unset|wait)(?![a-zA-Z0-9_=/])(?![-a-zA-Z0-9_])"),
RegionRule(r'test', r'test', TestGrammar, r';|\n'), RegionRule(r'test', r'(?<![^ \t])test(?![a-zA-Z0-9_=/])', TestGrammar, r';|\n'),
RegionRule(r'test2', r'\[\[', TestGrammar, r'\]\]'), RegionRule(r'test2', r'\[\[', TestGrammar, r'\]\]'),
RegionRule(r'test3', r'\[', TestGrammar, r'\]'), RegionRule(r'test3', r'\[', TestGrammar, r'\]'),
PatternRule(r'redirect', r'<|>'), PatternRule(r'redirect', r'<|>'),