ast

package
v1.5.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node interface {
	// Return the type of node
	Type() Type

	// Parent node
	Parent() Node

	// Return children of the node
	Children() []Node

	// Return the underlying value, or nil if not applicable
	Value() any

	// Append a child node
	AppendChild(Node)
}

func NewArray

func NewArray(parent Node) Node

Create a new block

func NewBool

func NewBool(parent Node, v bool) Node

func NewDict

func NewDict(parent Node) Node

Create a new map[string]Node dictionary

func NewIdent

func NewIdent(parent Node, v string) Node

func NewNull

func NewNull(parent Node) Node

func NewNumber

func NewNumber(parent Node, v string) Node

func NewString

func NewString(parent Node, v string) Node

type Type

type Type int
const (
	// Value types
	Null   Type = iota // Null value
	Ident              // Identifier
	String             // String literal
	Number             // Number literal
	Bool               // Boolean literal
	Array              // Array of values
	Dict               // Dict of values
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL