Documentation
¶
Index ¶
- func Equal(a, b []*Node) bool
- func Graphviz(pattern string, m Matcher) string
- func IsSpecial(c byte) bool
- func OneWithLeastChildren(nodes []*Node) int
- func SameKind(nodes []*Node, kind Type) bool
- type AnyMatcher
- type AnyOfMatcher
- type Container
- type ContainsMatcher
- type EveryOfMatcher
- type IndexedAnyOfMatcher
- type IndexedEveryOf
- type IndexedSizedAnyOfMatcher
- type IndexedTreeMatcher
- type Indexer
- type Lexer
- type ListData
- type ListMatcher
- type MatchIndexSizer
- type MatchIndexer
- type MatchSizer
- type Matcher
- type Matchers
- type MaxMatcher
- type MinMatcher
- type Node
- type NothingMatcher
- type PrefixAnyMatcher
- type PrefixMatcher
- type PrefixSuffixMatcher
- type RangeData
- type RangeMatcher
- type RowMatcher
- type SingleMatcher
- type SizedTreeMatcher
- type Sizer
- type SomePool
- type SuffixAnyMatcher
- type SuffixMatcher
- type SuperMatcher
- type TextData
- type TextMatcher
- type Token
- type TokenType
- type TreeMatcher
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OneWithLeastChildren ¶
Types ¶
type AnyMatcher ¶
type AnyMatcher struct {
// contains filtered or unexported fields
}
func NewAny ¶
func NewAny(s []rune) AnyMatcher
func (AnyMatcher) Len ¶
func (AnyMatcher) Len() int
func (AnyMatcher) Match ¶
func (m AnyMatcher) Match(s string) bool
func (AnyMatcher) String ¶
func (m AnyMatcher) String() string
type AnyOfMatcher ¶
type AnyOfMatcher struct {
// contains filtered or unexported fields
}
func (AnyOfMatcher) Content ¶
func (m AnyOfMatcher) Content(f func(Matcher))
func (AnyOfMatcher) Len ¶
func (m AnyOfMatcher) Len() (n int)
func (AnyOfMatcher) Match ¶
func (m AnyOfMatcher) Match(s string) (ok bool)
func (AnyOfMatcher) String ¶
func (m AnyOfMatcher) String() string
String satisfies the fmt.Stringer interface.
type ContainsMatcher ¶
type ContainsMatcher struct {
// contains filtered or unexported fields
}
func NewContains ¶
func NewContains(needle string) ContainsMatcher
func NewNotContains ¶
func NewNotContains(needle string) ContainsMatcher
func (ContainsMatcher) Len ¶
func (m ContainsMatcher) Len() int
func (ContainsMatcher) Match ¶
func (m ContainsMatcher) Match(s string) bool
func (ContainsMatcher) String ¶
func (m ContainsMatcher) String() string
String satisfies the fmt.Stringer interface.
type EveryOfMatcher ¶
type EveryOfMatcher struct {
// contains filtered or unexported fields
}
func (EveryOfMatcher) Content ¶
func (m EveryOfMatcher) Content(f func(Matcher))
func (EveryOfMatcher) Len ¶
func (m EveryOfMatcher) Len() (n int)
func (EveryOfMatcher) Match ¶
func (m EveryOfMatcher) Match(s string) bool
func (EveryOfMatcher) String ¶
func (m EveryOfMatcher) String() string
String satisfies the fmt.Stringer interface.
type IndexedAnyOfMatcher ¶
type IndexedAnyOfMatcher struct {
AnyOfMatcher
// contains filtered or unexported fields
}
func (IndexedAnyOfMatcher) Index ¶
func (m IndexedAnyOfMatcher) Index(s string) (index int, segments []int)
func (IndexedAnyOfMatcher) String ¶
func (m IndexedAnyOfMatcher) String() string
String satisfies the fmt.Stringer interface.
type IndexedEveryOf ¶
type IndexedEveryOf struct {
EveryOfMatcher
// contains filtered or unexported fields
}
func (IndexedEveryOf) String ¶
func (m IndexedEveryOf) String() string
String satisfies the fmt.Stringer interface.
type IndexedSizedAnyOfMatcher ¶
type IndexedSizedAnyOfMatcher struct {
IndexedAnyOfMatcher
// contains filtered or unexported fields
}
func (IndexedSizedAnyOfMatcher) Size ¶
func (m IndexedSizedAnyOfMatcher) Size() int
type IndexedTreeMatcher ¶
type IndexedTreeMatcher struct {
// contains filtered or unexported fields
}
type ListMatcher ¶
type ListMatcher struct {
// contains filtered or unexported fields
}
func NewList ¶
func NewList(rs []rune, not bool) ListMatcher
func (ListMatcher) Len ¶
func (ListMatcher) Len() int
func (ListMatcher) Match ¶
func (m ListMatcher) Match(s string) bool
func (ListMatcher) Size ¶
func (ListMatcher) Size() int
func (ListMatcher) String ¶
func (m ListMatcher) String() string
String satisfies the fmt.Stringer interface.
type MatchIndexSizer ¶
func MatchIndexSizers ¶
func MatchIndexSizers(v []Matcher) ([]MatchIndexSizer, bool)
func MustIndexedSizedAnyOf ¶
func MustIndexedSizedAnyOf(v ...Matcher) MatchIndexSizer
type MatchIndexer ¶
func MatchIndexers ¶
func MatchIndexers(v []Matcher) ([]MatchIndexer, bool)
func MustIndexedAnyOf ¶
func MustIndexedAnyOf(v ...Matcher) MatchIndexer
type MatchSizer ¶
type Matcher ¶
func BuildMatcher ¶
func MinimizeMatcher ¶
func NewEveryOf ¶
func NewTree ¶
func NewTree(v MatchIndexer, l, r Matcher) Matcher
type Matchers ¶
type Matchers []Matcher
func (Matchers) String ¶
String satisfies the fmt.Stringer interface.
type MaxMatcher ¶
type MaxMatcher struct {
// contains filtered or unexported fields
}
func NewMax ¶
func NewMax(n int) MaxMatcher
func (MaxMatcher) Len ¶
func (m MaxMatcher) Len() int
func (MaxMatcher) Match ¶
func (m MaxMatcher) Match(s string) bool
func (MaxMatcher) String ¶
func (m MaxMatcher) String() string
String satisfies the fmt.Stringer interface.
type MinMatcher ¶
type MinMatcher struct {
// contains filtered or unexported fields
}
func NewMin ¶
func NewMin(n int) MinMatcher
func (MinMatcher) Len ¶
func (m MinMatcher) Len() int
func (MinMatcher) Match ¶
func (m MinMatcher) Match(s string) bool
func (MinMatcher) String ¶
func (m MinMatcher) String() string
String satisfies the fmt.Stringer interface.
type Node ¶
func AppendUnique ¶
func CommonChildren ¶
type NothingMatcher ¶
type NothingMatcher struct{}
func NewNothing ¶
func NewNothing() NothingMatcher
func (NothingMatcher) Len ¶
func (NothingMatcher) Len() int
func (NothingMatcher) Match ¶
func (NothingMatcher) Match(s string) bool
func (NothingMatcher) Size ¶
func (NothingMatcher) Size() int
func (NothingMatcher) String ¶
func (NothingMatcher) String() string
String satisfies the fmt.Stringer interface.
type PrefixAnyMatcher ¶
type PrefixAnyMatcher struct {
// contains filtered or unexported fields
}
func NewPrefixAny ¶
func NewPrefixAny(s string, sep []rune) PrefixAnyMatcher
func (PrefixAnyMatcher) Len ¶
func (m PrefixAnyMatcher) Len() int
func (PrefixAnyMatcher) Match ¶
func (m PrefixAnyMatcher) Match(s string) bool
func (PrefixAnyMatcher) String ¶
func (m PrefixAnyMatcher) String() string
String satisfies the fmt.Stringer interface.
type PrefixMatcher ¶
type PrefixMatcher struct {
// contains filtered or unexported fields
}
func NewPrefix ¶
func NewPrefix(p string) PrefixMatcher
func (PrefixMatcher) Len ¶
func (m PrefixMatcher) Len() int
func (PrefixMatcher) Match ¶
func (m PrefixMatcher) Match(s string) bool
func (PrefixMatcher) String ¶
func (m PrefixMatcher) String() string
String satisfies the fmt.Stringer interface.
type PrefixSuffixMatcher ¶
type PrefixSuffixMatcher struct {
// contains filtered or unexported fields
}
func NewPrefixSuffix ¶
func NewPrefixSuffix(prefix, suffix string) PrefixSuffixMatcher
func (PrefixSuffixMatcher) Len ¶
func (m PrefixSuffixMatcher) Len() int
func (PrefixSuffixMatcher) Match ¶
func (m PrefixSuffixMatcher) Match(s string) bool
func (PrefixSuffixMatcher) String ¶
func (m PrefixSuffixMatcher) String() string
String satisfies the fmt.Stringer interface.
type RangeMatcher ¶
func NewRange ¶
func NewRange(lo, hi rune, not bool) RangeMatcher
func (RangeMatcher) Len ¶
func (RangeMatcher) Len() int
func (RangeMatcher) Match ¶
func (m RangeMatcher) Match(s string) (ok bool)
func (RangeMatcher) Size ¶
func (RangeMatcher) Size() int
func (RangeMatcher) String ¶
func (m RangeMatcher) String() string
String satisfies the fmt.Stringer interface.
type RowMatcher ¶
type RowMatcher struct {
// contains filtered or unexported fields
}
func NewRow ¶
func NewRow(ms []MatchIndexSizer) RowMatcher
func (RowMatcher) Content ¶
func (m RowMatcher) Content(f func(Matcher))
func (RowMatcher) Len ¶
func (m RowMatcher) Len() int
func (RowMatcher) Match ¶
func (m RowMatcher) Match(s string) (ok bool)
func (RowMatcher) Size ¶
func (m RowMatcher) Size() int
func (RowMatcher) String ¶
func (m RowMatcher) String() string
String satisfies the fmt.Stringer interface.
type SingleMatcher ¶
type SingleMatcher struct {
// contains filtered or unexported fields
}
single represents ?
func NewSingle ¶
func NewSingle(s []rune) SingleMatcher
func (SingleMatcher) Len ¶
func (SingleMatcher) Len() int
func (SingleMatcher) Match ¶
func (m SingleMatcher) Match(v string) bool
func (SingleMatcher) Size ¶
func (SingleMatcher) Size() int
func (SingleMatcher) String ¶
func (m SingleMatcher) String() string
String satisfies the fmt.Stringer interface.
type SizedTreeMatcher ¶
type SizedTreeMatcher struct {
TreeMatcher
}
func (SizedTreeMatcher) Size ¶
func (m SizedTreeMatcher) Size() int
type SuffixAnyMatcher ¶
type SuffixAnyMatcher struct {
// contains filtered or unexported fields
}
func NewSuffixAny ¶
func NewSuffixAny(s string, sep []rune) SuffixAnyMatcher
func (SuffixAnyMatcher) Len ¶
func (m SuffixAnyMatcher) Len() int
func (SuffixAnyMatcher) Match ¶
func (m SuffixAnyMatcher) Match(v string) bool
func (SuffixAnyMatcher) String ¶
func (m SuffixAnyMatcher) String() string
String satisfies the fmt.Stringer interface.
type SuffixMatcher ¶
type SuffixMatcher struct {
// contains filtered or unexported fields
}
func NewSuffix ¶
func NewSuffix(s string) SuffixMatcher
func (SuffixMatcher) Len ¶
func (m SuffixMatcher) Len() int
func (SuffixMatcher) Match ¶
func (m SuffixMatcher) Match(v string) bool
func (SuffixMatcher) String ¶
func (m SuffixMatcher) String() string
String satisfies the fmt.Stringer interface.
type SuperMatcher ¶
type SuperMatcher struct{}
func NewSuper ¶
func NewSuper() SuperMatcher
func (SuperMatcher) Len ¶
func (m SuperMatcher) Len() int
func (SuperMatcher) Match ¶
func (m SuperMatcher) Match(_ string) bool
func (SuperMatcher) String ¶
func (m SuperMatcher) String() string
String satisfies the fmt.Stringer interface.
type TextMatcher ¶
type TextMatcher struct {
// contains filtered or unexported fields
}
TextMatcher represents raw string to match
func NewText ¶
func NewText(s string) TextMatcher
func (TextMatcher) BytesCount ¶
func (m TextMatcher) BytesCount() int
func (TextMatcher) Len ¶
func (m TextMatcher) Len() int
func (TextMatcher) Match ¶
func (m TextMatcher) Match(s string) bool
func (TextMatcher) Size ¶
func (m TextMatcher) Size() int
func (TextMatcher) String ¶
func (m TextMatcher) String() string
String satisfies the fmt.Stringer interface.
type TreeMatcher ¶
type TreeMatcher struct {
// contains filtered or unexported fields
}
func (TreeMatcher) Content ¶
func (m TreeMatcher) Content(f func(Matcher))
func (TreeMatcher) Len ¶
func (m TreeMatcher) Len() int
func (TreeMatcher) Match ¶
func (m TreeMatcher) Match(s string) (ok bool)
func (TreeMatcher) String ¶
func (m TreeMatcher) String() string
String satisfies the fmt.Stringer interface.