Documentation ¶
Overview ¶
Parser combinator libray using generics. Mostly taken from: https://github.com/jhbrown-veradept/gophercon22-parser-combinators
Index ¶
- Variables
- func Fail[T any](initial state) (T, state, error)
- func Parse[T any](p Parser[T], data string) (T, string, error)
- type Empty
- type Parser
- func AndThen[T, U any](p Parser[T], fn func(T) Parser[U]) Parser[U]
- func Any(fn func(rune) bool) Parser[Empty]
- func AppendKeeping[T, U any](pt Parser[T], pu Parser[U]) Parser[Seq[T, U]]
- func AppendSkipping[T, U any](pt Parser[T], pu Parser[U]) Parser[T]
- func Apply[T, A any](p Parser[Seq[Empty, T]], fn func(T) A) Parser[A]
- func Apply2[T, U, A any](p Parser[Seq[Seq[Empty, T], U]], fn func(T, U) A) Parser[A]
- func Apply3[T, U, V, A any](p Parser[Seq[Seq[Seq[Empty, T], U], V]], fn func(T, U, V) A) Parser[A]
- func Exact(token string) Parser[Empty]
- func GetString[T any](p Parser[T]) Parser[string]
- func If(fn func(rune) bool) Parser[Empty]
- func Map[T, U any](p Parser[T], fn func(T) U) Parser[U]
- func OneOf[T any](ps ...Parser[T]) Parser[T]
- func Some(fn func(rune) bool) Parser[Empty]
- func StartKeeping[T any](p Parser[T]) Parser[Seq[Empty, T]]
- func StartSkipping[T any](p Parser[T]) Parser[Empty]
- func Succeed[T any](val T) Parser[T]
- type Seq
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoMatch = errors.New("no match")
)
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.