rules

package
v0.0.0-...-58f8293 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

+gengo:runtimedoc=false

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SingleQuote

func SingleQuote(data []byte) []byte

func Slash

func Slash(data []byte) []byte

func Unslash

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

Types

type Rule

type Rule struct {
	RAW []byte

	Name   string
	Params []RuleNode

	Range          []*RuleLit
	ExclusiveLeft  bool
	ExclusiveRight bool

	ValueMatrix [][]*RuleLit

	Pattern string

	Optional     bool
	DefaultValue []byte

	RuleNode
}

func MustParseRuleString

func MustParseRuleString(rule string) *Rule

func NewRule

func NewRule(name string) *Rule

func ParseRule

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

func ParseRuleString

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

func (*Rule) Bytes

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

func (*Rule) ComputedValues

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

type RuleLit

type RuleLit struct {
	Lit []byte
	RuleNode
}

func NewRuleLit

func NewRuleLit(lit []byte) *RuleLit

func (*RuleLit) Append

func (lit *RuleLit) Append(b []byte)

func (*RuleLit) Bytes

func (lit *RuleLit) Bytes() []byte

type RuleNode

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

type SyntaxError

type SyntaxError struct {
	Msg string
}

func NewSyntaxError

func NewSyntaxError(format string, args ...interface{}) *SyntaxError

func (*SyntaxError) Error

func (e *SyntaxError) Error() string

Jump to

Keyboard shortcuts

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