]> git.wh0rd.org Git - nano.git/commitdiff
Improving two magic regexes.
authorBenno Schulenberg <bensberg@justemail.net>
Wed, 14 May 2014 11:16:40 +0000 (11:16 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Wed, 14 May 2014 11:16:40 +0000 (11:16 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4885 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
doc/syntax/perl.nanorc
doc/syntax/xml.nanorc

index b3b770789bc2e1c69dd8b9c5b0754e403501fbfd..10d2b5d185b1a25c675be79b978ce626a9e0e315 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
        * src/color.c (color_update): Move magic check to after headerline.
        * src/color.c (color_update): Open the magic database only when
        actually going to use it, and close it afterward.
+       * doc/syntax/{perl.nanorc,xml.nanorc}: Improve two magic regexes.
 
 2014-05-13  Benno Schulenberg  <bensberg@justemail.net>
        * src/text.c (do_linter): Make an error message somewhat clearer.
index 21acb14588abd7c4396dc4f4c417a91e4eb6a494..a5bebf247a6a888f22808e32a4b991c8328e4056 100644 (file)
@@ -1,8 +1,8 @@
 ## Here is an example for Perl.
-##
 syntax "perl" "\.p[lm]$"
-magic "perl.*script text"
 header "^#!.*/perl[-0-9._]*"
+magic "Perl script text"
+
 color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
 color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
 icolor cyan start="[$@%]" end="( |[^0-9A-Z_]|-)"
index 1445a6505e953b5cef101e1d29aaf5989181172e..69982ea86678b77cf4a64cf23ec6587573059d48 100644 (file)
@@ -1,7 +1,8 @@
 ## Here is an example for XML files.
-##
+
 syntax "xml" "\.([jrs]html?|sgml?|xml|xslt?)$"
-magic "XML.*document text"
+magic "(XML|SGML) (sub)?document text"
+
 color green  start="<" end=">"
 color cyan   "<[^> ]+"
 color cyan   ">"