ast

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintASTColor

func PrintASTColor(node Node) string

func StringifyAST

func StringifyAST(node Node) string

Types

type Array

type Array struct {
	ExprList []Node
}

type Ast

type Ast struct {
	Statement []Node
}

type BinaryExpr

type BinaryExpr struct {
	Lhs  Node
	Rhs  Node
	Op   token.Token
	Line uint
}

type Block

type Block struct {
	Statement []Node
}

type Boolean

type Boolean struct {
	Value bool
}

type Branch

type Branch struct {
	Elifs []Node
	If    Node
	Else  Node
	Line  uint
}

type Break

type Break struct{}

type CallExpr

type CallExpr struct {
	Args     []Node
	Fun      Node
	Ellipsis int
}

type CallStmt

type CallStmt struct {
	Args     []Node
	Ellipsis int
	Line     uint
}

type Continue

type Continue struct{}

type Else

type Else struct {
	Block Node
}

type Enum

type Enum struct {
	Variants []string
}

type Export

type Export struct {
	Expr Node
	Line uint
}

type Float

type Float struct {
	Value float64
}

type For

type For struct {
	Init  Node
	End   Node
	Step  Node
	Id    string
	Block Node
	Line  uint
}

type ForState

type ForState struct {
	Value string
}

type Fun

type Fun struct {
	Args  []string
	Body  Node
	IsVar bool
}

type IFor

type IFor struct {
	Key   string
	Value string
	Expr  Node
	Block Node
	Line  uint
}

type IGet

type IGet struct {
	Indexable Node
	Index     Node
	Line      uint
}

type IGetStmt

type IGetStmt struct {
	Index Node
	Line  uint
}

type ISet

type ISet struct {
	Index Node
	Expr  Node
	Line  uint
}

type Identifier

type Identifier struct {
	Value string
}

type If

type If struct {
	Condition Node
	Block     Node
}

type Import

type Import struct {
	Path string
	Line uint
}

type Integer

type Integer struct {
	Value int64
}

type Let

type Let struct {
	Identifier string
	Expr       Node
	Line       uint
}

type MethodCallExpr

type MethodCallExpr struct {
	Args     []Node
	Prop     Node
	Obj      Node
	Ellipsis int
}

type MethodCallStmt

type MethodCallStmt struct {
	Args     []Node
	Prop     Node
	Ellipsis int
	Line     uint
}

type MultipleLet

type MultipleLet struct {
	Identifiers []string
	Exprs       []Node
	Line        uint
}

type MultipleMut

type MultipleMut struct {
	Targets []*MutTarget
	Exprs   []Node
	Line    uint
}

type MultipleVar

type MultipleVar struct {
	Identifiers []string
	Exprs       []Node
	Line        uint
	IsRecursive bool
}

type Mut

type Mut struct {
	Identifier string
	Expr       Node
	Line       uint
}

type MutTarget

type MutTarget struct {
	Identifier string
	Indexable  Node
	Index      Node
	Selectable Node
	Selector   Node
	Line       uint
}

type Nil

type Nil struct {
	Value struct{}
}

type Node

type Node interface {
	// contains filtered or unexported methods
}

type Object

type Object struct {
	Pairs []*Pair
	Line  uint
}

type ObjectDecl

type ObjectDecl struct {
	Name   string
	Params []string
	Parent Node
	Body   []*Pair
	Line   uint
}

type Pair

type Pair struct {
	Key   Node
	Value Node
}

type PrefixExpr

type PrefixExpr struct {
	Expr Node
	Op   token.Token
	Line uint
}

type Property

type Property struct {
	Value string
}

type Reference

type Reference struct {
	Value string
	Line  uint
}

type ReferenceStmt

type ReferenceStmt struct {
	Value string
	Line  uint
}

type Ret

type Ret struct {
	Expr Node
	Line uint
}

type Select

type Select struct {
	Selectable Node
	Selector   Node
}

type SelectStmt

type SelectStmt struct {
	Selector Node
	Line     uint
}

type Slice

type Slice struct {
	Value Node
	First Node
	Last  Node
	Mode  int
}

type String

type String struct {
	Value string
}

type Super

type Super struct {
	Line uint
}

type SuperCallStmt

type SuperCallStmt struct {
	Args     []Node
	Prop     Node
	Ellipsis int
	Line     uint
}

type Var

type Var struct {
	Identifier  string
	Expr        Node
	Line        uint
	IsRecursive bool
}

type While

type While struct {
	Condition Node
	Block     Node
	Line      uint
}

type With

type With struct {
	Identifiers []string
	Exprs       []Node
	Block       Node
	Line        uint
}

Jump to

Keyboard shortcuts

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