tag_parser

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pretty

func Pretty(pretty bool) func(*TagParser) error

func Size

func Size(size int) func(*TagParser) error

Types

type KeyVal

type KeyVal struct {
	Key string
	Val string
}

type Param

type Param struct {
	Name string
	Args []KeyVal
}

type Tag

type Tag struct {
	Extractor *Param
	// ;
	Transformer *Param
	// ;
	Required bool
	Default  string
}

func Parse

func Parse(content string) (*Tag, error)

type TagParser

type TagParser struct {
	Buffer string

	Pretty bool
	// contains filtered or unexported fields
}

func (*TagParser) AST

func (t *TagParser) AST() *node32

func (*TagParser) Add

func (t *TagParser) Add(rule pegRule, begin, end, index uint32)

func (*TagParser) Init

func (p *TagParser) Init(options ...func(*TagParser) error) error

func (*TagParser) Parse

func (p *TagParser) Parse(rule ...int) error

func (*TagParser) PrettyPrintSyntaxTree

func (t *TagParser) PrettyPrintSyntaxTree(buffer string)

func (*TagParser) Print

func (t *TagParser) Print()

func (*TagParser) PrintSyntaxTree

func (p *TagParser) PrintSyntaxTree()

func (*TagParser) Reset

func (p *TagParser) Reset()

func (*TagParser) SprintSyntaxTree

func (p *TagParser) SprintSyntaxTree() string

func (*TagParser) Tokens

func (t *TagParser) Tokens() []token32

func (*TagParser) Trim

func (t *TagParser) Trim(length uint32)

func (*TagParser) WriteSyntaxTree

func (p *TagParser) WriteSyntaxTree(w io.Writer)

Jump to

Keyboard shortcuts

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