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
parent
c2790a8af3
commit
71a73a1a10
|
@ -4,14 +4,14 @@
|
||||||
## License: GPL version 3 or newer
|
## License: GPL version 3 or newer
|
||||||
|
|
||||||
syntax yaml "\.ya?ml$"
|
syntax yaml "\.ya?ml$"
|
||||||
header "^---"
|
header "^---( |$)"
|
||||||
|
|
||||||
tabgives " "
|
tabgives " "
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
# Keys:
|
# Keys:
|
||||||
color lightgreen "(\w|-)+:( |$)"
|
color lightgreen "(\w|::|-)+:( |$)"
|
||||||
color lightgreen "\[(\w|[, -])+\]:( |$)"
|
color lightgreen "\[(\w|::|[, -])+\]:( |$)"
|
||||||
|
|
||||||
# Values (booleans, numbers, octal/hex, dates, strings):
|
# Values (booleans, numbers, octal/hex, dates, strings):
|
||||||
color lightmagenta "[:,] +(Y(es)?|No?|y(es)?|no?|[Tt]rue|[Ff]alse|[Oo](n|ff))( *[]}]|, | +#|$)"
|
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 " !!(binary|bool|float|int|map|null|omap|seq|set|str)( |$)"
|
||||||
color mint " !(\w|-)+( |$)"
|
color mint " !(\w|-)+( |$)"
|
||||||
|
|
||||||
# Mistakes (control codes, missing space, trailing space):
|
# Mistakes (control codes, trailing space):
|
||||||
color ,red "[[:cntrl:]]|[:,][^ ]| *$"
|
color ,red "[[:cntrl:]]| +$"
|
||||||
|
|
||||||
# Comments:
|
# Comments:
|
||||||
color italic,cyan "(^| )#.*"
|
color italic,cyan "(^| )#.*"
|
||||||
|
|
Loading…
Reference in New Issue