Add more options for Booleans

This commit is contained in:
Derek Collison
2016-11-21 15:06:15 -08:00
parent e57c949658
commit 6b307af1eb
3 changed files with 18 additions and 5 deletions

View File

@@ -684,8 +684,10 @@ func lexMapEnd(lx *lexer) stateFn {
// Checks if the unquoted string was actually a boolean
func (lx *lexer) isBool() bool {
str := lx.input[lx.start:lx.pos]
return str == "true" || str == "false" || str == "TRUE" || str == "FALSE"
str := strings.ToLower(lx.input[lx.start:lx.pos])
return str == "true" || str == "false" ||
str == "on" || str == "off" ||
str == "yes" || str == "no"
}
// Check if the unquoted string is a variable reference, starting with $.