go-toml/toml.go

23 lines
624 B
Go

package toml
import (
"git.makaay.nl/mauricem/go-parsekit/tokenize"
)
// Some globally useful tokenizer definitions.
var (
c, a, m, tok = tokenize.C, tokenize.A, tokenize.M, tokenize.T
// From the specs: "Whitespace means tab (0x09) or space (0x20)."
// In this package, we name this a blank, to be in line with the
// terminology as used in parsekit.
blank = a.Runes('\t', ' ')
// Newline means LF (0x0A) or CRLF (0x0D0A).
// This matches the default newline as defined by parsekit.
newline = a.Newline
dropBlanks = m.Drop(c.ZeroOrMore(blank))
dropWhitespace = m.Drop(c.ZeroOrMore(blank.Or(newline)))
)