parent
fce419293c
commit
0f186f0d9d
48
mode/perl.py
48
mode/perl.py
|
@ -49,9 +49,8 @@ class PodGrammar(Grammar):
|
|||
]
|
||||
|
||||
scalar_rules = [
|
||||
PatternRule('perl.array', r"\@_"),
|
||||
PatternRule('perl.array', r"\@(?= *{)"),
|
||||
PatternRule('perl.array', r'\@[\+\-]'),
|
||||
PatternRule('perl.array', r'\@[_\+\-]'),
|
||||
PatternRule('perl.array', r"\@\$*" + word2),
|
||||
PatternRule('perl.array', r'\$' + word2 + '(?= *\[)'),
|
||||
|
||||
|
@ -60,6 +59,7 @@ scalar_rules = [
|
|||
PatternRule('perl.hash', r"\%\$*" + word2),
|
||||
PatternRule('perl.hash', r'\$' + word2 + '(?= *\{)'),
|
||||
|
||||
PatternRule('perl.hash', r"\$(?= *{)"),
|
||||
PatternRule('perl.scalar', r'\$[_&`\'\+\*\.|,\\";#\%=\-~\^:\?!@\$<>()\[\]](?!' + wchr2 + ')'),
|
||||
PatternRule('perl.scalar', r'\$\d+(?!' + wchr2 +')'),
|
||||
PatternRule('perl.scalar', r'\$\^(?:' + word1 + '|' + wchr1 + ')'),
|
||||
|
@ -238,9 +238,9 @@ PerlGrammar.rules = [
|
|||
|
||||
# quote operator: qq(), qx() and qr() usually interpolate
|
||||
RegionRule('perl.quoted', r'q[rqx] *(?P<delim>\()', MatchGrammar3, r'\)'),
|
||||
RegionRule('perl.quoted', 'q[rqx] *(?P<delim>{)', MatchGrammar4, '}'),
|
||||
RegionRule('perl.quoted', 'q[rqx] *(?P<delim><)', MatchGrammar5, '>'),
|
||||
RegionRule('perl.quoted', r'q[rqx] *(?P<delim>\[)', MatchGrammar6, r'\]'),
|
||||
RegionRule('perl.quoted', r'q[rqx] *(?P<delim>\[)', MatchGrammar4, r'\]'),
|
||||
RegionRule('perl.quoted', 'q[rqx] *(?P<delim>{)', MatchGrammar5, '}'),
|
||||
RegionRule('perl.quoted', 'q[rqx] *(?P<delim><)', MatchGrammar6, '>'),
|
||||
RegionRule('perl.quoted', 'q[rqx](?P<delim>#)', MatchGrammar2, '#'),
|
||||
RegionRule('perl.quoted', 'q[rqx] *(?P<delim>/)', MatchGrammar1, '/'),
|
||||
RegionRule('perl.quoted', 'q[rqx] *(?P<delim>[^ a-zA-Z0-9#])', MatchGrammar0, '%(delim)s'),
|
||||
|
@ -737,35 +737,35 @@ class PerlContext(context.Context):
|
|||
i += 1
|
||||
|
||||
# white is for delimiters, operators, numbers
|
||||
default = ('default', 'default', 'bold')
|
||||
default = ('default', 'default')
|
||||
|
||||
# magenta is for keywords/builtins, translation, globs
|
||||
lo_magenta = ('magenta202', 'default', 'bold')
|
||||
hi_magenta = ('magenta505', 'default', 'bold')
|
||||
lo_magenta = ('magenta202', 'default')
|
||||
hi_magenta = ('magenta505', 'default')
|
||||
|
||||
# red is for comments, pods, endblocks
|
||||
lo_red = ('red300', 'default', 'bold')
|
||||
hi_red = ('red511', 'default', 'bold')
|
||||
lo_red = ('red300', 'default')
|
||||
hi_red = ('red511', 'default')
|
||||
|
||||
# orange are for arrays and hashes
|
||||
hi_orange = ('yellow531', 'default', 'bold')
|
||||
lo_orange = ('yellow520', 'default', 'bold')
|
||||
hi_orange = ('yellow531', 'default')
|
||||
lo_orange = ('yellow520', 'default')
|
||||
|
||||
# yellow is for scalars and prototypes
|
||||
hi_yellow = ('yellow551', 'default', 'bold')
|
||||
lo_yellow = ('yellow330', 'default', 'bold')
|
||||
hi_yellow = ('yellow551', 'default')
|
||||
lo_yellow = ('yellow330', 'default')
|
||||
|
||||
# green is for strings and hash keys
|
||||
lo_green = ('green030', 'default', 'bold')
|
||||
hi_green = ('green050', 'default', 'bold')
|
||||
lo_green = ('green030', 'default')
|
||||
hi_green = ('green050', 'default')
|
||||
|
||||
# cyan is for quotes, evals, regexes, subs
|
||||
lo_cyan = ('cyan033', 'default', 'bold')
|
||||
hi_cyan = ('cyan255', 'default', 'bold')
|
||||
lo_cyan = ('cyan033', 'default')
|
||||
hi_cyan = ('cyan155', 'default')
|
||||
|
||||
# blue is unused
|
||||
lo_blue = ('blue113', 'default', 'bold')
|
||||
hi_blue = ('blue225', 'default', 'bold')
|
||||
lo_blue = ('blue113', 'default')
|
||||
hi_blue = ('blue225', 'default')
|
||||
|
||||
class Perl(Fundamental):
|
||||
name = 'Perl'
|
||||
|
@ -809,10 +809,10 @@ class Perl(Fundamental):
|
|||
'perl.method': hi_cyan,
|
||||
'perl.function': hi_cyan,
|
||||
'perl.label': hi_cyan,
|
||||
'perl.package': hi_cyan,
|
||||
'perl.class': hi_cyan,
|
||||
'perl.use': hi_cyan,
|
||||
'perl.require': hi_cyan,
|
||||
'perl.package': hi_blue,
|
||||
'perl.class': hi_blue,
|
||||
'perl.use': hi_blue,
|
||||
'perl.require': hi_blue,
|
||||
|
||||
# end/data block
|
||||
'endblock.start': hi_red,
|
||||
|
|
Loading…
Reference in New Issue