filter

package
v0.0.0-...-8a68773 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARENS = "()"
	BRACES = "{}"

	OPEN_DELIMS  = "({"
	CLOSE_DELIMS = ")}"
)

Delimiters

View Source
const (
	PRE_TEXT_MODE int = iota
	TEXT_MODE
	POST_TEXT_MODE
	QUOTED_TEXT_MODE
)

Variables

View Source
var DELIM_PAIRS []string

Set in init

Functions

This section is empty.

Types

type ElementParser

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

func NewElementParser

func NewElementParser(filterStr string, startIdx int, lastIdx int) *ElementParser

func NewFullElementParser

func NewFullElementParser(filterStr string) *ElementParser

func (*ElementParser) CheckDelims

func (p *ElementParser) CheckDelims() error

func (*ElementParser) Parse

func (p *ElementParser) Parse() (*FilterElement, error)

type FilterElement

type FilterElement struct {
	// FilterStr and SubElems are mutually exclusive
	FilterStr string
	SubElems  []*FilterElement

	// If not empty string, must be a 2 character string
	Delims string
	// Whitespace
	PreWs  string
	PostWs string
}

func NewStrFilterElement

func NewStrFilterElement(
	fs string, delims string, preWs string, postWs string) *FilterElement

func NewSubElemFilterElement

func NewSubElemFilterElement(
	ses []*FilterElement, delims string, preWs string, postWs string) *FilterElement

func ParseElement

func ParseElement(filterStr string) (*FilterElement, error)

func (*FilterElement) Equals

func (e *FilterElement) Equals(other *FilterElement) bool

func (*FilterElement) FullFilterStr

func (e *FilterElement) FullFilterStr() string

func (*FilterElement) HasSubElems

func (e *FilterElement) HasSubElems() bool

func (*FilterElement) String

func (e *FilterElement) String() string

Object representation

func (*FilterElement) StringCustom

func (e *FilterElement) StringCustom(showPtr bool, indent int, singleLine bool,
) string

func (*FilterElement) StringCustomLines

func (e *FilterElement) StringCustomLines(showPtr bool, indent int, singleLine bool,
) []string

type ParseMode

type ParseMode int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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