commit 675ad6386d1e364686671211079368cb7d3ca4a0
parent 6ce3487b6578dcf9c25180802169079866059a9e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 2 Oct 2021 17:01:15 +0200
syntax: yaml: colorize the question mark of complex mappings too
See https://yaml.org/spec/1.2.2/#22-structures, example 2.11.
Also make the dash more visible by bolding it.
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/syntax/yaml.nanorc b/syntax/yaml.nanorc
@@ -13,11 +13,12 @@ comment "#"
color lightgreen "(\w|::|-)+:( |$)"
color lightgreen "\[(\w|::|[, -])+\]:( |$)"
-# Values (booleans, numbers, octal/hex, dates, strings):
+# Values (booleans, numbers, octal/hex):
color lightmagenta "[:,] +(Y(es)?|No?|y(es)?|no?|[Tt]rue|[Ff]alse|[Oo](n|ff))( *[]}]|, | +#|$)"
color lightmagenta "[:,] +[+-]?[0-9]+(\.([0-9]+)?)?( *[]}]|, | +#|$)"
color lightmagenta " 0(o[0-7]+|x[[:xdigit:]]+)( *[]}]|, | +#|$)"
color normal "[:,]( |$)"
+# Values (dates, strings):
color lightmagenta " [12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])"
color lightmagenta "("([^"]|\\")+"|'[^']+')"
@@ -26,7 +27,9 @@ color pink " [&*](\w|-)+( |$)"
# Symbols:
color bold,lagoon "^(---|\.\.\.)( |$)" " [|>]([1-9]?[+-]|[+-][1-9]?)?$"
-color yellow "(^ *- |[]{}[])"
+color bold,yellow "^ *(\?|([?:] +)?-) "
+color yellow "[]{}[]"
+color normal "^ *: "
# Types:
color mint " !!(binary|bool|float|int|map|null|omap|seq|set|str)( |$)"