From 733dba727417a1e484d47db22c0a727780100785 Mon Sep 17 00:00:00 2001 From: moculus Date: Fri, 22 Jun 2007 04:37:24 +0000 Subject: [PATCH] bug with q op --HG-- branch : pmacs2 --- mode_perl.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mode_perl.py b/mode_perl.py index 2e4830b..fde8206 100644 --- a/mode_perl.py +++ b/mode_perl.py @@ -57,13 +57,6 @@ class PerlGrammar(Grammar): PatternRule(name=r'hash', pattern=r"%\$*[A-Za-z_](?:[A-Za-z0-9_]|::)*"), PatternRule(name=r'deref', pattern=r"[@%\$&\*](?={)"), - RegionRule(name=r'quoted', start=r'q[rqwx]? *\(', grammar=g, end=r'\)'), - RegionRule(name=r'quoted', start=r'q[rqwx]? *{', grammar=g, end=r'}'), - RegionRule(name=r'quoted', start=r'q[rqwx]? *<', grammar=g, end=r'>'), - RegionRule(name=r'quoted', start=r'q[rqwx]? *\[', grammar=g, end=r'\]'), - RegionRule(name=r'quoted', start=r'q[rqwx]? *(?P[^ #])', grammar=g, end=r'%(delim)s'), - RegionRule(name=r'quoted', start=r'q[rqwx]?#', grammar=g, end=r'#'), - # match regexes RegionRule(name=r'match', start=r'(?:(?<==~)|(?<=!~)|(?<=\()|(?<=split)) *(?P/)', grammar=sg, end=r'/[a-z]*'), RegionRule(name=r'match', start=r'm *(?P[^ #a-zA-Z0-9_])', grammar=sg, end=r'%(delim)s[a-z]*'), @@ -88,6 +81,15 @@ class PerlGrammar(Grammar): PatternRule(name=r'builtin', pattern=r"(?)&?(?:write|warn|wantarray|waitpid|wait|vec|values|utime|use|untie|unshift|unpack|unlink|undef|umask|ucfirst|uc|truncate|times|time|tied|tie|telldir|tell|syswrite|system|sysseek|sysread|sysopen|syscall|symlink|substr|sub|study|stat|srand|sqrt|sprintf|split|splice|sort|socketpair|socket|sleep|sin|shutdown|shmwrite|shmread|shmget|shmctl|shift|setsockopt|setservent|setpwent|setprotoent|setpriority|setpgrp|setnetent|sethostent|setgrent|send|semop|semget|semctl|select|seekdir|seek|scalar|rmdir|rindex|rewinddir|reverse|return|reset|require|rename|ref|redo|recv|readpipe|readlink|readline|readdir|read|rand|quotemeta|push|prototype|printf|print|pos|pop|pipe|package|pack|our|ord|opendir|open|oct|no|next|my|msgsnd|msgrcv|msgget|msgctl|mkdir|map|lstat|log|lock|localtime|local|listen|link|length|lcfirst|lc|last|kill|keys|join|ioctl|int|index|import|hex|grep|goto|gmtime|glob|getsockopt|getsockname|getservent|getservbyport|getservbyname|getpwuid|getpwnam|getpwent|getprotoent|getprotobynumber|getprotobyname|getpriority|getppid|getpgrp|getpeername|getnetent|getnetbyname|getnetbyaddr|getlogin|gethostent|gethostbyname|gethostbyaddr|getgrnam|getgrgid|getgrent|getc|formline|format|fork|flock|fileno|fcntl|exp|exit|exists|exec|eval|eof|endservent|endpwent|endprotoent|endnetent|endhostent|endgrent|each|dump|do|die|delete|defined|dbmopen|dbmclose|crypt|cos|continue|connect|closedir|close|chroot|chr|chown|chop|chomp|chmod|chdir|caller|bless|binmode|bind|atan2|alarm|accept|abs)(?![a-zA-Z0-9_])"), PatternRule(name=r'function', pattern=r"(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*(?= *\()"), PatternRule(name=r'class', pattern=r"(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*(?=->)"), + + # quote operator + RegionRule(name=r'quoted', start=r'q[rqwx]? *\(', grammar=g, end=r'\)'), + RegionRule(name=r'quoted', start=r'q[rqwx]? *{', grammar=g, end=r'}'), + RegionRule(name=r'quoted', start=r'q[rqwx]? *<', grammar=g, end=r'>'), + RegionRule(name=r'quoted', start=r'q[rqwx]? *\[', grammar=g, end=r'\]'), + RegionRule(name=r'quoted', start=r'q[rqwx]? *(?P[^ #])', grammar=g, end=r'%(delim)s'), + RegionRule(name=r'quoted', start=r'q[rqwx]?#', grammar=g, end=r'#'), + # nested regions #RegionRule(name=r'paren', start=r'\(', grammar=None, end=r'\)'), #RegionRule(name=r'brace', start=r'{', grammar=None, end=r'}'),