filtercomp

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpAST

func DumpAST(node AST, indent int)

Types

type AST

type AST interface {
	Eval(mapset.Set[string]) bool
}

type AndAST

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

func (*AndAST) Eval

func (a *AndAST) Eval(s mapset.Set[string]) bool

type NegatedAST added in v0.0.6

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

func (*NegatedAST) Eval added in v0.0.6

func (n *NegatedAST) Eval(s mapset.Set[string]) bool

type OrAST

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

func (*OrAST) Eval

func (o *OrAST) Eval(s mapset.Set[string]) bool

type ParenAST

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

func (*ParenAST) Eval

func (p *ParenAST) Eval(s mapset.Set[string]) bool

type Parser

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

func NewParser

func NewParser(tokens []Token) *Parser

func (*Parser) Parse

func (p *Parser) Parse() (AST, error)

Parse is the entrypoint and kick off method to start the parsing process.

type TextAST

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

func (*TextAST) Eval

func (t *TextAST) Eval(s mapset.Set[string]) bool

type TextASTCheckType

type TextASTCheckType int
const (
	// EqualityCheck is a simple direct == or Contains check.
	EqualityCheck TextASTCheckType = 0
	// PrefixCheck is a strings.HasPrefix check, linear scan when a set is checked.
	PrefixCheck TextASTCheckType = 1
	// SuffixCheck is a strings.HasSuffix check, linear scan when a set is checked.
	SuffixCheck TextASTCheckType = 2
)

type Token

type Token struct {
	Name string
	Kind TokenKind
}

func Tokenize

func Tokenize(data []byte) []Token

type TokenKind

type TokenKind int
const (
	TokenKindName    TokenKind = iota
	TokenKindSymbol  TokenKind = iota
	TokenKindLogical TokenKind = iota
)

Jump to

Keyboard shortcuts

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