Documentation ¶
Index ¶
- func Tree(node Node, indent int, name string) string
- type Argument
- type Array
- type AssignExpression
- type BlockLiteral
- type BlockStatement
- type Boolean
- type BreakStatement
- type Char
- type DotExpression
- type EmissionExpression
- type EmittedItem
- type Expression
- type ExpressionStatement
- type ForLoop
- type FunctionCall
- type FunctionDefinition
- type Identifier
- type IfExpression
- type IndexExpression
- type InfixExpression
- type Map
- type NextStatement
- type Node
- type Null
- type Number
- type Parameter
- type PrefixExpression
- type Program
- type QualifiedFunctionCall
- type ReturnStatement
- type Statement
- type String
- type Tuple
- type UseStatement
- type WhileLoop
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Argument ¶
type Argument struct { Tok token.Token Value Expression }
Argument is an argument to a function
type AssignExpression ¶
type AssignExpression struct { Tok token.Token Name, Value Expression }
AssignExpression assigns an expression to a name
func (AssignExpression) Expr ¶
func (n AssignExpression) Expr()
Expr tells the compiler this node is an expression
func (AssignExpression) Token ¶
func (n AssignExpression) Token() token.Token
Token returns the node's token
type BlockLiteral ¶
type BlockLiteral struct { Tok token.Token Body Statement Params []Expression }
BlockLiteral is a block literal
func (BlockLiteral) Expr ¶
func (n BlockLiteral) Expr()
Expr tells the compiler this node is an expression
func (BlockLiteral) Token ¶
func (n BlockLiteral) Token() token.Token
Token returns the node's token
type BlockStatement ¶
BlockStatement is a list of statements
func (BlockStatement) Stmt ¶
func (n BlockStatement) Stmt()
Stmt tells the compiler this node is a statement
func (BlockStatement) Token ¶
func (n BlockStatement) Token() token.Token
Token returns this node's token
type BreakStatement ¶
BreakStatement breaks a loop
func (BreakStatement) Stmt ¶
func (n BreakStatement) Stmt()
Stmt tells the compiler this node is a statement
func (BreakStatement) Token ¶
func (n BreakStatement) Token() token.Token
Token returns this node's token
type DotExpression ¶
type DotExpression struct { Tok token.Token Left, Right Expression }
DotExpression gets a value from a container
func (DotExpression) Expr ¶
func (n DotExpression) Expr()
Expr tells the compiler this node is an expression
func (DotExpression) Token ¶
func (n DotExpression) Token() token.Token
Token returns the node's token
type EmissionExpression ¶
type EmissionExpression struct { Tok token.Token Items []EmittedItem }
EmissionExpression emits some raw bytecode
func (EmissionExpression) Expr ¶
func (n EmissionExpression) Expr()
Expr tells the compiler this node is an expression
func (EmissionExpression) Token ¶
func (n EmissionExpression) Token() token.Token
Token returns the node's token
type EmittedItem ¶
type EmittedItem struct { IsInstruction bool // This will be defined if !IsInstruction Exp Expression // These things will be defined if IsInstruction Instruction string Argument rune }
EmittedItem is an item inside an emission expression
type ExpressionStatement ¶
type ExpressionStatement struct { Tok token.Token Expr Expression }
ExpressionStatement is an expression which acts a statement
func (ExpressionStatement) Stmt ¶
func (n ExpressionStatement) Stmt()
Stmt tells the compiler this node is a statement
func (ExpressionStatement) Token ¶
func (n ExpressionStatement) Token() token.Token
Token returns this node's token
type ForLoop ¶
type ForLoop struct { Tok token.Token // for (Init; Condition; Increment) { Body } Init Expression Condition Expression Increment Expression Body Statement }
ForLoop executes Body for each element in a collection
type FunctionCall ¶
type FunctionCall struct { Tok token.Token Pattern []Expression }
FunctionCall calls a function
func (FunctionCall) Expr ¶
func (n FunctionCall) Expr()
Expr tells the compiler this node is an expression
func (FunctionCall) Token ¶
func (n FunctionCall) Token() token.Token
Token returns the node's token
type FunctionDefinition ¶
type FunctionDefinition struct { Tok token.Token Pattern []Expression Body Statement }
FunctionDefinition defines a function
func (FunctionDefinition) Stmt ¶
func (n FunctionDefinition) Stmt()
Stmt tells the compiler this node is a statement
func (FunctionDefinition) Token ¶
func (n FunctionDefinition) Token() token.Token
Token returns this node's token
type Identifier ¶
Identifier is an identifier
func (Identifier) Expr ¶
func (n Identifier) Expr()
Expr tells the compiler this node is an expression
type IfExpression ¶
type IfExpression struct { Tok token.Token Condition Expression Consequence, Alternative Statement }
IfExpression executes Consequence or Alternative based on Condition
func (IfExpression) Expr ¶
func (n IfExpression) Expr()
Expr tells the compiler this node is an expression
func (IfExpression) Token ¶
func (n IfExpression) Token() token.Token
Token returns the node's token
type IndexExpression ¶
type IndexExpression struct { Tok token.Token Collection, Index Expression }
IndexExpression gets a value from a collection
func (IndexExpression) Expr ¶
func (n IndexExpression) Expr()
Expr tells the compiler this node is an expression
func (IndexExpression) Token ¶
func (n IndexExpression) Token() token.Token
Token returns the node's token
type InfixExpression ¶
type InfixExpression struct { Tok token.Token Operator string Left, Right Expression }
InfixExpression is an infix operator expression
func (InfixExpression) Expr ¶
func (n InfixExpression) Expr()
Expr tells the compiler this node is an expression
func (InfixExpression) Token ¶
func (n InfixExpression) Token() token.Token
Token returns the node's token
type NextStatement ¶
NextStatement goes to the next iteration of a loop
func (NextStatement) Stmt ¶
func (n NextStatement) Stmt()
Stmt tells the compiler this node is a statement
func (NextStatement) Token ¶
func (n NextStatement) Token() token.Token
Token returns this node's token
type Parameter ¶
Parameter is shorthand for putting an identifier into a pattern call
type PrefixExpression ¶
type PrefixExpression struct { Tok token.Token Operator string Right Expression }
PrefixExpression is a prefix operator expression
func (PrefixExpression) Expr ¶
func (n PrefixExpression) Expr()
Expr tells the compiler this node is an expression
func (PrefixExpression) Token ¶
func (n PrefixExpression) Token() token.Token
Token returns the node's token
type Program ¶
type Program struct {
Statements []Statement
}
Program is a program, containing a list of statements
type QualifiedFunctionCall ¶
type QualifiedFunctionCall struct { Tok token.Token Base Expression Pattern []Expression }
QualifiedFunctionCall calls a function from a package
func (QualifiedFunctionCall) Expr ¶
func (n QualifiedFunctionCall) Expr()
Expr tells the compiler this node is an expression
func (QualifiedFunctionCall) Token ¶
func (n QualifiedFunctionCall) Token() token.Token
Token returns the node's token
type ReturnStatement ¶
type ReturnStatement struct { Tok token.Token Value Expression }
ReturnStatement returns an expression from a BlockStatement
func (ReturnStatement) Stmt ¶
func (n ReturnStatement) Stmt()
Stmt tells the compiler this node is a statement
func (ReturnStatement) Token ¶
func (n ReturnStatement) Token() token.Token
Token returns this node's token
type UseStatement ¶
UseStatement imports a package into the current scope
func (UseStatement) Stmt ¶
func (n UseStatement) Stmt()
Stmt tells the compiler this node is a statement
func (UseStatement) Token ¶
func (n UseStatement) Token() token.Token
Token returns this node's token