syntaxes: avoid coloring "this\" as if it were a valid string
A backslash should not be allowed inside a quoted string unless it is used to escape another character. This fixes https://savannah.gnu.org/bugs/?61389. Bug existed since each of these syntaxes was introduced. (Awk and Fortran do not know include files with names between angled brackets, so those regexes are dropped in the bargain.)
Этот коммит содержится в:
родитель
485eb18d83
Коммит
7bd68365ec
@ -12,7 +12,7 @@ color brightred "^[[:blank:]]*[.0-9A-Za-z_]*:"
|
|||||||
color brightcyan "^[[:blank:]]*#[[:blank:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
|
color brightcyan "^[[:blank:]]*#[[:blank:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
|
||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
color brightyellow "<[^= ]*>|"(\\.|[^"\])*""
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color brightblue "//.*"
|
color brightblue "//.*"
|
||||||
|
@ -29,7 +29,7 @@ color magenta "\<(and|compl|lshift|or|rshift|xor)\>"
|
|||||||
color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>"
|
color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>"
|
||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
color brightyellow ""(\\.|[^"\])*""
|
||||||
# Comments.
|
# Comments.
|
||||||
color brightblue "(^|[[:blank:]])#.*"
|
color brightblue "(^|[[:blank:]])#.*"
|
||||||
|
|
||||||
|
@ -28,6 +28,6 @@ color brightred "\<(t|nil)\>"
|
|||||||
color blue ":(\w|[?-])+"
|
color blue ":(\w|[?-])+"
|
||||||
# Strings
|
# Strings
|
||||||
color yellow start="^[[:blank:]]+"" end="[^\]""
|
color yellow start="^[[:blank:]]+"" end="[^\]""
|
||||||
color yellow ""(\\.|[^"])*""
|
color yellow ""(\\.|[^"\])*""
|
||||||
# Comments
|
# Comments
|
||||||
color cyan "(^|[[:blank:]]);.*"
|
color cyan "(^|[[:blank:]]);.*"
|
||||||
|
@ -34,7 +34,7 @@ icolor yellow "\<(.or.|repeat|select case|then|where|while)\>"
|
|||||||
icolor magenta "\<(continue|cycle|exit|go?to|result|return)\>"
|
icolor magenta "\<(continue|cycle|exit|go?to|result|return)\>"
|
||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color yellow "<[^= ]*>" ""(\\.|[^"])*""
|
color yellow ""(\\.|[^"\])*""
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color blue "!.*"
|
color blue "!.*"
|
||||||
|
@ -41,7 +41,7 @@ color blue "\<(awk|cat|cd|chmod|chown|cp|echo|env|find|e?grep|ln|make|mkdir|mv|p
|
|||||||
## 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!
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
## Mixed whitespace is also bad.
|
## Mixed whitespace is also bad.
|
||||||
|
@ -28,9 +28,9 @@ color magenta "\<(Bounded|Data|Enum|Eq|Floating|Fractional|Functor|Integral|Mona
|
|||||||
color brightred "undefined"
|
color brightred "undefined"
|
||||||
|
|
||||||
# Strings
|
# Strings
|
||||||
color yellow ""([^\"]|\\.)*""
|
color yellow ""([^"\]|\\.)*""
|
||||||
# Characters
|
# Characters
|
||||||
color brightyellow "'([^\']|\\.)'"
|
color brightyellow "'([^'\]|\\.)'"
|
||||||
|
|
||||||
# Comments
|
# Comments
|
||||||
color green "--.*"
|
color green "--.*"
|
||||||
|
@ -34,8 +34,8 @@ color red "\<[0-9]+i\>"
|
|||||||
|
|
||||||
# Strings and characters; slightly fuzzy.
|
# Strings and characters; slightly fuzzy.
|
||||||
color red "\<(true|false|nil|iota|_)\>"
|
color red "\<(true|false|nil|iota|_)\>"
|
||||||
color red ""(\\.|[^"])*"|'(\\.|[^'])+'"
|
color red ""(\\.|[^"\])*"|'(\\.|[^'\])+'"
|
||||||
color red start=""(\\.|[^"])*\\[[:blank:]]*$" end="^(\\.|[^"])*""
|
color red start=""(\\.|[^"\])*\\[[:blank:]]*$" end="^(\\.|[^"\])*""
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color brightblue "//.*"
|
color brightblue "//.*"
|
||||||
|
@ -19,6 +19,6 @@ color brightred "(#t|#f)\>"
|
|||||||
color blue "#?:(\w|[?-])+"
|
color blue "#?:(\w|[?-])+"
|
||||||
# Strings
|
# Strings
|
||||||
color yellow start="^[[:blank:]]+"" end="[^\]""
|
color yellow start="^[[:blank:]]+"" end="[^\]""
|
||||||
color yellow ""(\\.|[^"])*""
|
color yellow ""(\\.|[^"\])*""
|
||||||
# Comments
|
# Comments
|
||||||
color cyan "(^|[[:blank:]]);.*"
|
color cyan "(^|[[:blank:]]);.*"
|
||||||
|
@ -25,7 +25,7 @@ color red "\<(rows(pan)?|rules|scheme|scope|scrolling|selected|shape|size|span|s
|
|||||||
color red "\<(tabindex|target|text|title|type|usemap|valign|value(type)?|vlink|vspace|width|xmlns|xml:space)="
|
color red "\<(tabindex|target|text|title|type|usemap|valign|value(type)?|vlink|vspace|width|xmlns|xml:space)="
|
||||||
|
|
||||||
# Strings:
|
# Strings:
|
||||||
color green ""(\\.|[^"])*""
|
color green ""(\\.|[^"\])*""
|
||||||
|
|
||||||
# Comments:
|
# Comments:
|
||||||
color yellow start="<!--" end="-->"
|
color yellow start="<!--" end="-->"
|
||||||
|
@ -17,7 +17,7 @@ color cyan "\<([0-9]+|0x[0-9A-Fa-f]+)\>"
|
|||||||
color cyan "\<(true|false|null|undefined)\>"
|
color cyan "\<(true|false|null|undefined)\>"
|
||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color brightmagenta ""(\\.|[^"])*"|'(\\.|[^'])*'|`(\\.|[^`])*`"
|
color brightmagenta ""(\\.|[^"\])*"|'(\\.|[^'\])*'|`(\\.|[^`\])*`"
|
||||||
# Comments.
|
# Comments.
|
||||||
color brightblue "(^|[[:blank:]])//.*"
|
color brightblue "(^|[[:blank:]])//.*"
|
||||||
color brightblue start="/\*" end="\*/"
|
color brightblue start="/\*" end="\*/"
|
||||||
|
@ -26,7 +26,7 @@ color cyan "(^|[[:blank:]])#.*"
|
|||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
|
|
||||||
# Strings and others
|
# Strings and others
|
||||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
color yellow ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
|
||||||
color green "[][{}():;|`$<>!=&\]"
|
color green "[][{}():;|`$<>!=&\]"
|
||||||
|
|
||||||
# Basic variable names
|
# Basic variable names
|
||||||
|
@ -25,8 +25,8 @@ color white "\[[^][:blank:]]*\]"
|
|||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color brightblack "'([^'\]|(\\["'abfnrtv\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
color brightblack "'([^'\]|(\\["'abfnrtv\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
||||||
color brightblack "<[^= ]*>" ""(\\.|[^"])*""
|
color brightblack "<[^= ]*>|"(\\.|[^"\])*""
|
||||||
color brightblue "@"(\\.|[^"])*""
|
color brightblue "@"(\\.|[^"\])*""
|
||||||
|
|
||||||
# Preprocessor commands.
|
# Preprocessor commands.
|
||||||
color brightblue "^[[:blank:]]*#[[:blank:]]*(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)"
|
||||||
|
@ -25,7 +25,7 @@ color brightcyan "\<(and|or|xor)\>"
|
|||||||
color magenta "\<(break|continue|goto|return)\>"
|
color magenta "\<(break|continue|goto|return)\>"
|
||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color brightyellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
color brightyellow ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color brightblue "(^|[[:blank:]]+)//.*"
|
color brightblue "(^|[[:blank:]]+)//.*"
|
||||||
|
@ -33,7 +33,7 @@ color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:bla
|
|||||||
color cyan "(^|[[:blank:]])#.*"
|
color cyan "(^|[[:blank:]])#.*"
|
||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color brightyellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
color brightyellow ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
|
||||||
|
|
||||||
# Trailing whitespace.
|
# Trailing whitespace.
|
||||||
color ,green "[[:space:]]+$"
|
color ,green "[[:space:]]+$"
|
||||||
|
@ -17,7 +17,7 @@ color green "\<(alarm|auto_load_pkg|bsearch|catclose|catgets|catopen|ccollate|cc
|
|||||||
# Syntax:
|
# Syntax:
|
||||||
color brightblue "\<proc[[:blank:]]|\{|\}"
|
color brightblue "\<proc[[:blank:]]|\{|\}"
|
||||||
color green "\(|\)|\;|`|\\|\$|<|>|!|=|&|\|"
|
color green "\(|\)|\;|`|\\|\$|<|>|!|=|&|\|"
|
||||||
color brightyellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
color brightyellow ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
|
||||||
color brightred "\$\{?[0-9A-Za-z_!@#$*?-]+\}?"
|
color brightred "\$\{?[0-9A-Za-z_!@#$*?-]+\}?"
|
||||||
|
|
||||||
# Trailing whitespace:
|
# Trailing whitespace:
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user