add support for tabs and $/ where possible
--HG-- branch : pmacs2
This commit is contained in:
parent
75bc5f1092
commit
479e64d1e0
|
@ -26,7 +26,7 @@ word1 = wchr1 + wchr2 + '*'
|
|||
word2 = '(?:' + word1 + "(?:'|::))*" + word1
|
||||
pname = '[.a-zA-Z0-9_]+'
|
||||
|
||||
spaces = PatternRule('spaces', ' +')
|
||||
spaces = PatternRule('spaces', '[\t ]+')
|
||||
eol = PatternRule('eol', r'\n')
|
||||
length = PatternRule('perl.length', r"\$#" + word2)
|
||||
|
||||
|
@ -86,6 +86,9 @@ def _make_string_rules(forbidden):
|
|||
else:
|
||||
rules.insert(0, PatternRule('data', "\\$(?=" + forbidden + ')'))
|
||||
|
||||
if forbidden != '/':
|
||||
rules.append(PatternRule('perl.scalar', r'\$/'))
|
||||
|
||||
if forbidden == ')':
|
||||
return rules + [PatternRule('data', r"[^$\%@\(\)]+")]
|
||||
elif forbidden == '}':
|
||||
|
@ -168,7 +171,7 @@ PerlGrammar.rules = [
|
|||
PatternRule('perl.function', r"\$\$*" + word2 + "(?=-> *\()"),
|
||||
|
||||
# special scalar; doesn't interpolate well
|
||||
#PatternRule('perl.scalar', r'\$/'),
|
||||
PatternRule('perl.scalar', r'\$/'),
|
||||
] + scalar_rules + [
|
||||
|
||||
# match regexes; paired delimiters
|
||||
|
|
Loading…
Reference in New Issue