go-toml/value_boolean.go

18 lines
369 B
Go

package toml
import (
"git.makaay.nl/mauricem/go-parsekit/parse"
)
// Booleans are just the tokens you're used to. Always lowercase.
func (t *parser) startBoolean(p *parse.API) {
switch {
case p.Accept(a.Str("true")):
t.addParsedItem(pBoolean, true)
case p.Accept(a.Str("false")):
t.addParsedItem(pBoolean, false)
default:
p.Expected("true or false")
}
}