Source File
node.go
Belonging Package
src.elv.sh/pkg/parse
package parseimport// Node represents a parse tree as well as an AST.type Node interface {diag.Rangerparse(*parser)n() *node}type node struct {diag.RangingsourceText stringparent Nodechildren []Node}func ( *node) () *node { return }func ( *node) ( Node) { .children = append(.children, ) }// Range returns the range within the full source text that parses to the node.func ( *node) () diag.Ranging { return .Ranging }// Parent returns the parent of a node. It returns nil if the node is the root// of the parse tree.func ( Node) Node { return .n().parent }// SourceText returns the part of the source text that parses to the node.func ( Node) string { return .n().sourceText }// Children returns all children of the node in the parse tree.func ( Node) []Node { return .n().children }
The pages are generated with Golds v0.2.8-preview. (GOOS=darwin GOARCH=arm64)