From 636e9ac3e8786762a9e43008275ed9c70c1a25b8 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 3 Nov 2018 21:12:44 +0100 Subject: [PATCH] syntaxes: remove several redundant end-of-line anchors from regexes --- syntax/changelog.nanorc | 2 +- syntax/elisp.nanorc | 2 +- syntax/gentoo.nanorc | 6 +++--- syntax/groff.nanorc | 2 +- syntax/guile.nanorc | 2 +- syntax/json.nanorc | 2 +- syntax/man.nanorc | 6 +++--- syntax/mgp.nanorc | 6 +++--- syntax/nanorc.nanorc | 8 ++++---- syntax/nftables.nanorc | 2 +- syntax/po.nanorc | 2 +- syntax/postgresql.nanorc | 6 +++--- syntax/python.nanorc | 2 +- syntax/ruby.nanorc | 4 ++-- syntax/sh.nanorc | 2 +- syntax/spec.nanorc | 2 +- syntax/texinfo.nanorc | 4 ++-- 17 files changed, 30 insertions(+), 30 deletions(-) diff --git a/syntax/changelog.nanorc b/syntax/changelog.nanorc index cd76d1a9..bf442425 100644 --- a/syntax/changelog.nanorc +++ b/syntax/changelog.nanorc @@ -3,7 +3,7 @@ syntax changelog "Change[Ll]og[^/]*$" # Author lines. -color green "^(19|20).*$" +color green "^(19|20).*" # Dates. color red "^(19|20)[0-9-]{8}" # Email addresses. diff --git a/syntax/elisp.nanorc b/syntax/elisp.nanorc index a5f69e67..0622bd69 100644 --- a/syntax/elisp.nanorc +++ b/syntax/elisp.nanorc @@ -30,4 +30,4 @@ color blue ":(\w|[?-])+" color yellow start="^[[:blank:]]+\"" end="[^\]\"" color yellow ""(\\.|[^"])*"" # Comments -color cyan "(^|[[:space:]]);.*$" +color cyan "(^|[[:space:]]);.*" diff --git a/syntax/gentoo.nanorc b/syntax/gentoo.nanorc index 937470d9..e9d178dd 100644 --- a/syntax/gentoo.nanorc +++ b/syntax/gentoo.nanorc @@ -39,7 +39,7 @@ color brightblue "\" ## Common commands used in ebuilds: color blue "\<(awk|cat|cd|chmod|chown|cp|echo|env|find|e?grep|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|unset|xargs)\>" ## Comments (doesn't work that well): -color yellow "(^|[[:space:]])#.*$" +color yellow "(^|[[:space:]])#.*" ## Strings (doesn't work that well): color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'" ## Trailing space is bad! @@ -52,7 +52,7 @@ syntax /etc/portage "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$" comment "#" ## Base text: -color green "^.+$" +color green ".+" ## Likely version and slot numbers: color magenta "-[[:digit:].]+(_(alpha|beta|pre|rc|p)[[:digit:]]*)*(-r[[:digit:]]+)?([:[:space:]]|$)" color magenta ":[^[:space:]]+([[:space:]]|$)" @@ -67,7 +67,7 @@ color cyan "^[[:space:]]*[^/]*/" ## Masking regulators: color brightmagenta "^[[:space:]]*(=|~|<|<=|>|>=)" ## Comments: -color yellow "#.*$" +color yellow "#.*" ## Trailing space is bad! color ,green "[[:space:]]+$" ## Mixed whitespace is also bad. diff --git a/syntax/groff.nanorc b/syntax/groff.nanorc index 00c9a964..a24c40bd 100644 --- a/syntax/groff.nanorc +++ b/syntax/groff.nanorc @@ -15,7 +15,7 @@ color cyan start="(\\|\\\\)n\[" end="]" # Requests color brightgreen "^\.[[:space:]]*[^[:space:]]*" # Comments -color yellow "^\.\\".*$" +color yellow "^\.\\".*" # Strings color green "(\\|\\\\)\*(.|\(..)" color green start="(\\|\\\\)\*\[" end="]" diff --git a/syntax/guile.nanorc b/syntax/guile.nanorc index aafada07..c7db3ded 100644 --- a/syntax/guile.nanorc +++ b/syntax/guile.nanorc @@ -21,4 +21,4 @@ color blue "#?:(\w|[?-])+" color yellow start="^[[:blank:]]+\"" end="[^\]\"" color yellow ""(\\.|[^"])*"" # Comments -color cyan "(^|[[:space:]]);.*$" +color cyan "(^|[[:space:]]);.*" diff --git a/syntax/json.nanorc b/syntax/json.nanorc index 293add24..185c08f3 100644 --- a/syntax/json.nanorc +++ b/syntax/json.nanorc @@ -28,7 +28,7 @@ color brightred "\{" "\}" color brightred "," ":" # Comments. -color cyan "(^|[[:space:]]+)(//|#).*$" +color cyan "(^|[[:space:]]+)(//|#).*" # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/syntax/man.nanorc b/syntax/man.nanorc index 2c999d7d..bb2b02dd 100644 --- a/syntax/man.nanorc +++ b/syntax/man.nanorc @@ -4,15 +4,15 @@ syntax man "\.[1-9]x?$" magic "troff or preprocessor input" comment ".\"" -color green "\.(SH|SS|TH) .*$" +color green "\.(SH|SS|TH) .*" color brightgreen "\.(SH|SS|TH) " "\.([HIT]P)" -color brightred "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*$" +color brightred "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*" color brightblue "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) " "\.([LP]?P)$" color magenta "\\f[BIPR]" color yellow "\.(br|DT|RS|RE|PD)" # Comments. -color cyan "\.?\\\".*$" +color cyan "\.?\\\".*" # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/syntax/mgp.nanorc b/syntax/mgp.nanorc index e460e7a8..a030b1cc 100644 --- a/syntax/mgp.nanorc +++ b/syntax/mgp.nanorc @@ -4,7 +4,7 @@ syntax mgp "\.mgp$" header "^%include.*" comment "#" -icolor green "^%[a-z].*$" -color cyan "(^|[[:space:]])#.*$" -color cyan "(^|[[:space:]])%%.*$" +icolor green "^%[a-z].*" +color cyan "(^|[[:space:]])#.*" +color cyan "(^|[[:space:]])%%.*" color ,green "[[:space:]]+$" diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc index 1ca8b913..2b83978f 100644 --- a/syntax/nanorc.nanorc +++ b/syntax/nanorc.nanorc @@ -4,7 +4,7 @@ syntax nanorc "\.?nanorc$" comment "#" # Possible errors and parameters -icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|i?color|extendsyntax).*$" +icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|i?color|extendsyntax).*" # Keywords icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|backwards|boldtext|casesensitive|constantshow|cutfromcursor|fill[[:space:]]+-?[[:digit:]]+|historylog|linenumbers|locking|morespace|mouse|multibuffer|noconvert|nohelp|nopauses|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabsize[[:space:]]+[1-9][0-9]*|tabstospaces|tempfile|trimblanks|unix|view|wordbounds)\>" @@ -12,7 +12,7 @@ icolor yellow "^[[:space:]]*set[[:space:]]+((error|function|key|number|selected| icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|selectedcolor|speller|statuscolor|titlecolor|whitespace|wordchars)[[:space:]]+" icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^([[:alpha:]]|[]@\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+([[:alpha:]]+|".*")[[:space:]]+(all|main|search|replace(with)?|yesno|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)" icolor brightgreen "^[[:space:]]*unbind[[:space:]]+((\^([[:alpha:]]|[]@\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+(all|main|search|replace(with)?|yesno|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)" -icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|comment|linter)[[:space:]]+.*$" +icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|comment|linter)[[:space:]]+.*" icolor brightgreen "^[[:space:]]*(syntax|linter)[[:space:]]+[^[:blank:]]+" icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|extendsyntax)\>" @@ -24,8 +24,8 @@ icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|gr icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)=" # Comments -color brightblue "(^|[[:space:]]+)#.*$" -color cyan "^[[:space:]]*##.*$" +color brightblue "(^|[[:space:]]+)#.*" +color cyan "^[[:space:]]*##.*" # Trailing whitespace color ,green "[[:space:]]+$" diff --git a/syntax/nftables.nanorc b/syntax/nftables.nanorc index 252c047d..328f31ef 100644 --- a/syntax/nftables.nanorc +++ b/syntax/nftables.nanorc @@ -17,7 +17,7 @@ color red "\<(drop|reject)\>" color brightblue "\<(accept|continue|(d|s)nat|goto|jump|masquerade|return)\>" # Comments -color cyan "(^|[[:space:]])#.*$" +color cyan "(^|[[:space:]])#.*" # Trailing whitespace color ,green "[[:space:]]+$" diff --git a/syntax/po.nanorc b/syntax/po.nanorc index dab602ca..7bfaf95d 100644 --- a/syntax/po.nanorc +++ b/syntax/po.nanorc @@ -26,4 +26,4 @@ color cyan "\\[abcefnrtv"\]" # Reminders. color brightwhite,yellow "(FIXME|TODO|XXX)" # Obsolete strings. -color red "#~.*$" +color red "#~.*" diff --git a/syntax/postgresql.nanorc b/syntax/postgresql.nanorc index d6b07ab4..d15415dc 100644 --- a/syntax/postgresql.nanorc +++ b/syntax/postgresql.nanorc @@ -59,9 +59,9 @@ color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" color green "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" # Comments. -color red "#[^{].*$" "#$" -color red "--[^{].*$" "#$" -color red "##[^{].*$" "##$" +color red "#[^{].*" "#$" +color red "--[^{].*" "--$" +color red "##[^{].*" "##$" color brightblue "//.*" color brightblue start="/\*" end="\*/" diff --git a/syntax/python.nanorc b/syntax/python.nanorc index bbd2f604..53643afe 100644 --- a/syntax/python.nanorc +++ b/syntax/python.nanorc @@ -26,7 +26,7 @@ color brightmagenta "\<(False|None|True)\>" color brightgreen "'([^'\]|\\.)+'" color brightgreen ""([^"\]|\\.)+"" # Comments. -color brightred "(^|[[:blank:]])#.*$" +color brightred "(^|[[:blank:]])#.*" # Triple-quoted strings. color brightgreen start="'''([^'),]|$)" end="(^|[^(\])'''" color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(\])\"\"\"" diff --git a/syntax/ruby.nanorc b/syntax/ruby.nanorc index 2fe19449..a840af02 100644 --- a/syntax/ruby.nanorc +++ b/syntax/ruby.nanorc @@ -28,8 +28,8 @@ color brightgreen "#\{[^}]*\}" # Strings, single-quoted. color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" # Comments. -color cyan "#[^{].*$" "#$" -color brightcyan "##[^{].*$" "##$" +color cyan "#[^{].*" "#$" +color brightcyan "##[^{].*" "##$" # "Here" docs. color green start="<<-?'?EOT'?" end="^EOT" # Some common markers. diff --git a/syntax/sh.nanorc b/syntax/sh.nanorc index 6342b36c..10de2217 100644 --- a/syntax/sh.nanorc +++ b/syntax/sh.nanorc @@ -28,7 +28,7 @@ color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*" color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})" # Comments. -color cyan "(^|[[:space:]])#.*$" +color cyan "(^|[[:space:]])#.*" # Strings. color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" diff --git a/syntax/spec.nanorc b/syntax/spec.nanorc index bab50420..fb9170cb 100644 --- a/syntax/spec.nanorc +++ b/syntax/spec.nanorc @@ -31,7 +31,7 @@ color red "^%(post|posttrans|postun|trigger|triggerin|triggerpostun|triggerun|ve color brightred "%(if|else|endif|define|global|undefine)" # Comments. -color cyan "#.*$" +color cyan "#.*" # Special case: "# norootforbuild" is handled as main tag. color brightblue "^# norootforbuild" # %changelog date entries. diff --git a/syntax/texinfo.nanorc b/syntax/texinfo.nanorc index 2a6c6d56..2b8251be 100644 --- a/syntax/texinfo.nanorc +++ b/syntax/texinfo.nanorc @@ -12,10 +12,10 @@ color brightmagenta "@[a-zA-Z]+\{[^}]*\}" color yellow "@[a-zA-Z]+\{?" "\}" # Menu items. -color brightred "^\*[[:space:]]+.*::.*$" +color brightred "^\*[[:space:]]+.*::.*" # Comments. -color green "@c[[:space:]]+.*$" +color green "@c[[:space:]]+.*" # Trailing whitespace. color ,green "[[:space:]]+$"