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.
master
Benno Schulenberg 2021-09-30 17:11:36 +02:00
parent c2790a8af3
commit 71a73a1a10
1 changed files with 5 additions and 5 deletions

View File

@ -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 "(^| )#.*"