syntaxes: remove several redundant end-of-line anchors from regexes
parent
af71d44e4e
commit
636e9ac3e8
|
@ -3,7 +3,7 @@
|
||||||
syntax changelog "Change[Ll]og[^/]*$"
|
syntax changelog "Change[Ll]og[^/]*$"
|
||||||
|
|
||||||
# Author lines.
|
# Author lines.
|
||||||
color green "^(19|20).*$"
|
color green "^(19|20).*"
|
||||||
# Dates.
|
# Dates.
|
||||||
color red "^(19|20)[0-9-]{8}"
|
color red "^(19|20)[0-9-]{8}"
|
||||||
# Email addresses.
|
# Email addresses.
|
||||||
|
|
|
@ -30,4 +30,4 @@ color blue ":(\w|[?-])+"
|
||||||
color yellow start="^[[:blank:]]+\"" end="[^\]\""
|
color yellow start="^[[:blank:]]+\"" end="[^\]\""
|
||||||
color yellow ""(\\.|[^"])*""
|
color yellow ""(\\.|[^"])*""
|
||||||
# Comments
|
# Comments
|
||||||
color cyan "(^|[[:space:]]);.*$"
|
color cyan "(^|[[:space:]]);.*"
|
||||||
|
|
|
@ -39,7 +39,7 @@ color brightblue "\<tc-(arch(-kernel)?|export|has-(tls|openmp))\>"
|
||||||
## Common commands used in ebuilds:
|
## 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)\>"
|
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):
|
## Comments (doesn't work that well):
|
||||||
color yellow "(^|[[:space:]])#.*$"
|
color yellow "(^|[[:space:]])#.*"
|
||||||
## Strings (doesn't work that well):
|
## Strings (doesn't work that well):
|
||||||
color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
|
color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
|
||||||
## Trailing space is bad!
|
## Trailing space is bad!
|
||||||
|
@ -52,7 +52,7 @@ syntax /etc/portage "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$"
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
## Base text:
|
## Base text:
|
||||||
color green "^.+$"
|
color green ".+"
|
||||||
## Likely version and slot numbers:
|
## Likely version and slot numbers:
|
||||||
color magenta "-[[:digit:].]+(_(alpha|beta|pre|rc|p)[[:digit:]]*)*(-r[[:digit:]]+)?([:[:space:]]|$)"
|
color magenta "-[[:digit:].]+(_(alpha|beta|pre|rc|p)[[:digit:]]*)*(-r[[:digit:]]+)?([:[:space:]]|$)"
|
||||||
color magenta ":[^[:space:]]+([[:space:]]|$)"
|
color magenta ":[^[:space:]]+([[:space:]]|$)"
|
||||||
|
@ -67,7 +67,7 @@ color cyan "^[[:space:]]*[^/]*/"
|
||||||
## Masking regulators:
|
## Masking regulators:
|
||||||
color brightmagenta "^[[:space:]]*(=|~|<|<=|>|>=)"
|
color brightmagenta "^[[:space:]]*(=|~|<|<=|>|>=)"
|
||||||
## Comments:
|
## Comments:
|
||||||
color yellow "#.*$"
|
color yellow "#.*"
|
||||||
## Trailing space is bad!
|
## Trailing space is bad!
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
## Mixed whitespace is also bad.
|
## Mixed whitespace is also bad.
|
||||||
|
|
|
@ -15,7 +15,7 @@ color cyan start="(\\|\\\\)n\[" end="]"
|
||||||
# Requests
|
# Requests
|
||||||
color brightgreen "^\.[[:space:]]*[^[:space:]]*"
|
color brightgreen "^\.[[:space:]]*[^[:space:]]*"
|
||||||
# Comments
|
# Comments
|
||||||
color yellow "^\.\\".*$"
|
color yellow "^\.\\".*"
|
||||||
# Strings
|
# Strings
|
||||||
color green "(\\|\\\\)\*(.|\(..)"
|
color green "(\\|\\\\)\*(.|\(..)"
|
||||||
color green start="(\\|\\\\)\*\[" end="]"
|
color green start="(\\|\\\\)\*\[" end="]"
|
||||||
|
|
|
@ -21,4 +21,4 @@ color blue "#?:(\w|[?-])+"
|
||||||
color yellow start="^[[:blank:]]+\"" end="[^\]\""
|
color yellow start="^[[:blank:]]+\"" end="[^\]\""
|
||||||
color yellow ""(\\.|[^"])*""
|
color yellow ""(\\.|[^"])*""
|
||||||
# Comments
|
# Comments
|
||||||
color cyan "(^|[[:space:]]);.*$"
|
color cyan "(^|[[:space:]]);.*"
|
||||||
|
|
|
@ -28,7 +28,7 @@ color brightred "\{" "\}"
|
||||||
color brightred "," ":"
|
color brightred "," ":"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color cyan "(^|[[:space:]]+)(//|#).*$"
|
color cyan "(^|[[:space:]]+)(//|#).*"
|
||||||
|
|
||||||
# Trailing whitespace.
|
# Trailing whitespace.
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
|
|
|
@ -4,15 +4,15 @@ syntax man "\.[1-9]x?$"
|
||||||
magic "troff or preprocessor input"
|
magic "troff or preprocessor input"
|
||||||
comment ".\""
|
comment ".\""
|
||||||
|
|
||||||
color green "\.(SH|SS|TH) .*$"
|
color green "\.(SH|SS|TH) .*"
|
||||||
color brightgreen "\.(SH|SS|TH) " "\.([HIT]P)"
|
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 brightblue "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) " "\.([LP]?P)$"
|
||||||
color magenta "\\f[BIPR]"
|
color magenta "\\f[BIPR]"
|
||||||
color yellow "\.(br|DT|RS|RE|PD)"
|
color yellow "\.(br|DT|RS|RE|PD)"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color cyan "\.?\\\".*$"
|
color cyan "\.?\\\".*"
|
||||||
|
|
||||||
# Trailing whitespace.
|
# Trailing whitespace.
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
|
|
|
@ -4,7 +4,7 @@ syntax mgp "\.mgp$"
|
||||||
header "^%include.*"
|
header "^%include.*"
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
icolor green "^%[a-z].*$"
|
icolor green "^%[a-z].*"
|
||||||
color cyan "(^|[[:space:]])#.*$"
|
color cyan "(^|[[:space:]])#.*"
|
||||||
color cyan "(^|[[:space:]])%%.*$"
|
color cyan "(^|[[:space:]])%%.*"
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
|
|
|
@ -4,7 +4,7 @@ syntax nanorc "\.?nanorc$"
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
# Possible errors and parameters
|
# 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
|
# 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)\>"
|
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:]]*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:]]*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:]]*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 brightgreen "^[[:space:]]*(syntax|linter)[[:space:]]+[^[:blank:]]+"
|
||||||
icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|extendsyntax)\>"
|
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)="
|
icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
|
||||||
|
|
||||||
# Comments
|
# Comments
|
||||||
color brightblue "(^|[[:space:]]+)#.*$"
|
color brightblue "(^|[[:space:]]+)#.*"
|
||||||
color cyan "^[[:space:]]*##.*$"
|
color cyan "^[[:space:]]*##.*"
|
||||||
|
|
||||||
# Trailing whitespace
|
# Trailing whitespace
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
|
|
|
@ -17,7 +17,7 @@ color red "\<(drop|reject)\>"
|
||||||
color brightblue "\<(accept|continue|(d|s)nat|goto|jump|masquerade|return)\>"
|
color brightblue "\<(accept|continue|(d|s)nat|goto|jump|masquerade|return)\>"
|
||||||
|
|
||||||
# Comments
|
# Comments
|
||||||
color cyan "(^|[[:space:]])#.*$"
|
color cyan "(^|[[:space:]])#.*"
|
||||||
|
|
||||||
# Trailing whitespace
|
# Trailing whitespace
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
|
|
|
@ -26,4 +26,4 @@ color cyan "\\[abcefnrtv"\]"
|
||||||
# Reminders.
|
# Reminders.
|
||||||
color brightwhite,yellow "(FIXME|TODO|XXX)"
|
color brightwhite,yellow "(FIXME|TODO|XXX)"
|
||||||
# Obsolete strings.
|
# Obsolete strings.
|
||||||
color red "#~.*$"
|
color red "#~.*"
|
||||||
|
|
|
@ -59,9 +59,9 @@ color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>"
|
||||||
color green "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
color green "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color red "#[^{].*$" "#$"
|
color red "#[^{].*" "#$"
|
||||||
color red "--[^{].*$" "#$"
|
color red "--[^{].*" "--$"
|
||||||
color red "##[^{].*$" "##$"
|
color red "##[^{].*" "##$"
|
||||||
color brightblue "//.*"
|
color brightblue "//.*"
|
||||||
color brightblue start="/\*" end="\*/"
|
color brightblue start="/\*" end="\*/"
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ color brightmagenta "\<(False|None|True)\>"
|
||||||
color brightgreen "'([^'\]|\\.)+'"
|
color brightgreen "'([^'\]|\\.)+'"
|
||||||
color brightgreen ""([^"\]|\\.)+""
|
color brightgreen ""([^"\]|\\.)+""
|
||||||
# Comments.
|
# Comments.
|
||||||
color brightred "(^|[[:blank:]])#.*$"
|
color brightred "(^|[[:blank:]])#.*"
|
||||||
# Triple-quoted strings.
|
# Triple-quoted strings.
|
||||||
color brightgreen start="'''([^'),]|$)" end="(^|[^(\])'''"
|
color brightgreen start="'''([^'),]|$)" end="(^|[^(\])'''"
|
||||||
color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(\])\"\"\""
|
color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(\])\"\"\""
|
||||||
|
|
|
@ -28,8 +28,8 @@ color brightgreen "#\{[^}]*\}"
|
||||||
# Strings, single-quoted.
|
# Strings, single-quoted.
|
||||||
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||||
# Comments.
|
# Comments.
|
||||||
color cyan "#[^{].*$" "#$"
|
color cyan "#[^{].*" "#$"
|
||||||
color brightcyan "##[^{].*$" "##$"
|
color brightcyan "##[^{].*" "##$"
|
||||||
# "Here" docs.
|
# "Here" docs.
|
||||||
color green start="<<-?'?EOT'?" end="^EOT"
|
color green start="<<-?'?EOT'?" end="^EOT"
|
||||||
# Some common markers.
|
# Some common markers.
|
||||||
|
|
|
@ -28,7 +28,7 @@ color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
|
||||||
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
|
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color cyan "(^|[[:space:]])#.*$"
|
color cyan "(^|[[:space:]])#.*"
|
||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
||||||
|
|
|
@ -31,7 +31,7 @@ color red "^%(post|posttrans|postun|trigger|triggerin|triggerpostun|triggerun|ve
|
||||||
color brightred "%(if|else|endif|define|global|undefine)"
|
color brightred "%(if|else|endif|define|global|undefine)"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color cyan "#.*$"
|
color cyan "#.*"
|
||||||
# Special case: "# norootforbuild" is handled as main tag.
|
# Special case: "# norootforbuild" is handled as main tag.
|
||||||
color brightblue "^# norootforbuild"
|
color brightblue "^# norootforbuild"
|
||||||
# %changelog date entries.
|
# %changelog date entries.
|
||||||
|
|
|
@ -12,10 +12,10 @@ color brightmagenta "@[a-zA-Z]+\{[^}]*\}"
|
||||||
color yellow "@[a-zA-Z]+\{?" "\}"
|
color yellow "@[a-zA-Z]+\{?" "\}"
|
||||||
|
|
||||||
# Menu items.
|
# Menu items.
|
||||||
color brightred "^\*[[:space:]]+.*::.*$"
|
color brightred "^\*[[:space:]]+.*::.*"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color green "@c[[:space:]]+.*$"
|
color green "@c[[:space:]]+.*"
|
||||||
|
|
||||||
# Trailing whitespace.
|
# Trailing whitespace.
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
|
|
Loading…
Reference in New Issue