syntaxes: remove some superfluous outer parentheses from regexes

Also, standardize some comments, condense a few regexes, add some
word-edge anchors, and remove some superfluous backslashes.
This commit is contained in:
Benno Schulenberg 2020-04-21 12:47:08 +02:00
parent afce41c754
commit 227467adb9
14 changed files with 24 additions and 24 deletions

View File

@ -5,7 +5,7 @@ comment "#"
# Keywords:
color yellow "\<(if|test|then|elif|else|fi|for|in|do|done)\>"
color yellow "(=|!=|&&|\|\|)"
color yellow "=|!=|&&|\|\|"
# Macros:
color cyan "\<[[:upper:]_[:digit:]]+\>"

View File

@ -14,7 +14,7 @@ color red "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>"
# Function declarations and special patterns.
color brightgreen "\<(function|extension|BEGIN|END)\>"
# Operators.
color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)"
color green "\{|\}|\(|\)|\;|\[|\]|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|"
# Flow control.
color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>"
color brightyellow "\<(break|continue|return)\>"

View File

@ -12,7 +12,7 @@ color yellow "<[^>]*@[^>]*>"
# Command-line options.
color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+"
# Bug and patch numbers.
color cyan "(BZ|bug|patch) #[0-9]+" "PR [[:alnum:]]+/[0-9]+"
color cyan "(BZ|bug|patch)[ ]#[0-9]+" "PR [[:alnum:]]+/[0-9]+"
# Probable constants, for variety.
color brightred "\<[A-Z_][0-9A-Z_]+\>"
# Key sequences.

View File

@ -1,4 +1,4 @@
## Here is an example for apt's sources.list.
## Syntax highlighting for apt's sources.list.
syntax sources.list "sources\.list(\.d/.*\.list)?(~|\.old|\.save)?$"
comment "#"

View File

@ -1,5 +1,5 @@
## Here is an example for Gentoo ebuilds/eclasses,
## and (further down) one for Portage control files.
## Syntax highlighting for Gentoo ebuilds/eclasses,
## and (further down) for Portage control files.
syntax ebuild "\.e(build|class|blit)$"
comment "#"

View File

@ -10,13 +10,13 @@ comment "--"
color red "\<(as|case|of|class|data|default|deriving|do|forall|foreign|hiding|if|then|else|import|infix(l|r)?|instance|let|in|mdo|module|newtype|qualified|type|where)\>"
# Various symbols
color cyan "(\||@|!|:|_|~|=|\\|;|\(\)|,|\[|\]|\{|\})"
color cyan "\||@|!|:|_|~|=|\\|;|\(\)|,|\[|\]|\{|\}"
# Operators
color magenta "(==|/=|&&|\|\||<|>|<=|>=)"
color magenta "==|/=|&&|\|\||<|>|<=|>="
# More symbols
color cyan "(->|<-|=>)"
color cyan "->|<-|=>"
color magenta "\.|\$"
# Data constructors

View File

@ -8,7 +8,7 @@ color brightyellow "\<(sphere|cylinder|translate|matrix|rotate|scale)\>"
color brightyellow "\<(orthographic|location|up|right|direction|clipped_by)\>"
color brightyellow "\<(fog_type|fog_offset|fog_alt|rgb|distance|transform)\>"
color brightred "\<(background|camera|fog|light_source|object|texture)\>"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color green "\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|"
color brightmagenta "\<(union|group|subgroup)\>"
# Comments.

View File

@ -8,17 +8,17 @@ color cyan "^\.(ds|nr) [^[:space:]]*"
# Single-character escapes
color brightmagenta "\\."
# The argument of \f or \s in the same color
color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]"
color brightmagenta "\\f(.|\(..)" "\\s(\+|\-)?[0-9]"
# Newlines
color cyan "(\\|\\\\)n(.|\(..)"
color cyan start="(\\|\\\\)n\[" end="]"
color cyan "\\(\\)?n(.|\(..)"
color cyan start="\\(\\)?n\[" end="]"
# Requests
color brightgreen "^\.[[:space:]]*[^[:space:]]*"
# Comments
color yellow "^\.\\".*"
# Strings
color green "(\\|\\\\)\*(.|\(..)"
color green start="(\\|\\\\)\*\[" end="]"
color green "\\(\\)?\*(.|\(..)"
color green start="\\(\\)?\*\[" end="]"
# Characters
color brightred "\\\(.."
color brightred start="\\\[" end="]"

View File

@ -16,7 +16,7 @@ color green ":[[:space:]]*\"#[0-9abcdefABCDEF]+\""
# Escapes.
color green "\\\\" "\\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})"
# Special words.
color green "(true|false|null)"
color green "\<(true|false|null)\>"
# Names (very unlikely to contain a quote).
color brightblue "\"[^"]+\"[[:space:]]*:"

View File

@ -8,8 +8,8 @@ color green "^#.*$"
color yellow "Copyright|\(C\)"
# Header fields.
color brightred "^\"X-Bugs:.*\"$"
color brightmagenta "\<(Project\-Id\-Version|Report\-Msgid\-Bugs\-To|Last\-Translator|Language(\-Team)?|X-Bugs|X-Generator|Plural\-Forms)\>"
color cyan "\<(POT\-Creation\-Date|PO\-Revision\-Date|MIME\-Version|Content\-Type|Content\-Transfer\-Encoding)\>"
color brightmagenta "\<(Project-Id-Version|Report-Msgid-Bugs-To|Last-Translator|Language(-Team)?|X-Bugs|X-Generator|Plural-Forms)\>"
color cyan "\<(POT-Creation-Date|PO-Revision-Date|MIME-Version|Content-Type|Content-Transfer-Encoding)\>"
# Encodings and numbers.
color yellow "\<(UTF|ISO|Windows|Mac|IBM)-[0-9]+"
color yellow "\<((pre|rc)?[0-9]+|[0-9]bit)\>"
@ -24,6 +24,6 @@ color brightmagenta "%([1-9]\$)?[a-z]*"
color yellow "\""
color cyan "\\([abcefnrtv"\]|x[0-9abcdefABCDEF]{2}|[0-7]{3})"
# Reminders.
color brightwhite,yellow "(FIXME|TODO|XXX)"
color brightwhite,yellow "\<(FIXME|TODO|XXX)\>"
# Obsolete strings.
color red "#~.*"

View File

@ -34,7 +34,7 @@ color brightgreen start="'''([^'),]|$)" end="(^|[^(\])'''"
color brightgreen start=""""([^"),]|$)" end="(^|[^(\])""""
# Reminders.
color brightwhite,yellow "(FIXME|TODO|XXX)"
color brightwhite,yellow "\<(FIXME|TODO|XXX)\>"
# Trailing whitespace.
color ,green "[[:space:]]+$"

View File

@ -34,4 +34,4 @@ color brightcyan "##[^{].*" "##$"
# "Here" docs.
color green start="<<-?'?EOT'?" end="^EOT"
# Some common markers.
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
color brightcyan "XXX|TODO|FIXME|\?\?\?"

View File

@ -35,4 +35,4 @@ color blue start="/\*" end="\*/"
color magenta start="#!\[" end="\]"
# Some common markers
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
color brightcyan "XXX|TODO|FIXME|\?\?\?"

View File

@ -12,8 +12,8 @@ color green "\<string (bytelength|compare|equal|first|index|is|last|length|map|m
# Extended TclX [info commands]:
color green "\<(alarm|auto_load_pkg|bsearch|catclose|catgets|catopen|ccollate|cconcat|cequal|chgrp|chmod|chown|chroot|cindex|clength|cmdtrace|commandloop|crange|csubstr|ctoken|ctype|dup|echo|execl|fcntl|flock|fork|fstat|ftruncate|funlock|host_info|id|infox|keyldel|keylget|keylkeys|keylset|kill|lassign|lcontain|lempty|lgets|link|lmatch|loadlibindex|loop|lvarcat|lvarpop|lvarpush|max|min|nice|pipe|profile|random|readdir|replicate|scancontext|scanfile|scanmatch|select|server_accept|server_create|signal|sleep|sync|system|tclx_findinit|tclx_fork|tclx_load_tndxs|tclx_sleep|tclx_system|tclx_wait|times|translit|try_eval|umask|wait)\>"
# Syntax:
color brightblue "proc[[:space:]]" "(\{|\})"
color green "(\(|\)|\;|`|\\|\$|<|>|!|=|&|\|)"
color brightblue "\<proc[[:space:]]|\{|\}"
color green "\(|\)|\;|`|\\|\$|<|>|!|=|&|\|"
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
color brightred "\$\{?[0-9A-Za-z_!@#$*?-]+\}?"
# Trailing whitespace: