Versions in this module Expand all Collapse all v1 v1.3.13 May 12, 2026 Changes in this version + var NoMatchErr = fmt.Errorf("no match") + func BoolErrFn[T any](fn func(T) bool) func(T) error + func BytesSnippet(src []byte, mp MPos, pad int) string + func FatalError(err error) error + func FatalError2(tag string, err error) error + func IsFatalError(err error) bool + func IterateStructFields(tag string, v any, byPtr bool) iter.Seq2[string, any] + func ReverseString(s string) string + func UserDataPtrFn[T any](key string) func(*ParserState) *T + type MFn func(*ParserState, Pos) (MPos, error) + func AppendFn[T any](dst func(*ParserState) *[]T, fn VFn[T]) MFn + func AppendLocal[T any](w *[]T, fn VFn[T]) MFn + func Assign2Fn[T any](dst func(*ParserState) **T, fn VFn[T]) MFn + func Assign2Local[T any](v **T, fn VFn[T]) MFn + func AssignFn[T any](dst func(*ParserState) *T, fn VFn[T]) MFn + func AssignLocal[T any](v *T, fn VFn[T]) MFn + func Debug2(fn func()) MFn + type MPos struct + End Pos + Start Pos + func (mp MPos) Bounds() (Pos, Pos) + type ParserState struct + Ignore MFn + UserData map[string]any + func NewParserStateFromBytes(src []byte) *ParserState + func NewParserStateFromString(s string) *ParserState + func (ps *ParserState) Snippet(mp MPos) string + func (ps *ParserState) Source(mp MPos) []byte + func (ps *ParserState) SourceStr(mp MPos) string + type Pos int + type Rules struct + func NewRules() Rules + func (g Rules) And(fns ...MFn) MFn + func (g Rules) AnyExceptNewline() MFn + func (g Rules) AnyRune() MFn + func (g Rules) AsciiLetter() MFn + func (g Rules) Bool() MFn + func (g Rules) BruteCoverPos(backward, forward MFn) MFn + func (g Rules) BruteCoverPosEnd(backward, forward MFn) MFn + func (g Rules) Byte(b byte) MFn + func (g Rules) ByteFn(fn func(byte) bool) MFn + func (g Rules) Debug(on bool, prefix string, fn MFn) MFn + func (g Rules) DebugAnd(on bool, prefix string, fns ...MFn) MFn + func (g Rules) DebugOr(on bool, prefix string, fns ...MFn) MFn + func (g Rules) Digit() MFn + func (g Rules) DigitNotZero() MFn + func (g Rules) Digits() MFn + func (g Rules) EmptyLinesExceptNewline(ignore MFn) MFn + func (g Rules) Eof() MFn + func (g Rules) EofAbs() MFn + func (g Rules) Escape(esc rune) MFn + func (g Rules) Fail() MFn + func (g Rules) FatalOnError(tag string, fn MFn) MFn + func (g Rules) Float() MFn + func (g Rules) Float2(sep rune) MFn + func (g Rules) HexBytes() MFn + func (g Rules) Identifier() MFn + func (g Rules) Integer() MFn + func (g Rules) IsTrue(v bool) MFn + func (g Rules) LastAnyRune() MFn + func (g Rules) Letter() MFn + func (g Rules) LineComment1(open string) MFn + func (g Rules) Loop1(fn MFn) MFn + func (g Rules) LoopConsumeUntil(consumeFn, untilFn MFn) MFn + func (g Rules) LoopSep(optLastSep bool, fn, sepFn MFn) MFn + func (g Rules) LoopSepAllowEmpty(fn, sepFn MFn) MFn + func (g Rules) LoopToNLOrEof(esc rune, includeNL bool) MFn + func (g Rules) MaxNRunes(n int) MFn + func (g Rules) NRunes(n int) MFn + func (g Rules) Newline() MFn + func (g Rules) NoOp() MFn + func (g Rules) NoOp2(fn func() error) MFn + func (g Rules) Not(fn MFn) MFn + func (g Rules) Optional(fn MFn) MFn + func (g Rules) Or(fns ...MFn) MFn + func (g Rules) Parse(ps *ParserState, fn MFn) (Pos, error) + func (g Rules) ParseAt(ps *ParserState, pos Pos, fn MFn) (Pos, error) + func (g Rules) Peek(fn MFn) MFn + func (g Rules) PeekBackN(n int, fn MFn) MFn + func (g Rules) QuotedSection(quote string, esc rune, consume MFn) MFn + func (g Rules) QuotedString1() MFn + func (g Rules) QuotedString2(esc rune, maxLen1, maxLen2 int) MFn + func (g Rules) ReverseSource(fn MFn) MFn + func (g Rules) Rune(ru rune) MFn + func (g Rules) RuneAnyOf(rus ...rune) MFn + func (g Rules) RuneAnyOfString(s string) MFn + func (g Rules) RuneFn(fn func(rune) bool) MFn + func (g Rules) RuneNotAnyOf(rus ...rune) MFn + func (g Rules) Section(open, close string, esc rune, newlineCloses, eofCloses bool, consume MFn) MFn + func (g Rules) Seq(s string) MFn + func (g Rules) SeqOrMid(s string) MFn + func (g Rules) Sign() MFn + func (g Rules) Sof() MFn + func (g Rules) SofAbs() MFn + func (g Rules) Sop() MFn + func (g Rules) Space() MFn + func (g Rules) Spaces() MFn + func (g Rules) SpacesExceptNewline() MFn + func (g Rules) ToIndexByte(b byte) MFn + func (g Rules) ToIndexByteOrEnd(b byte) MFn + func (g Rules) ToLastIndexByte(b byte) MFn + func (g Rules) ToLastIndexByteOrStart(b byte) MFn + func (g Rules) Token(fn MFn) MFn + func (g Rules) UnicodeLetter() MFn + func (g Rules) VBool() VFn[bool] + func (g Rules) VByte() VFn[byte] + func (g Rules) VBytes(fn MFn) VFn[[]byte] + func (g Rules) VFloat() VFn[float64] + func (g Rules) VIdentifier() VFn[string] + func (g Rules) VInteger() VFn[int] + func (g Rules) VLastRune() VFn[rune] + func (g Rules) VQuotedString1() VFn[string] + func (g Rules) VRune() VFn[rune] + func (g Rules) VString(fn MFn) VFn[string] + func (g Rules) VTime(fmt string) VFn[time.Time] + func (g Rules) WithBounds(back, forward int, fn MFn) MFn + func (g Rules) WithBoundsAbs(start, end Pos, fn MFn) MFn + func (g Rules) WithLineBounds(back, forward int, fn MFn) MFn + type VFn func(*ParserState, Pos) (T, MPos, error) + func VAny[T any](fn VFn[T]) VFn[any] + func VAppend[T any](fn VFn[T]) VFn[[]T] + func VCast[T, U any](fn VFn[U]) VFn[T] + func VConst[T any](fn MFn, v T) VFn[T] + func VFromMPos[T any](fn MFn, makeFn func(*ParserState, MPos) T) VFn[T] + func VOr[T any](fns ...VFn[T]) VFn[T] + func VToken[T any](fn VFn[T]) VFn[T] + type VHandler func(T) error + type VMaker func(MPos) (T, error)