tweaks: remove redundant parentheses, trim comments, fold some regexes

This commit is contained in:
Benno Schulenberg 2021-10-25 12:31:02 +02:00
parent 3313fac8eb
commit 7691527f35

View File

@ -16,20 +16,22 @@ color yellow "\<(next|nil|not|or|redo|rescue|retry|return|self|super|then|true|u
color magenta "([ ]|^):[0-9A-Za-z_]+\>" color magenta "([ ]|^):[0-9A-Za-z_]+\>"
# Some unique things we want to stand out. # Some unique things we want to stand out.
color brightyellow "\<(__FILE__|__LINE__)\>" color brightyellow "\<(__FILE__|__LINE__)\>"
# Regular expressions. # Regular expressions.
color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*" color brightmagenta "(/([^/]|\\/)*/|%r\{([^}]|\\\})*\})[iomx]*"
# Shell command expansion is in `backticks` or like %x{this}. These are # Shell command expansion is in `backticks` or like %x{this}.
# "double-quotish" (to use a perlism). color brightblue "`[^`]*`|%x\{[^}]*\}"
color brightblue "`[^`]*`" "%x\{[^}]*\}"
# Strings, double-quoted. # Strings, double-quoted.
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!" color green ""([^"]|\\")*"" "%[QW]?(\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
# Expression substitution. These go inside double-quoted strings, # Expression substitution for inside double-quoted strings, "like #{this}".
# "like #{this}".
color brightgreen "#\{[^}]*\}" color brightgreen "#\{[^}]*\}"
# Strings, single-quoted. # Strings, single-quoted.
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" color green "'([^']|\\')*'" "%[qw](\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
# Comments. # Comments.
color cyan "#[^{].*" "#$" color cyan "#([^{].*|$)"
color brightcyan "##[^{].*" "##$" color brightcyan "##([^{].*|$)"
# Some common markers. # Some common markers.
color brightcyan "XXX|TODO|FIXME|\?\?\?" color brightcyan "XXX|TODO|FIXME|\?\?\?"