Skip to content

Commit

Permalink
yaml parse for all bool keyword constant variations
Browse files Browse the repository at this point in the history
  • Loading branch information
yaythomas authored and alecthomas committed May 11, 2020
1 parent 684c267 commit 16bde86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lexers/y/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ var YAML = internal.Register(MustNewLexer(
{`.`, Text, nil},
},
"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},
{`'(?:\\.|[^'])*'`, StringSingle, nil},
{`\d\d\d\d-\d\d-\d\d([T ]\d\d:\d\d:\d\d(\.\d+)?(Z|\s+[-+]\d+)?)?`, LiteralDate, nil},
Expand Down

0 comments on commit 16bde86

Please sign in to comment.