Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Null = &Node{Type: NODE_NULL}
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
Parent *Node // Optional
Type NodeType
Literal string
Args []any // can either contain [string] or [*Node]
// The offset in bytes where this node begins
OffsetStart uint
// The offset in bytes where this node ends
OffsetEnd uint
Col, Row uint
// Equals 0 if offset range is multi-line. Otherwise the length starting from [.Col]
Length uint
Children []*Node // Optional
}
type NodeType ¶
type NodeType byte
const ( NODE_NULL NodeType = iota NODE_COMMENT NODE_DIRECTIVE NODE_MACRO NODE_EXEC NODE_ERROR_READ NODE_ERROR_SYNTAX ErrMin = NODE_ERROR_READ ErrMax = NODE_ERROR_SYNTAX )
type Parser ¶
type Parser struct {
Reader *internal.AdvancedReader
Channel chan *Node
// contains filtered or unexported fields
}
func (*Parser) ParseComplete ¶
func (parser *Parser) ParseComplete()
Nodes are returned only once all of their children are read (slow). Sets Node.Children if applicable. Node.Parent is always nil to prevent pointer recursion
func (*Parser) ParseFragmented ¶
func (parser *Parser) ParseFragmented()
Nodes are returned as soon as they are read (fast). Sets Node.Parent. Node.Children is always nil
Source Files
¶
Click to show internal directories.
Click to hide internal directories.