go/src/text/template/parse/node.go

var textFormat

type Node

type NodeType

type Pos

func (p Pos) Position() Pos {}

// Type returns itself and provides an easy default implementation
// for embedding in a Node. Embedded in all non-trivial Nodes.
func (t NodeType) Type() NodeType {}

const NodeText

const NodeAction

const NodeBool

const NodeChain

const NodeCommand

const NodeDot

const nodeElse

const nodeEnd

const NodeField

const NodeIdentifier

const NodeIf

const NodeList

const NodeNil

const NodeNumber

const NodePipe

const NodeRange

const NodeString

const NodeTemplate

const NodeVariable

const NodeWith

const NodeComment

const NodeBreak

const NodeContinue

type ListNode

func (t *Tree) newList(pos Pos) *ListNode {}

func (l *ListNode) append(n Node) {}

func (l *ListNode) tree() *Tree {}

func (l *ListNode) String() string {}

func (l *ListNode) writeTo(sb *strings.Builder) {}

func (l *ListNode) CopyList() *ListNode {}

func (l *ListNode) Copy() Node {}

type TextNode

func (t *Tree) newText(pos Pos, text string) *TextNode {}

func (t *TextNode) String() string {}

func (t *TextNode) writeTo(sb *strings.Builder) {}

func (t *TextNode) tree() *Tree {}

func (t *TextNode) Copy() Node {}

type CommentNode

func (t *Tree) newComment(pos Pos, text string) *CommentNode {}

func (c *CommentNode) String() string {}

func (c *CommentNode) writeTo(sb *strings.Builder) {}

func (c *CommentNode) tree() *Tree {}

func (c *CommentNode) Copy() Node {}

type PipeNode

func (t *Tree) newPipeline(pos Pos, line int, vars []*VariableNode) *PipeNode {}

func (p *PipeNode) append(command *CommandNode) {}

func (p *PipeNode) String() string {}

func (p *PipeNode) writeTo(sb *strings.Builder) {}

func (p *PipeNode) tree() *Tree {}

func (p *PipeNode) CopyPipe() *PipeNode {}

func (p *PipeNode) Copy() Node {}

type ActionNode

func (t *Tree) newAction(pos Pos, line int, pipe *PipeNode) *ActionNode {}

func (a *ActionNode) String() string {}

func (a *ActionNode) writeTo(sb *strings.Builder) {}

func (a *ActionNode) tree() *Tree {}

func (a *ActionNode) Copy() Node {}

type CommandNode

func (t *Tree) newCommand(pos Pos) *CommandNode {}

func (c *CommandNode) append(arg Node) {}

func (c *CommandNode) String() string {}

func (c *CommandNode) writeTo(sb *strings.Builder) {}

func (c *CommandNode) tree() *Tree {}

func (c *CommandNode) Copy() Node {}

type IdentifierNode

// NewIdentifier returns a new [IdentifierNode] with the given identifier name.
func NewIdentifier(ident string) *IdentifierNode {}

// SetPos sets the position. [NewIdentifier] is a public method so we can't modify its signature.
// Chained for convenience.
// TODO: fix one day?
func (i *IdentifierNode) SetPos(pos Pos) *IdentifierNode {}

// SetTree sets the parent tree for the node. [NewIdentifier] is a public method so we can't modify its signature.
// Chained for convenience.
// TODO: fix one day?
func (i *IdentifierNode) SetTree(t *Tree) *IdentifierNode {}

func (i *IdentifierNode) String() string {}

func (i *IdentifierNode) writeTo(sb *strings.Builder) {}

func (i *IdentifierNode) tree() *Tree {}

func (i *IdentifierNode) Copy() Node {}

type VariableNode

func (t *Tree) newVariable(pos Pos, ident string) *VariableNode {}

func (v *VariableNode) String() string {}

func (v *VariableNode) writeTo(sb *strings.Builder) {}

func (v *VariableNode) tree() *Tree {}

func (v *VariableNode) Copy() Node {}

type DotNode

func (t *Tree) newDot(pos Pos) *DotNode {}

func (d *DotNode) Type() NodeType {}

func (d *DotNode) String() string {}

func (d *DotNode) writeTo(sb *strings.Builder) {}

func (d *DotNode) tree() *Tree {}

func (d *DotNode) Copy() Node {}

type NilNode

func (t *Tree) newNil(pos Pos) *NilNode {}

func (n *NilNode) Type() NodeType {}

func (n *NilNode) String() string {}

func (n *NilNode) writeTo(sb *strings.Builder) {}

func (n *NilNode) tree() *Tree {}

func (n *NilNode) Copy() Node {}

type FieldNode

func (t *Tree) newField(pos Pos, ident string) *FieldNode {}

func (f *FieldNode) String() string {}

func (f *FieldNode) writeTo(sb *strings.Builder) {}

func (f *FieldNode) tree() *Tree {}

func (f *FieldNode) Copy() Node {}

type ChainNode

func (t *Tree) newChain(pos Pos, node Node) *ChainNode {}

// Add adds the named field (which should start with a period) to the end of the chain.
func (c *ChainNode) Add(field string) {}

func (c *ChainNode) String() string {}

func (c *ChainNode) writeTo(sb *strings.Builder) {}

func (c *ChainNode) tree() *Tree {}

func (c *ChainNode) Copy() Node {}

type BoolNode

func (t *Tree) newBool(pos Pos, true bool) *BoolNode {}

func (b *BoolNode) String() string {}

func (b *BoolNode) writeTo(sb *strings.Builder) {}

func (b *BoolNode) tree() *Tree {}

func (b *BoolNode) Copy() Node {}

type NumberNode

func (t *Tree) newNumber(pos Pos, text string, typ itemType) (*NumberNode, error) {}

// simplifyComplex pulls out any other types that are represented by the complex number.
// These all require that the imaginary part be zero.
func (n *NumberNode) simplifyComplex() {}

func (n *NumberNode) String() string {}

func (n *NumberNode) writeTo(sb *strings.Builder) {}

func (n *NumberNode) tree() *Tree {}

func (n *NumberNode) Copy() Node {}

type StringNode

func (t *Tree) newString(pos Pos, orig, text string) *StringNode {}

func (s *StringNode) String() string {}

func (s *StringNode) writeTo(sb *strings.Builder) {}

func (s *StringNode) tree() *Tree {}

func (s *StringNode) Copy() Node {}

type endNode

func (t *Tree) newEnd(pos Pos) *endNode {}

func (e *endNode) String() string {}

func (e *endNode) writeTo(sb *strings.Builder) {}

func (e *endNode) tree() *Tree {}

func (e *endNode) Copy() Node {}

type elseNode

func (t *Tree) newElse(pos Pos, line int) *elseNode {}

func (e *elseNode) Type() NodeType {}

func (e *elseNode) String() string {}

func (e *elseNode) writeTo(sb *strings.Builder) {}

func (e *elseNode) tree() *Tree {}

func (e *elseNode) Copy() Node {}

type BranchNode

func (b *BranchNode) String() string {}

func (b *BranchNode) writeTo(sb *strings.Builder) {}

func (b *BranchNode) tree() *Tree {}

func (b *BranchNode) Copy() Node {}

type IfNode

func (t *Tree) newIf(pos Pos, line int, pipe *PipeNode, list, elseList *ListNode) *IfNode {}

func (i *IfNode) Copy() Node {}

type BreakNode

func (t *Tree) newBreak(pos Pos, line int) *BreakNode {}

func (b *BreakNode) Copy() Node                  {}

func (b *BreakNode) String() string              {}

func (b *BreakNode) tree() *Tree                 {}

func (b *BreakNode) writeTo(sb *strings.Builder) {}

type ContinueNode

func (t *Tree) newContinue(pos Pos, line int) *ContinueNode {}

func (c *ContinueNode) Copy() Node                  {}

func (c *ContinueNode) String() string              {}

func (c *ContinueNode) tree() *Tree                 {}

func (c *ContinueNode) writeTo(sb *strings.Builder) {}

type RangeNode

func (t *Tree) newRange(pos Pos, line int, pipe *PipeNode, list, elseList *ListNode) *RangeNode {}

func (r *RangeNode) Copy() Node {}

type WithNode

func (t *Tree) newWith(pos Pos, line int, pipe *PipeNode, list, elseList *ListNode) *WithNode {}

func (w *WithNode) Copy() Node {}

type TemplateNode

func (t *Tree) newTemplate(pos Pos, line int, name string, pipe *PipeNode) *TemplateNode {}

func (t *TemplateNode) String() string {}

func (t *TemplateNode) writeTo(sb *strings.Builder) {}

func (t *TemplateNode) tree() *Tree {}

func (t *TemplateNode) Copy() Node {}