ast

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assign

type Assign struct {
	StatementNode
	Token token.Token
	Name  AssignmentNode
	Value ExpressionNode
}

type AssignmentNode

type AssignmentNode interface {
	Node
}

type Block

type Block struct {
	StatementNode
	Token      token.Token
	Statements []StatementNode
}

type Boolean

type Boolean struct {
	ExpressionNode
	Token token.Token
	Value bool
}

type Break

type Break struct {
	ExpressionNode
	Token token.Token
}

type Call

type Call struct {
	ExpressionNode
	Token     token.Token
	Callee    ExpressionNode
	Arguments []ExpressionNode
}

type Case

type Case struct {
	ExpressionNode
	Token   token.Token      // The "case" token
	Default bool             // Is this the default branch?
	Value   []ExpressionNode // The value of the case we'll be matching against
	Body    *Block           // The block that will be evaluated if matched
}

type Class

type Class struct {
	ExpressionNode
	Token token.Token
	Name  *Identifier
	Super *Identifier
	Body  *Block
}

type Compound

type Compound struct {
	ExpressionNode
	Token    token.Token
	Left     ExpressionNode
	Operator string
	Right    ExpressionNode
}

type Continue

type Continue struct {
	ExpressionNode
	Token token.Token
}

type Expression

type Expression struct {
	StatementNode
	Expression ExpressionNode
}

type ExpressionNode

type ExpressionNode interface {
	Node
}

type For

type For struct {
	ExpressionNode
	Token       token.Token
	Identifier  *Identifier
	Initializer StatementNode
	Condition   ExpressionNode
	Increment   StatementNode
	Block       *Block
}

type ForIn

type ForIn struct {
	ExpressionNode
	Token    token.Token    // for
	Key      *Identifier    // key
	Value    *Identifier    // value
	Iterable ExpressionNode // list, map
	Block    *Block         // { ... }
}

type Function

type Function struct {
	ExpressionNode
	Token      token.Token
	Name       *Identifier
	Parameters []*Identifier
	Defaults   map[string]ExpressionNode
	Body       *Block
}

type Identifier

type Identifier struct {
	ExpressionNode
	AssignmentNode
	Token token.Token
	Value string
}

type If

type If struct {
	ExpressionNode
	Token       token.Token
	Condition   ExpressionNode
	Consequence *Block
	Alternative *Block
}

type Import

type Import struct {
	ExpressionNode
	Token token.Token
	Path  *String
}

type ImportFrom

type ImportFrom struct {
	ExpressionNode
	Token       token.Token
	Path        *String
	Identifiers map[string]*Identifier
	Everything  bool
}

type Index

type Index struct {
	ExpressionNode
	AssignmentNode
	Token token.Token
	Left  ExpressionNode
	Index ExpressionNode
}

type Infix

type Infix struct {
	ExpressionNode
	Token    token.Token
	Left     ExpressionNode
	Operator string
	Right    ExpressionNode
}

type List

type List struct {
	ExpressionNode
	Token    token.Token
	Elements []ExpressionNode
}

type Map

type Map struct {
	ExpressionNode
	Token token.Token
	Pairs map[ExpressionNode]ExpressionNode
}

type Method

type Method struct {
	ExpressionNode
	Token     token.Token
	Left      ExpressionNode
	Method    ExpressionNode
	Arguments []ExpressionNode
}

type Node

type Node interface{}

type Null

type Null struct {
	ExpressionNode
	Token token.Token
}

type Number

type Number struct {
	ExpressionNode
	Token token.Token
	Value decimal.Decimal
}

type Postfix

type Postfix struct {
	ExpressionNode
	Token    token.Token
	Operator string
}

type Prefix

type Prefix struct {
	ExpressionNode
	Token    token.Token
	Operator string
	Right    ExpressionNode
}

type Program

type Program struct {
	Statements []StatementNode
}

type Property

type Property struct {
	ExpressionNode
	AssignmentNode
	Token    token.Token
	Left     ExpressionNode
	Property ExpressionNode
}

type Return

type Return struct {
	StatementNode
	Token token.Token
	Value ExpressionNode
}

type StatementNode

type StatementNode interface {
	Node
}

type String

type String struct {
	ExpressionNode
	Token token.Token
	Value string
}

type Switch

type Switch struct {
	ExpressionNode
	Token token.Token    // The "switch" token
	Value ExpressionNode // The value that will be used to determine the case
	Cases []*Case        // The cases this switch statement will handle
}

type Ternary

type Ternary struct {
	ExpressionNode
	Token     token.Token
	Condition ExpressionNode
	IfTrue    ExpressionNode
	IfFalse   ExpressionNode
}

type This

type This struct {
	ExpressionNode
	Token token.Token
}

type Trait added in v1.0.7

type Trait struct {
	ExpressionNode
	Token token.Token
	Name  *Identifier
	Body  *Block
}

type Use added in v1.0.7

type Use struct {
	ExpressionNode
	Token  token.Token
	Traits []*Identifier
}

type While

type While struct {
	ExpressionNode
	Token       token.Token
	Condition   ExpressionNode
	Consequence *Block
}

Jump to

Keyboard shortcuts

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