Documentation ¶
Overview ¶
Package matcher implements matchers that efficiently let you determine whether a rune is part of a previously defined rune set.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type M ¶
type M struct {
// contains filtered or unexported fields
}
M is the definition of a character class, which can tell whether a rune is part of that character definition or not.
func Diff ¶
Diff returns a matcher that matches runes, that are matched by shouldMatch, but are not matched by butNot.
Diff(A, B).Matches(r) => r element (A \ B)
func Merge ¶
Merge creates a new matcher, that accepts runes that are matched by one or more of the given matchers.
func New ¶
func New(desc string, rt *unicode.RangeTable) M
New creates a new matcher from a given match function.
func RangeTable ¶
func RangeTable(desc string, rt *unicode.RangeTable) M
RangeTable creates a matcher that matches runes that are contained in the given range table.
func RuneWithDesc ¶
RuneWithDesc creates a matcher that matches only the given rune. The description is the string representation of this matcher. This is useful when dealing with whitespace characters.