1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-07-13 01:10:14 +02:00

yaml parse for all bool keyword constant variations

This commit is contained in:
thomas
2020-05-11 03:00:18 +01:00
committed by Alec Thomas
parent 684c267d74
commit 16bde869ae

View File

@ -30,7 +30,9 @@ var YAML = internal.Register(MustNewLexer(
{`.`, Text, nil}, {`.`, Text, nil},
}, },
"value": { "value": {
{Words(``, `\b`, "true", "false", "null"), KeywordConstant, nil}, {Words(``, `\b`, "true", "True", "TRUE", "false", "False", "FALSE", "null",
"y", "Y", "yes", "Yes", "YES", "n", "N", "no", "No", "NO",
"on", "On", "ON", "off", "Off", "OFF"), KeywordConstant, nil},
{`"(?:\\.|[^"])*"`, StringDouble, nil}, {`"(?:\\.|[^"])*"`, StringDouble, nil},
{`'(?:\\.|[^'])*'`, StringSingle, nil}, {`'(?:\\.|[^'])*'`, StringSingle, nil},
{`\d\d\d\d-\d\d-\d\d([T ]\d\d:\d\d:\d\d(\.\d+)?(Z|\s+[-+]\d+)?)?`, LiteralDate, nil}, {`\d\d\d\d-\d\d-\d\d([T ]\d\d:\d\d:\d\d(\.\d+)?(Z|\s+[-+]\d+)?)?`, LiteralDate, nil},