commit 71a73a1a10cb5c007410c4f904687eb6c6229e87
parent c2790a8af34c03576be1cb1dce9c5411383f9669
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 30 Sep 2021 17:11:36 +0200
syntax: yaml: allow double colon in key & do not colorize unspaced colon
Perl keys can contain a double colon. And unspaced colons occur
quite regularly in values (URLs, IPv6 addresses, and the like)
and should not be colored as if they were an error.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/syntax/yaml.nanorc b/syntax/yaml.nanorc
@@ -4,14 +4,14 @@
## License: GPL version 3 or newer
syntax yaml "\.ya?ml$"
-header "^---"
+header "^---( |$)"
tabgives " "
comment "#"
# Keys:
-color lightgreen "(\w|-)+:( |$)"
-color lightgreen "\[(\w|[, -])+\]:( |$)"
+color lightgreen "(\w|::|-)+:( |$)"
+color lightgreen "\[(\w|::|[, -])+\]:( |$)"
# Values (booleans, numbers, octal/hex, dates, strings):
color lightmagenta "[:,] +(Y(es)?|No?|y(es)?|no?|[Tt]rue|[Ff]alse|[Oo](n|ff))( *[]}]|, | +#|$)"
@@ -32,8 +32,8 @@ color yellow "(^ *- |[]{}[])"
color mint " !!(binary|bool|float|int|map|null|omap|seq|set|str)( |$)"
color mint " !(\w|-)+( |$)"
-# Mistakes (control codes, missing space, trailing space):
-color ,red "[[:cntrl:]]|[:,][^ ]| *$"
+# Mistakes (control codes, trailing space):
+color ,red "[[:cntrl:]]| +$"
# Comments:
color italic,cyan "(^| )#.*"