matcher

package
v0.0.0-...-65fd79d Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package matcher implements a matcher component, that can determine whether or not a rune is part of a custom character class.

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 Merge

func Merge(ms ...M) M

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 RuneWithDesc

func RuneWithDesc(desc string, exp rune) M

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.

func String

func String(s string) M

String creates a matcher that checks whether a rune is part of the given string.

func (M) Matches

func (m M) Matches(r rune) bool

Matches describes, whether the given rune is contained in this matcher's range table.

func (M) String

func (m M) String() string

String returns a human readable string description of the runes that this matcher matches.

Jump to

Keyboard shortcuts

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