match

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2018 License: MIT Imports: 6 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any struct {
	Separators []rune
}

func NewAny

func NewAny(s []rune) Any

func (Any) Index

func (self Any) Index(s string) (int, []int)

func (Any) Len

func (self Any) Len() int

func (Any) Match

func (self Any) Match(s string) bool

func (Any) String

func (self Any) String() string

type AnyOf

type AnyOf struct {
	Matchers Matchers
}

func NewAnyOf

func NewAnyOf(m ...Matcher) AnyOf

func (*AnyOf) Add

func (self *AnyOf) Add(m Matcher) error

func (AnyOf) Index

func (self AnyOf) Index(s string) (int, []int)

func (AnyOf) Len

func (self AnyOf) Len() (l int)

func (AnyOf) Match

func (self AnyOf) Match(s string) bool

func (AnyOf) String

func (self AnyOf) String() string

type BTree

type BTree struct {
	Value            Matcher
	Left             Matcher
	Right            Matcher
	ValueLengthRunes int
	LeftLengthRunes  int
	RightLengthRunes int
	LengthRunes      int
}

func NewBTree

func NewBTree(Value, Left, Right Matcher) (tree BTree)

func (BTree) Index

func (self BTree) Index(s string) (int, []int)

todo?

func (BTree) Len

func (self BTree) Len() int

func (BTree) Match

func (self BTree) Match(s string) bool

func (BTree) String

func (self BTree) String() string

type Contains

type Contains struct {
	Needle string
	Not    bool
}

func NewContains

func NewContains(needle string, not bool) Contains

func (Contains) Index

func (self Contains) Index(s string) (int, []int)

func (Contains) Len

func (self Contains) Len() int

func (Contains) Match

func (self Contains) Match(s string) bool

func (Contains) String

func (self Contains) String() string

type EveryOf

type EveryOf struct {
	Matchers Matchers
}

func NewEveryOf

func NewEveryOf(m ...Matcher) EveryOf

func (*EveryOf) Add

func (self *EveryOf) Add(m Matcher) error

func (EveryOf) Index

func (self EveryOf) Index(s string) (int, []int)

func (EveryOf) Len

func (self EveryOf) Len() (l int)

func (EveryOf) Match

func (self EveryOf) Match(s string) bool

func (EveryOf) String

func (self EveryOf) String() string

type List

type List struct {
	List []rune
	Not  bool
}

func NewList

func NewList(list []rune, not bool) List

func (List) Index

func (self List) Index(s string) (int, []int)

func (List) Len

func (self List) Len() int

func (List) Match

func (self List) Match(s string) bool

func (List) String

func (self List) String() string

type Matcher

type Matcher interface {
	Match(string) bool
	Index(string) (int, []int)
	Len() int
	String() string
}

type Matchers

type Matchers []Matcher

func (Matchers) String

func (m Matchers) String() string

type Max

type Max struct {
	Limit int
}

func NewMax

func NewMax(l int) Max

func (Max) Index

func (self Max) Index(s string) (int, []int)

func (Max) Len

func (self Max) Len() int

func (Max) Match

func (self Max) Match(s string) bool

func (Max) String

func (self Max) String() string

type Min

type Min struct {
	Limit int
}

func NewMin

func NewMin(l int) Min

func (Min) Index

func (self Min) Index(s string) (int, []int)

func (Min) Len

func (self Min) Len() int

func (Min) Match

func (self Min) Match(s string) bool

func (Min) String

func (self Min) String() string

type Nothing

type Nothing struct{}

func NewNothing

func NewNothing() Nothing

func (Nothing) Index

func (self Nothing) Index(s string) (int, []int)

func (Nothing) Len

func (self Nothing) Len() int

func (Nothing) Match

func (self Nothing) Match(s string) bool

func (Nothing) String

func (self Nothing) String() string

type Prefix

type Prefix struct {
	Prefix string
}

func NewPrefix

func NewPrefix(p string) Prefix

func (Prefix) Index

func (self Prefix) Index(s string) (int, []int)

func (Prefix) Len

func (self Prefix) Len() int

func (Prefix) Match

func (self Prefix) Match(s string) bool

func (Prefix) String

func (self Prefix) String() string

type PrefixAny added in v0.2.3

type PrefixAny struct {
	Prefix     string
	Separators []rune
}

func NewPrefixAny added in v0.2.3

func NewPrefixAny(s string, sep []rune) PrefixAny

func (PrefixAny) Index added in v0.2.3

func (self PrefixAny) Index(s string) (int, []int)

func (PrefixAny) Len added in v0.2.3

func (self PrefixAny) Len() int

func (PrefixAny) Match added in v0.2.3

func (self PrefixAny) Match(s string) bool

func (PrefixAny) String added in v0.2.3

func (self PrefixAny) String() string

type PrefixSuffix

type PrefixSuffix struct {
	Prefix, Suffix string
}

func NewPrefixSuffix

func NewPrefixSuffix(p, s string) PrefixSuffix

func (PrefixSuffix) Index

func (self PrefixSuffix) Index(s string) (int, []int)

func (PrefixSuffix) Len

func (self PrefixSuffix) Len() int

func (PrefixSuffix) Match

func (self PrefixSuffix) Match(s string) bool

func (PrefixSuffix) String

func (self PrefixSuffix) String() string

type Range

type Range struct {
	Lo, Hi rune
	Not    bool
}

func NewRange

func NewRange(lo, hi rune, not bool) Range

func (Range) Index

func (self Range) Index(s string) (int, []int)

func (Range) Len

func (self Range) Len() int

func (Range) Match

func (self Range) Match(s string) bool

func (Range) String

func (self Range) String() string

type Row

type Row struct {
	Matchers    Matchers
	RunesLength int
	Segments    []int
}

func NewRow

func NewRow(len int, m ...Matcher) Row

func (Row) Index

func (self Row) Index(s string) (int, []int)

func (Row) Len

func (self Row) Len() (l int)

func (Row) Match

func (self Row) Match(s string) bool

func (Row) String

func (self Row) String() string

type Single

type Single struct {
	Separators []rune
}

single represents ?

func NewSingle

func NewSingle(s []rune) Single

func (Single) Index

func (self Single) Index(s string) (int, []int)

func (Single) Len

func (self Single) Len() int

func (Single) Match

func (self Single) Match(s string) bool

func (Single) String

func (self Single) String() string

type SomePool

type SomePool interface {
	Get() []int
	Put([]int)
}

type Suffix

type Suffix struct {
	Suffix string
}

func NewSuffix

func NewSuffix(s string) Suffix

func (Suffix) Index

func (self Suffix) Index(s string) (int, []int)

func (Suffix) Len

func (self Suffix) Len() int

func (Suffix) Match

func (self Suffix) Match(s string) bool

func (Suffix) String

func (self Suffix) String() string

type SuffixAny added in v0.2.3

type SuffixAny struct {
	Suffix     string
	Separators []rune
}

func NewSuffixAny added in v0.2.3

func NewSuffixAny(s string, sep []rune) SuffixAny

func (SuffixAny) Index added in v0.2.3

func (self SuffixAny) Index(s string) (int, []int)

func (SuffixAny) Len added in v0.2.3

func (self SuffixAny) Len() int

func (SuffixAny) Match added in v0.2.3

func (self SuffixAny) Match(s string) bool

func (SuffixAny) String added in v0.2.3

func (self SuffixAny) String() string

type Super

type Super struct{}

func NewSuper

func NewSuper() Super

func (Super) Index

func (self Super) Index(s string) (int, []int)

func (Super) Len

func (self Super) Len() int

func (Super) Match

func (self Super) Match(s string) bool

func (Super) String

func (self Super) String() string

type Text

type Text struct {
	Str         string
	RunesLength int
	BytesLength int
	Segments    []int
}

raw represents raw string to match

func NewText

func NewText(s string) Text

func (Text) Index

func (self Text) Index(s string) (int, []int)

func (Text) Len

func (self Text) Len() int

func (Text) Match

func (self Text) Match(s string) bool

func (Text) String

func (self Text) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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