diff --git a/value_boolean.go b/value_boolean.go index f42a0df..7996347 100644 --- a/value_boolean.go +++ b/value_boolean.go @@ -4,15 +4,13 @@ import ( "git.makaay.nl/mauricem/go-parsekit/parse" ) -var ( - // Booleans are just the tokens you're used to. Always lowercase. - trueOrFalse = a.Str("true").Or(a.Str("false")) -) - +// Booleans are just the tokens you're used to. Always lowercase. func (t *parser) startBoolean(p *parse.API) { switch { - case p.Accept(tok.Boolean(nil, trueOrFalse)): - t.emitCommand(csetBoolVal, p.Result().Value(0).(bool)) + case p.Accept(a.Str("true")): + t.emitCommand(csetBoolVal, true) + case p.Accept(a.Str("false")): + t.emitCommand(csetBoolVal, false) default: p.Expected("true or false") }