Documentation
¶
Overview ¶
Package np provides utilities for working with node paths from a leaf of a parse tree to the root.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Chunk = Typed[*parse.Chunk]() Pipeline = Typed[*parse.Pipeline]() Array = Typed[*parse.Array]() Redir = Typed[*parse.Redir]() Sep = Typed[*parse.Sep]() )
Commonly used Typed matchers.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher interface {
// Match takes a slice of nodes and returns the remaining nodes and whether
// the match succeeded.
Match([]parse.Node) ([]parse.Node, bool)
}
Matcher wraps the Match method.
func SimpleExpr ¶
func SimpleExpr(data *SimpleExprData, ev *eval.Evaler) Matcher
SimpleExpr returns a Matcher matching a "simple expression", which consists of 3 nodes from the leaf upwards (Primary, Indexing and Compound) and where the Compound expression can be evaluated statically using ev.
type Path ¶
Path is a path from a leaf in a parse tree to the root.
type SimpleExprData ¶
type SimpleExprData struct {
Value string
Compound *parse.Compound
PrimarType parse.PrimaryType
}
SimpleExprData contains useful data written by the SimpleExpr matcher.
Click to show internal directories.
Click to hide internal directories.