parser

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotMatched = errors.New("not matched") // parser didn't match input
)

Functions

This section is empty.

Types

type Accumulator

type Accumulator[T, R any] func(R, T) R

type BitReader

type BitReader interface {
	Reader
	ReadBits(uint8) (uint64, uint8, error)
	ReadBool() (bool, error)
}

type Empty

type Empty struct{}

type Pair

type Pair[A, B any] struct {
	First  A
	Second B
}

type Parser

type Parser[R Reader, T any] ParserFunc[R, T]

func Ptr

func Ptr[R Reader, T any](p *Parser[R, T]) Parser[R, T]

func Untyped

func Untyped[R Reader, T any](p Parser[R, T]) Parser[R, interface{}]

type ParserConstraint

type ParserConstraint[R Reader, T any] interface {
	ParserFunc[R, T] | ParserFuncPtr[R, T]
}

type ParserFunc

type ParserFunc[R Reader, T any] func(in R) (T, error)

type ParserFuncPtr

type ParserFuncPtr[R Reader, T any] *func(in R) (T, error)

type Predicate

type Predicate[T any] func(T) bool

type Reader

type Reader interface {
	io.ReadSeeker
	io.ByteReader
	io.RuneReader
}

Directories

Path Synopsis
Package ascii provides parsers for recognizing ascii bytes
Package ascii provides parsers for recognizing ascii bytes
Package bytes provides parsers for recognizing bytes
Package bytes provides parsers for recognizing bytes
Package numeric provides parsers for recognizing numeric bytes
Package numeric provides parsers for recognizing numeric bytes
Package runes provides parsers for recognizing runes
Package runes provides parsers for recognizing runes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL