parent
fe7a462326
commit
1b326ea7a2
|
@ -31,6 +31,10 @@ def _make_string_rules(forbidden=None):
|
||||||
]
|
]
|
||||||
return rules
|
return rules
|
||||||
|
|
||||||
|
class StrictStringGrammar(Grammar):
|
||||||
|
rules = [
|
||||||
|
PatternRule(r'escaped', r"\\'"),
|
||||||
|
]
|
||||||
class StringGrammar(Grammar):
|
class StringGrammar(Grammar):
|
||||||
rules = _make_string_rules()
|
rules = _make_string_rules()
|
||||||
|
|
||||||
|
@ -60,7 +64,7 @@ class PerlGrammar(Grammar):
|
||||||
|
|
||||||
PatternRule(r'comment', r'#.*$'),
|
PatternRule(r'comment', r'#.*$'),
|
||||||
RegionRule(r'perl_string', r'"', StringGrammar, 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"`"),
|
RegionRule(r'evalstring', r"`", StringGrammar, r"`"),
|
||||||
PatternRule(r'number', r'0?\.[0-9]+|[0-9]+(?:\.[0-9]+)?'),
|
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_])"),
|
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_])"),
|
||||||
|
|
Loading…
Reference in New Issue