pm

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Lua pattern match functions for Go

Index

Constants

View Source
const EOS = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type BitmapClass added in v1.0.7

type BitmapClass struct {
	// contains filtered or unexported fields
}

func NewBitmapClass added in v1.0.7

func NewBitmapClass() *BitmapClass

func (*BitmapClass) AddChar added in v1.0.7

func (bc *BitmapClass) AddChar(ch byte)

func (*BitmapClass) AddRange added in v1.0.7

func (bc *BitmapClass) AddRange(start, end byte)

func (*BitmapClass) Matches added in v1.0.7

func (bc *BitmapClass) Matches(ch int) bool

func (*BitmapClass) SetNot added in v1.0.7

func (bc *BitmapClass) SetNot(not bool)

type CharBitmap added in v1.0.7

type CharBitmap struct {
	// contains filtered or unexported fields
}

func NewCharBitmap added in v1.0.7

func NewCharBitmap() *CharBitmap

func (*CharBitmap) Set added in v1.0.7

func (b *CharBitmap) Set(ch byte)

func (*CharBitmap) Test added in v1.0.7

func (b *CharBitmap) Test(ch byte) bool

type DFA added in v1.0.7

type DFA struct {
	// contains filtered or unexported fields
}

type DFACache added in v1.0.7

type DFACache struct {
	// contains filtered or unexported fields
}

func (*DFACache) Get added in v1.0.7

func (dc *DFACache) Get(pattern string) (*DFA, bool)

func (*DFACache) Put added in v1.0.7

func (dc *DFACache) Put(pattern string, dfa *DFA)

type DFAState added in v1.0.7

type DFAState struct {
	// contains filtered or unexported fields
}

type DFATransition added in v1.0.7

type DFATransition struct {
	// contains filtered or unexported fields
}

type Error

type Error struct {
	Pos     int
	Message string
}

func (*Error) Error

func (e *Error) Error() string

type JumpTable added in v1.0.7

type JumpTable struct {
	// contains filtered or unexported fields
}

func NewJumpTable added in v1.0.7

func NewJumpTable(pattern string) *JumpTable

func (*JumpTable) Search added in v1.0.7

func (jt *JumpTable) Search(text []byte) []int

type MatchData

type MatchData struct {
	// contains filtered or unexported fields
}

func Find

func Find(p string, src []byte, offset, limit int) (matches []*MatchData, err error)

func (*MatchData) Capture

func (st *MatchData) Capture(idx int) int

func (*MatchData) CaptureLength

func (st *MatchData) CaptureLength() int

func (*MatchData) IsPosCapture

func (st *MatchData) IsPosCapture(idx int) bool

type PatternCache added in v1.0.7

type PatternCache struct {
	// contains filtered or unexported fields
}

func (*PatternCache) Get added in v1.0.7

func (pc *PatternCache) Get(pattern string) (PatternResult, bool)

func (*PatternCache) Put added in v1.0.7

func (pc *PatternCache) Put(pattern string, result PatternResult)

type PatternCacheEntry added in v1.0.7

type PatternCacheEntry struct {
	// contains filtered or unexported fields
}

type PatternResult added in v1.0.7

type PatternResult struct {
	// contains filtered or unexported fields
}

type Trie added in v1.0.7

type Trie struct {
	// contains filtered or unexported fields
}

func NewTrie added in v1.0.7

func NewTrie() *Trie

func (*Trie) Insert added in v1.0.7

func (t *Trie) Insert(pattern string)

func (*Trie) Search added in v1.0.7

func (t *Trie) Search(text []byte) []string

type TrieNode added in v1.0.7

type TrieNode struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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