package ast

import "github.com/gobwas/glob/syntax/ast"

Index

Functions

func Insert

func Insert(parent *Node, children ...*Node)

Types

type Kind

type Kind int
const (
	KindNothing Kind = iota
	KindPattern
	KindList
	KindRange
	KindText
	KindAny
	KindSuper
	KindSingle
	KindAnyOf
)

func (Kind) String

func (k Kind) String() string

type Lexer

type Lexer interface {
	Next() lexer.Token
}

type List

type List struct {
	Not   bool
	Chars string
}

type Node

type Node struct {
	Parent   *Node
	Children []*Node
	Value    interface{}
	Kind     Kind
}

func NewNode

func NewNode(k Kind, v interface{}, ch ...*Node) *Node

func Parse

func Parse(lexer Lexer) (*Node, error)

func (*Node) Equal

func (a *Node) Equal(b *Node) bool

func (*Node) String

func (a *Node) String() string

type Range

type Range struct {
	Not    bool
	Lo, Hi rune
}

type Text

type Text struct {
	Text string
}

Source Files

ast.go parser.go

Version
v0.2.3 (latest)
Published
Feb 8, 2018
Platform
linux/amd64
Imports
5 packages
Last checked
5 days ago

Tools for package owners.