rules

package
v1.6.5-rc22 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func NewScanner

func NewScanner(b []byte) *scanner

func SingleQuote

func SingleQuote(data []byte) []byte

func Slash

func Slash(data []byte) []byte

func UnSlash

func UnSlash(src []byte) ([]byte, error)

Types

type Lit

type Lit struct {
	Raw []byte
	Node
}

func ComputedValueMatrix

func ComputedValueMatrix(matrix [][]*Lit) []*Lit

func NewLiteral

func NewLiteral(raw []byte) *Lit

func (*Lit) Append

func (l *Lit) Append(bytes []byte)

func (*Lit) Bytes

func (l *Lit) Bytes() []byte

type Node

type Node interface {
	Bytes() []byte
	// contains filtered or unexported methods
}

type Rule

type Rule struct {
	RAW    []byte
	Name   string
	Params []Node
	Range  []*Lit

	ExclusiveMin bool
	ExclusiveMax bool
	ValueMatrix  [][]*Lit
	Pattern      *regexp.Regexp

	Optional bool
	DftValue []byte

	Node
}

func NewRule

func NewRule(name string) *Rule

func Parse

func Parse(rule string) (*Rule, error)

func ParseRaw

func ParseRaw(b []byte) (*Rule, error)

func (*Rule) Bytes

func (r *Rule) Bytes() []byte

func (*Rule) ComputedValues

func (r *Rule) ComputedValues() []*Lit

Jump to

Keyboard shortcuts

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