parent
a6adf2006e
commit
910d4046ac
19
mode/perl.py
19
mode/perl.py
|
@ -33,12 +33,17 @@ def _make_string_rules(forbidden):
|
||||||
]
|
]
|
||||||
return rules
|
return rules
|
||||||
|
|
||||||
class NoParen(Grammar): rules = [PatternRule(r'data', 'r[^\)]+')]
|
class QuotedWords(Grammar): rules = [
|
||||||
class NoBrace(Grammar): rules = [PatternRule(r'data', 'r[^\}]+')]
|
PatternRule(r'data', r'[a-zA-Z0-9_]+'),
|
||||||
class NoBracket(Grammar): rules = [PatternRule(r'data', 'r[^\]]+')]
|
PatternRule(r'eol', r'\n'),
|
||||||
class NoAngle(Grammar): rules = [PatternRule(r'data', 'r[^>]+')]
|
PatternRule(r'spaces', r' +'),
|
||||||
class NoHash(Grammar): rules = [PatternRule(r'data', 'r[^#]+')]
|
]
|
||||||
class DataGrammar(Grammar): rules = [PatternRule(r'data', '.+')]
|
class NoParen(Grammar): rules = [PatternRule(r'data', r'[^)]+')]
|
||||||
|
class NoBrace(Grammar): rules = [PatternRule(r'data', r'[^\}]+')]
|
||||||
|
class NoBracket(Grammar): rules = [PatternRule(r'data', r'[^\]]+')]
|
||||||
|
class NoAngle(Grammar): rules = [PatternRule(r'data', r'[^>]+')]
|
||||||
|
class NoHash(Grammar): rules = [PatternRule(r'data', r'[^#]+')]
|
||||||
|
class DataGrammar(Grammar): rules = [PatternRule(r'data', r'.+')]
|
||||||
|
|
||||||
class StrictStringGrammar(Grammar):
|
class StrictStringGrammar(Grammar):
|
||||||
rules = [
|
rules = [
|
||||||
|
@ -157,7 +162,7 @@ class PerlGrammar(Grammar):
|
||||||
RegionRule(r'quoted', r'q[rqx](?P<delim>#)', StringGrammar, r'#'),
|
RegionRule(r'quoted', r'q[rqx](?P<delim>#)', StringGrammar, r'#'),
|
||||||
|
|
||||||
# quote operator: q() and qw() do not interpolate
|
# quote operator: q() and qw() do not interpolate
|
||||||
RegionRule(r'quoted', r'qw? *\(', NoParen, r'\)'),
|
RegionRule(r'quoted', r'qw? *\(', QuotedWords, r'\)'),
|
||||||
RegionRule(r'quoted', r'qw? *{', NoBrace, r'}'),
|
RegionRule(r'quoted', r'qw? *{', NoBrace, r'}'),
|
||||||
RegionRule(r'quoted', r'qw? *<', NoAngle, r'>'),
|
RegionRule(r'quoted', r'qw? *<', NoAngle, r'>'),
|
||||||
RegionRule(r'quoted', r'qw? *\[', NoBracket, r'\]'),
|
RegionRule(r'quoted', r'qw? *\[', NoBracket, r'\]'),
|
||||||
|
|
Loading…
Reference in New Issue