perl bugfix

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-06-04 20:11:40 +00:00
parent fe7a462326
commit 1b326ea7a2
1 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,10 @@ def _make_string_rules(forbidden=None):
]
return rules
class StrictStringGrammar(Grammar):
rules = [
PatternRule(r'escaped', r"\\'"),
]
class StringGrammar(Grammar):
rules = _make_string_rules()
@ -60,7 +64,7 @@ class PerlGrammar(Grammar):
PatternRule(r'comment', r'#.*$'),
RegionRule(r'perl_string', r'"', StringGrammar, r'"'),
RegionRule(r'perl_string', r"'", Grammar, r"'"),
RegionRule(r'perl_string', r"'", StrictStringGrammar, r"'"),
RegionRule(r'evalstring', r"`", StringGrammar, r"`"),
PatternRule(r'number', r'0?\.[0-9]+|[0-9]+(?:\.[0-9]+)?'),
PatternRule(r'perl_keyword', r"(?<!->)(?:STDIN|STDERR|STDOUT|continue|do|else|elsif|eval|foreach|for|if|last|my|next|our|package|require|return|sub|undef|unless|until|use|while)(?![a-zA-Z0-9_])"),