perl vc support and better scalars
--HG-- branch : pmacs2
This commit is contained in:
parent
4037fe17f3
commit
0b7060c3c9
18
mode/perl.py
18
mode/perl.py
|
@ -47,6 +47,7 @@ def _make_string_rules(forbidden):
|
|||
"(?:->)?\[\$?"+hword+"\]"+ ")+"),
|
||||
PatternRule('length', r"\$#" + word2),
|
||||
PatternRule('scalar', r"\$\$*" + word2),
|
||||
PatternRule('scalar', r"\$[0-9]+"),
|
||||
PatternRule('cast', r"[\$\@\%\&]{.+?}"),
|
||||
PatternRule('array', r"@\$*" + word2),
|
||||
]
|
||||
|
@ -107,8 +108,8 @@ class PerlGrammar(Grammar):
|
|||
PatternMatchRule('x', '(sub)( +)(' + word2 +
|
||||
r')( *)(\()( *)([\[\]\\@$%&*;]+)( *)(\))',
|
||||
'perl.keyword', 'spaces', 'perl.sub', 'spaces',
|
||||
'perl.delimiter', 'spaces', 'perl.prototype',
|
||||
'spaces', 'perl.delimiter'),
|
||||
'delimiter', 'spaces', 'perl.prototype',
|
||||
'spaces', 'delimiter'),
|
||||
|
||||
PatternRule('perl.comment', '#.*$'),
|
||||
RegionRule('perl.string', '"', StringGrammar, '"'),
|
||||
|
@ -125,6 +126,7 @@ class PerlGrammar(Grammar):
|
|||
wchr2 + ")"),
|
||||
PatternRule('perl.array', "@_"),
|
||||
PatternRule('perl.function', r"\$\$*" + word2 + "(?=-> *\()"),
|
||||
PatternRule('perl.scalar', r"\$[0-9]+"),
|
||||
PatternRule('perl.scalar', r"\$\$*" + word2),
|
||||
PatternRule('perl.array', r"@\$*" + word2),
|
||||
PatternRule('perl.hash', r"%\$*" + word2),
|
||||
|
@ -206,7 +208,7 @@ class PerlGrammar(Grammar):
|
|||
PatternRule('perl.class', word2 + "(?=->)"),
|
||||
|
||||
# some basic stuff
|
||||
PatternRule('perl.delimiter', r"::|->|=>|(?<!:):(?!=:)|[,;=\?(){}\[\]\(\)]"),
|
||||
PatternRule('delimiter', r"::|->|=>|(?<!:):(?!=:)|[,;=\?(){}\[\]\(\)]"),
|
||||
PatternRule('perl.noperator', "-[rwxoRWXOezsfdlpSbctugkTBMAC](?!" +
|
||||
wchr2 + ")"),
|
||||
PatternRule('perl.operator', r"\+=|-=|\*=|/=|//=|%=|&=\|\^=|>>=|<<=|\*\*=|\\"),
|
||||
|
@ -220,11 +222,11 @@ class PerlGrammar(Grammar):
|
|||
|
||||
class PerlTabber2(StackTabber2):
|
||||
is_ignored_tokens = ('spaces', 'eol', 'perl.comment')
|
||||
open_tokens = {'perl.delimiter': {'{': '}', '(': ')', '[': ']'}}
|
||||
close_tokens = {'perl.delimiter': {'}': '{', ')': '(', ']': '['}}
|
||||
open_tokens = {'delimiter': {'{': '}', '(': ')', '[': ']'}}
|
||||
close_tokens = {'delimiter': {'}': '{', ')': '(', ']': '['}}
|
||||
end_at_eof = False
|
||||
end_at_tokens = {'perl.delimiter': {';': 1}}
|
||||
nocontinue_tokens = {'perl.delimiter': {';': 1, ',': 1, '}': 1},
|
||||
end_at_tokens = {'delimiter': {';': 1}}
|
||||
nocontinue_tokens = {'delimiter': {';': 1, ',': 1, '}': 1},
|
||||
'perl.heredoc.end': 1,
|
||||
'perl.evaldoc.end': 1, 'perl.pod.end': 1}
|
||||
start_free_tokens = {'perl.string.start': 1, 'perl.pod.start': 1,
|
||||
|
@ -788,7 +790,7 @@ class Perl(Fundamental):
|
|||
completers = {
|
||||
'perlfunction': PerlFunctionCompleter(None),
|
||||
}
|
||||
format = "%(flag)s %(bname)-18s (%(mname)s) %(indent)s %(cursor)s %(perc)s [%(func)s]"
|
||||
format = "%(flag)s %(bname)-18s (%(mname)s) %(indent)s %(cursor)s %(perc)s [%(func)s] %(vc-info)s"
|
||||
_bindings = {
|
||||
'perl-set-lib': ('C-c l',),
|
||||
'perl-check-syntax': ('C-c s',),
|
||||
|
|
Loading…
Reference in New Issue