package
0.0.0-20221106014756-28cd0dc4edaf
Repository: https://github.com/sdlp99/sdpkg.git
Documentation: pkg.go.dev
# Functions
IsEmptyTree reports whether this tree (node) is empty of everything but space or comments.
New allocates a new parse tree with the given name.
NewIdentifier returns a new IdentifierNode with the given identifier name.
Parse returns a map from template name to parse.Tree, created by parsing the templates described in the argument string.
# Constants
A non-control action such as a field evaluation.
A boolean constant.
A break action.
A sequence of field accesses.
An element of a pipeline.
A comment.
A continue action.
The cursor, dot.
A field or method name.
An identifier; always a function name.
An if action.
A list of Nodes.
An untyped nil constant.
A numerical constant.
A pipeline of commands.
A range action.
A string constant.
A template invocation action.
Plain text.
A $ variable.
A with action.
parse comments and add them to AST.
do not check that functions are defined.
# Structs
ActionNode holds an action (something bounded by delimiters).
BoolNode holds a boolean constant.
BranchNode is the common representation of if, range, and with.
BreakNode represents a {{break}} action.
ChainNode holds a term followed by a chain of field accesses (identifier starting with '.').
CommandNode holds a command (a pipeline inside an evaluating action).
CommentNode holds a comment.
ContinueNode represents a {{continue}} action.
DotNode holds the special identifier '.'.
FieldNode holds a field (identifier starting with '.').
IdentifierNode holds an identifier.
IfNode represents an {{if}} action and its commands.
ListNode holds a sequence of nodes.
NilNode holds the special identifier 'nil' representing an untyped nil constant.
NumberNode holds a number: signed or unsigned integer, float, or complex.
PipeNode holds a pipeline with optional declaration.
RangeNode represents a {{range}} action and its commands.
StringNode holds a string constant.
TemplateNode represents a {{template}} action.
TextNode holds plain text.
Tree is the representation of a single parsed template.
VariableNode holds a list of variable names, possibly with chained field accesses.
WithNode represents a {{with}} action and its commands.
# Interfaces
A Node is an element in the parse tree.