From 544351f3beeffb3a1d25d861c159feec221ff00a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 27 Apr 2021 11:18:41 +0200 Subject: [PATCH] syntaxes: replace [[:space:]] with [[:blank:]] to exclude carriage return In many places a carriage return is not valid whitespace and should thus not be colored as such. In some of these places a vertical tab or form feed is maybe valid whitespace, but it would be ugly or even wrong to color them because they are not part of the subsequent comment or keyword. This fixes https://savannah.gnu.org/bugs/?60456. --- syntax/asm.nanorc | 4 ++-- syntax/autoconf.nanorc | 2 +- syntax/awk.nanorc | 2 +- syntax/c.nanorc | 14 +++++++------- syntax/changelog.nanorc | 2 +- syntax/cmake.nanorc | 14 +++++++------- syntax/default.nanorc | 2 +- syntax/elisp.nanorc | 2 +- syntax/go.nanorc | 6 +++--- syntax/groff.nanorc | 2 +- syntax/guile.nanorc | 2 +- syntax/javascript.nanorc | 2 +- syntax/json.nanorc | 8 ++++---- syntax/lua.nanorc | 2 +- syntax/makefile.nanorc | 2 +- syntax/nanorc.nanorc | 28 ++++++++++++++-------------- syntax/nftables.nanorc | 2 +- syntax/objc.nanorc | 8 ++++---- syntax/perl.nanorc | 4 ++-- syntax/php.nanorc | 2 +- syntax/sh.nanorc | 6 +++--- syntax/tcl.nanorc | 4 ++-- 22 files changed, 60 insertions(+), 60 deletions(-) diff --git a/syntax/asm.nanorc b/syntax/asm.nanorc index 8bc217eb..0d2293d1 100644 --- a/syntax/asm.nanorc +++ b/syntax/asm.nanorc @@ -8,8 +8,8 @@ color red "\<[A-Z_]{2,}\>" color brightgreen "\.(data|subsection|text)" color green "\.(align|file|globl|global|hidden|section|size|type|weak)" color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)" -color brightred "^[[:space:]]*[.0-9A-Za-z_]*:" -color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)" +color brightred "^[[:blank:]]*[.0-9A-Za-z_]*:" +color brightcyan "^[[:blank:]]*#[[:blank:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)" # Strings. color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" diff --git a/syntax/autoconf.nanorc b/syntax/autoconf.nanorc index 918cfb9d..647c244e 100644 --- a/syntax/autoconf.nanorc +++ b/syntax/autoconf.nanorc @@ -23,7 +23,7 @@ color red ""[^"]*"" "'[^']*'" color green "`[^`]*`" # Error lines: -color brightred "^[[:space:]]*\*\*\*.*" +color brightred "^[[:blank:]]*\*\*\*.*" # Brackets: color magenta "\[|\]|\(|\)" diff --git a/syntax/awk.nanorc b/syntax/awk.nanorc index 9d5a5cb9..942d2f56 100644 --- a/syntax/awk.nanorc +++ b/syntax/awk.nanorc @@ -31,7 +31,7 @@ color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>" # Strings. color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" # Comments. -color brightblue "(^|[[:space:]])#.*$" +color brightblue "(^|[[:blank:]])#.*$" # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/syntax/c.nanorc b/syntax/c.nanorc index c13ec5fe..14db97c9 100644 --- a/syntax/c.nanorc +++ b/syntax/c.nanorc @@ -1,15 +1,15 @@ ## Syntax highlighting for C and C++ files. syntax c "\.([ch](pp|xx)?|C|cc|c\+\+|cu|H|hh|ii?)$" -header "-\*-.*\" # Labels. -color brightmagenta "^\s*[A-Z_a-z][0-9A-Z_a-z]*:\s*$" -color normal ":\s*$" +color brightmagenta "^[[:blank:]]*[A-Z_a-z][0-9A-Z_a-z]*:[[:blank:]]*$" +color normal ":[[:blank:]]*$" # Types and related keywords. color green "\<(auto|bool|char|const|double|enum|extern|float|inline|int|long|restrict|short|signed|sizeof|static|struct|typedef|union|unsigned|void)\>" @@ -26,15 +26,15 @@ color magenta "\<(break|continue|goto|return)\>" color brightmagenta "'([^'\]|\\(["'\abfnrtv]|x[0-9A-Fa-f]{1,2}|[0-3]?[0-7]{1,2}))'" # GCC builtins. -color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" +color cyan "__attribute__[[:blank:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" # Strings. (In general you will want your strings and comments to come last, # because highlighting rules are applied in the order they are read in.) -color brightyellow ""([^"]|\\")*"" "#[[:space:]]*include[[:space:]]*<[^>]+>" +color brightyellow ""([^"]|\\")*"" "#[[:blank:]]*include[[:blank:]]*<[^>]+>" # Preprocessor directives. -color brightcyan start="^[[:space:]]*#[[:space:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\\])$" -color brightcyan "^[[:space:]]*#[[:space:]]*((define|else|endif|include(_next)?|line|undef)\>|$)" +color brightcyan start="^[[:blank:]]*#[[:blank:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\\])$" +color brightcyan "^[[:blank:]]*#[[:blank:]]*((define|else|endif|include(_next)?|line|undef)\>|$)" # Comments. color brightblue "//.*" diff --git a/syntax/changelog.nanorc b/syntax/changelog.nanorc index 46272380..fa0bb46f 100644 --- a/syntax/changelog.nanorc +++ b/syntax/changelog.nanorc @@ -13,7 +13,7 @@ color red "^(19|20)[0-9-]{8}" color yellow "<[^>]*@[^>]*>" # Command-line options. -color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+" +color cyan "[[:blank:]]-[a-zA-Z\$]" "--[8a-z-]+" # Bug and patch numbers. color cyan "(BZ|bug|patch)[ ]#[0-9]+" "PR [[:alnum:]]+/[0-9]+" # Probable constants, for variety. diff --git a/syntax/cmake.nanorc b/syntax/cmake.nanorc index acdf87f8..3c59392c 100644 --- a/syntax/cmake.nanorc +++ b/syntax/cmake.nanorc @@ -3,17 +3,17 @@ syntax cmake "(CMakeLists\.txt|\.cmake)$" comment "#" -color green "^[[:space:]]*[0-9A-Za-z_]+" -icolor brightyellow "^[[:space:]]*(include|include_directories|include_external_msproject)\>" +color green "^[[:blank:]]*[0-9A-Za-z_]+" +icolor brightyellow "^[[:blank:]]*(include|include_directories|include_external_msproject)\>" -icolor brightgreen "^[[:space:]]*((else|end)?if|else|(end)?while|(end)?foreach|break)\>" -color brightgreen "\<(NOT|COMMAND|POLICY|TARGET|EXISTS|IS_(DIRECTORY|ABSOLUTE)|DEFINED)[[:space:]]" -color brightgreen "[[:space:]](OR|AND|IS_NEWER_THAN|MATCHES|(STR|VERSION_)?(LESS|GREATER|EQUAL))[[:space:]]" +icolor brightgreen "^[[:blank:]]*((else|end)?if|else|(end)?while|(end)?foreach|break)\>" +color brightgreen "\<(NOT|COMMAND|POLICY|TARGET|EXISTS|IS_(DIRECTORY|ABSOLUTE)|DEFINED)[[:blank:]]" +color brightgreen "[[:blank:]](OR|AND|IS_NEWER_THAN|MATCHES|(STR|VERSION_)?(LESS|GREATER|EQUAL))[[:blank:]]" -icolor brightred "^[[:space:]]*((end)?(function|macro)|return)" +icolor brightred "^[[:blank:]]*((end)?(function|macro)|return)" icolor cyan start="\$(ENV)?\{" end="\}" color magenta "\<(APPLE|UNIX|WIN32|CYGWIN|BORLAND|MINGW|MSVC(_IDE|60|71|80|90)?)\>" -color brightblue "(^|[[:space:]])#.*" +color brightblue "(^|[[:blank:]])#.*" color ,green "[[:space:]]+$" diff --git a/syntax/default.nanorc b/syntax/default.nanorc index d444e2db..7aa30739 100644 --- a/syntax/default.nanorc +++ b/syntax/default.nanorc @@ -5,7 +5,7 @@ syntax default comment "#" # Comments. -color cyan "^[[:space:]]*#.*" +color cyan "^[[:blank:]]*#.*" # Spaces in front of tabs. color ,red " + +" diff --git a/syntax/elisp.nanorc b/syntax/elisp.nanorc index 473b93bb..44b788b6 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 "(^|[[:blank:]]);.*" diff --git a/syntax/go.nanorc b/syntax/go.nanorc index debc5d7b..368fd4fc 100644 --- a/syntax/go.nanorc +++ b/syntax/go.nanorc @@ -11,7 +11,7 @@ formatter gofmt -w # Types. color green "\<(bool|u?int(8|16|32|64)?|float(32|64)|complex(64|128)|byte|rune|uintptr|string|error)\>" color green "\<(chan|const|func|interface|map|struct|type|var)\>" -color green "<-[[:space:]]*chan\>|\|\" @@ -36,14 +36,14 @@ color red "\<[0-9]+i\>" color red "\<(true|false|nil|iota|_)\>" color red "'(\\.|[^'])+'" color red ""(\\.|[^"])*"" -color red start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" +color red start=""(\\.|[^"])*\\[[:blank:]]*$" end="^(\\.|[^"])*"" # Comments. color brightblue "//.*" color brightblue start="/\*" end="\*/" # Special comments. -color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+" +color brightcyan "//[[:blank:]]*\+build[[:blank:]]+(([a-zA-Z_0-9]+[[:blank:]]*)+,[[:blank:]]*)*[a-zA-Z_0-9]+" # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/syntax/groff.nanorc b/syntax/groff.nanorc index 3559ac30..f7060e3a 100644 --- a/syntax/groff.nanorc +++ b/syntax/groff.nanorc @@ -13,7 +13,7 @@ color brightmagenta "\\f(.|\(..)" "\\s(\+|\-)?[0-9]" color cyan "\\(\\)?n(.|\(..)" color cyan start="\\(\\)?n\[" end="]" # Requests -color brightgreen "^\.[[:space:]]*[^[:space:]]*" +color brightgreen "^\.[[:blank:]]*[^[:space:]]*" # Comments color yellow "^\.\\".*" # Strings diff --git a/syntax/guile.nanorc b/syntax/guile.nanorc index 5d5e4e04..2f41e330 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 "(^|[[:blank:]]);.*" diff --git a/syntax/javascript.nanorc b/syntax/javascript.nanorc index 10925477..ecf0b9b6 100644 --- a/syntax/javascript.nanorc +++ b/syntax/javascript.nanorc @@ -19,7 +19,7 @@ color cyan "\<(true|false|null|undefined)\>" # Strings. color brightmagenta ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`" # Comments. -color brightblue "(^|[[:space:]])//.*" +color brightblue "(^|[[:blank:]])//.*" color brightblue start="/\*" end="\*/" # Trailing whitespace. diff --git a/syntax/json.nanorc b/syntax/json.nanorc index 39262963..05be6569 100644 --- a/syntax/json.nanorc +++ b/syntax/json.nanorc @@ -8,18 +8,18 @@ syntax json "\.json$" comment "" # Numbers (used as value). -color green ":[[:space:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?" +color green ":[[:blank:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?" # Values (well, any string). color brightmagenta "".+"" # Hex numbers (used as value). -color green ":[[:space:]]*"#[0-9abcdefABCDEF]+"" +color green ":[[:blank:]]*"#[0-9abcdefABCDEF]+"" # Escapes. color green "\\\\" "\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})" # Special words. color green "\<(true|false|null)\>" # Names (very unlikely to contain a quote). -color brightblue ""[^"]+"[[:space:]]*:" +color brightblue ""[^"]+"[[:blank:]]*:" # Brackets, braces, and separators. color brightblue "\[" "\]" @@ -27,7 +27,7 @@ color brightred "\{" "\}" color brightred "," ":" # Comments. -color cyan "(^|[[:space:]]+)(//|#).*" +color cyan "(^|[[:blank:]]+)(//|#).*" # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/syntax/lua.nanorc b/syntax/lua.nanorc index e7e3ac16..dae1103b 100644 --- a/syntax/lua.nanorc +++ b/syntax/lua.nanorc @@ -20,7 +20,7 @@ color normal "\.\.\." color brightblue "\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return|break)\>" # Keywords -color brightyellow "\<(_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\s*\(" +color brightyellow "\<(_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)[[:blank:]]*\(" # Standard library color brightyellow "\" diff --git a/syntax/makefile.nanorc b/syntax/makefile.nanorc index c1f487ff..e98204c6 100644 --- a/syntax/makefile.nanorc +++ b/syntax/makefile.nanorc @@ -18,7 +18,7 @@ color blue "\$+[{(][a-zA-Z0-9_-]+[})]" color brightblue "^[^ ]+:" # Comments. -color green "(^|[[:space:]]+)#.*" +color green "(^|[[:blank:]]+)#.*" # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc index a47fa655..683629ee 100644 --- a/syntax/nanorc.nanorc +++ b/syntax/nanorc.nanorc @@ -7,26 +7,26 @@ comment "#" color brightred ".*" # Keywords -color brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|bookstyle|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|magic|minibar|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|stateflags|suspendable|tabstospaces|trimblanks|unix|wordbounds|zap)\>" -color yellow "^[[:space:]]*set[[:space:]]+((error|function|key|number|prompt|scroller|selected|spotlight|status|stripe|title)color)[[:space:]]+(bold,)?(italic,)?(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte))?\>" -color brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|promptcolor|punct|quotestr|scrollercolor|selectedcolor|speller|spotlightcolor|statuscolor|stripecolor|titlecolor|whitespace|wordchars)[[:space:]]+" -color brightgreen "^[[:space:]]*set[[:space:]]+(fill[[:space:]]+-?[[:digit:]]+|(guidestripe|tabsize)[[:space:]]+[1-9][0-9]*)\>" -color brightgreen "^[[:space:]]*bind[[:space:]]+((\^([A-Za-z]|[]/@\^_`]|Space)|([Ss][Hh]-)?[Mm]-[A-Za-z]|[Mm]-([][!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-9]|2[0-4])|Ins|Del)[[:space:]]+([a-z]+|".*")[[:space:]]+(main|help|search|replace(with)?|yesno|gotoline|writeout|insert|browser|whereisfile|gotodir|execute|spell|linter|all)([[:space:]]+#|[[:space:]]*$)" -color brightgreen "^[[:space:]]*unbind[[:space:]]+((\^([A-Za-z]|[]/@\^_`]|Space)|([Ss][Hh]-)?[Mm]-[A-Za-z]|[Mm]-([][!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-9]|2[0-4])|Ins|Del)[[:space:]]+(all|main|search|replace(with)?|yesno|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)" -color brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|comment|formatter|linter|tabgives)[[:space:]]+.*" -color brightgreen "^[[:space:]]*(syntax[[:space:]]+[^[:blank:]]+|(formatter|linter)[[:space:]]+.+)" -color green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|formatter|linter|tabgives|extendsyntax)\>" +color brightgreen "^[[:blank:]]*(set|unset)[[:blank:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|bookstyle|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|magic|minibar|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|stateflags|suspendable|tabstospaces|trimblanks|unix|wordbounds|zap)\>" +color yellow "^[[:blank:]]*set[[:blank:]]+((error|function|key|number|prompt|scroller|selected|spotlight|status|stripe|title)color)[[:blank:]]+(bold,)?(italic,)?(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte))?\>" +color brightgreen "^[[:blank:]]*set[[:blank:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|promptcolor|punct|quotestr|scrollercolor|selectedcolor|speller|spotlightcolor|statuscolor|stripecolor|titlecolor|whitespace|wordchars)[[:blank:]]+" +color brightgreen "^[[:blank:]]*set[[:blank:]]+(fill[[:blank:]]+-?[[:digit:]]+|(guidestripe|tabsize)[[:blank:]]+[1-9][0-9]*)\>" +color brightgreen "^[[:blank:]]*bind[[:blank:]]+((\^([A-Za-z]|[]/@\^_`]|Space)|([Ss][Hh]-)?[Mm]-[A-Za-z]|[Mm]-([][!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-9]|2[0-4])|Ins|Del)[[:blank:]]+([a-z]+|".*")[[:blank:]]+(main|help|search|replace(with)?|yesno|gotoline|writeout|insert|browser|whereisfile|gotodir|execute|spell|linter|all)([[:blank:]]+#|[[:blank:]]*$)" +color brightgreen "^[[:blank:]]*unbind[[:blank:]]+((\^([A-Za-z]|[]/@\^_`]|Space)|([Ss][Hh]-)?[Mm]-[A-Za-z]|[Mm]-([][!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-9]|2[0-4])|Ins|Del)[[:blank:]]+(all|main|search|replace(with)?|yesno|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:blank:]]+#|[[:blank:]]*$)" +color brightgreen "^[[:blank:]]*extendsyntax[[:blank:]]+[[:alpha:]]+[[:blank:]]+(i?color|header|magic|comment|formatter|linter|tabgives)[[:blank:]]+.*" +color brightgreen "^[[:blank:]]*(syntax[[:blank:]]+[^[:space:]]+|(formatter|linter)[[:blank:]]+.+)" +color green "^[[:blank:]]*((un)?(bind|set)|include|syntax|header|magic|comment|formatter|linter|tabgives|extendsyntax)\>" # Strings -color brightmagenta "([[:space:]]|(start|end)=)".+"([[:space:]]|$)" +color brightmagenta "([[:blank:]]|(start|end)=)".+"([[:blank:]]|$)" # Colors -color yellow "^[[:space:]]*i?color[[:space:]]*(bold,)?(italic,)?(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte))?\>" -color magenta "^[[:space:]]*i?color\>" "\<(start|end)=" +color yellow "^[[:blank:]]*i?color[[:blank:]]*(bold,)?(italic,)?(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte))?\>" +color magenta "^[[:blank:]]*i?color\>" "\<(start|end)=" # Comments -color brightblue "(^|[[:space:]]+)#.*" -color cyan "^[[:space:]]*##.*" +color brightblue "(^|[[:blank:]]+)#.*" +color cyan "^[[:blank:]]*##.*" # Trailing whitespace color ,green "[[:space:]]+$" diff --git a/syntax/nftables.nanorc b/syntax/nftables.nanorc index f3ccc96d..a5dcf769 100644 --- a/syntax/nftables.nanorc +++ b/syntax/nftables.nanorc @@ -20,7 +20,7 @@ color red "\<(drop|reject)\>" color brightblue "\<(accept|continue|(d|s)nat|goto|jump|masquerade|return)\>" # Comments -color cyan "(^|[[:space:]])#.*" +color cyan "(^|[[:blank:]])#.*" # Trailing whitespace color ,green "[[:space:]]+$" diff --git a/syntax/objc.nanorc b/syntax/objc.nanorc index f35f60db..6d2a1c9a 100644 --- a/syntax/objc.nanorc +++ b/syntax/objc.nanorc @@ -15,13 +15,13 @@ color brightgreen "\<(goto|continue|break|return)\>" color brightgreen "@(encode|end|implementation|interface)|selector)\>" # GCC builtins. -color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" +color cyan "__attribute__[[:blank:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" # Selector/method. -color brightmagenta "(^|[[:space:]])\[.*[[:space:]].*\]" +color brightmagenta "(^|[[:blank:]])\[.*[[:blank:]].*\]" color white ":[[:alnum:]]*" color magenta "[[:alnum:]]*:" -color white "\[[^][:space:]]*\]" +color white "\[[^][:blank:]]*\]" # Strings. color brightblack "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'" @@ -29,7 +29,7 @@ color brightblack "<[^= ]*>" ""(\\.|[^"])*"" color brightblue "@"(\\.|[^"])*"" # Preprocessor commands. -color brightblue "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)" +color brightblue "^[[:blank:]]*#[[:blank:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)" # Comments. color yellow "//.*" diff --git a/syntax/perl.nanorc b/syntax/perl.nanorc index 1457d7db..5f742fd3 100644 --- a/syntax/perl.nanorc +++ b/syntax/perl.nanorc @@ -12,13 +12,13 @@ color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne color cyan "[$%&@]([A-Za-z_][0-9A-Za-z_]*|\^[][A-Z?\^_]|[0-9]+)\>" color cyan "[$%&@]\{(\^?[A-Za-z_][0-9A-Za-z_]*|\^[][?\^][0-9]+)\}" color cyan "[$%&@]([][!"#'()*+,.:;<=>?`|~-]|\{[][!-/:-@\`|~]\})|\$[$%&@]" -color cyan "(^|[[:space:]])[$%@][/\]" +color cyan "(^|[[:blank:]])[$%@][/\]" color yellow "".*"|qq\|.*\|" color white "[sm]/.*/" color white start="(^use| = new)" end=";" # Comments. -color green "(^|[[:space:]])#.*" +color green "(^|[[:blank:]])#.*" color yellow start="<< 'STOP'" end="STOP" diff --git a/syntax/php.nanorc b/syntax/php.nanorc index 668b9d3a..eda74704 100644 --- a/syntax/php.nanorc +++ b/syntax/php.nanorc @@ -28,7 +28,7 @@ color magenta "\<(break|continue|goto|return)\>" color brightyellow ""(\.|[^"])*"" "'(\.|[^'])*'" # Comments. -color brightblue "(^|[[:space:]]+)//.*" +color brightblue "(^|[[:blank:]]+)//.*" color brightblue start="/\*" end="\*/" # Trailing whitespace. diff --git a/syntax/sh.nanorc b/syntax/sh.nanorc index 00e9670e..75c54f77 100644 --- a/syntax/sh.nanorc +++ b/syntax/sh.nanorc @@ -1,7 +1,7 @@ ## Syntax highlighting for Bourne shell scripts. syntax sh "(\.sh|(\.|/)(a|ba|c|da|k|mk|pdk|tc|z)sh(rc|_profile)?|/(etc/|\.)profile)$" -header "^#!.*/((env\s+)?((a|ba|c|da|k|mk|pdk|tc|z)?sh)|busybox\s+sh|openrc-run|runscript)\>" +header "^#!.*/((env[[:blank:]]+)?((a|ba|c|da|k|mk|pdk|tc|z)?sh)|busybox[[:blank:]]+sh|openrc-run|runscript)\>" header "-\*-.*shell-script.*-\*-" magic "(POSIX|Bourne-Again) shell script.*text" comment "#" @@ -27,10 +27,10 @@ color normal "[.-]tar\>" # Basic variable names (no braces). color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*" # More complicated variable names; handles braces and replacements and arrays. -color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})" +color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:blank:]]*[[:alnum:]_]+[[:blank:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})" # Comments. -color cyan "(^|[[:space:]])#.*" +color cyan "(^|[[:blank:]])#.*" # Strings. color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" diff --git a/syntax/tcl.nanorc b/syntax/tcl.nanorc index 41af06d1..055b1470 100644 --- a/syntax/tcl.nanorc +++ b/syntax/tcl.nanorc @@ -15,7 +15,7 @@ color green "\" # Syntax: -color brightblue "\|!|=|&|\|" color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" color brightred "\$\{?[0-9A-Za-z_!@#$*?-]+\}?" @@ -24,4 +24,4 @@ color brightred "\$\{?[0-9A-Za-z_!@#$*?-]+\}?" color ,green "[[:space:]]+$" # Comments: -color cyan "^[[:space:]]*#.*" +color cyan "^[[:blank:]]*#.*"