Documentation ¶
Index ¶
- type Array
- type As
- type Assign
- type Atom
- type BlockStatement
- type Boolean
- type Break
- type Continue
- type Dictionary
- type Expression
- type ExpressionList
- type ExpressionStatement
- type Float
- type For
- type Function
- type FunctionCall
- type FunctionParameter
- type Identifier
- type IdentifierList
- type If
- type Import
- type InfixExpression
- type Integer
- type Is
- type Let
- type Module
- type ModuleAccess
- type Nil
- type Node
- type Pipe
- type Placeholder
- type PrefixExpression
- type Program
- type Return
- type Statement
- type String
- type Subscript
- type Switch
- type SwitchCase
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct { Token token.Token List *ExpressionList }
Array literal.
func (*Array) TokenLexeme ¶
func (*Array) TokenLocation ¶
type As ¶
type As struct { Token token.Token Left Expression Right *Identifier }
As infix expression.
func (*As) TokenLexeme ¶
func (*As) TokenLocation ¶
type Assign ¶
type Assign struct { Token token.Token Operator string Name Expression Right Expression }
Subscript for arrays and dictionaries.
func (*Assign) TokenLexeme ¶
func (*Assign) TokenLocation ¶
type BlockStatement ¶
BlockStatement that holds several statements.
func (*BlockStatement) Inspect ¶
func (e *BlockStatement) Inspect() string
func (*BlockStatement) TokenLexeme ¶
func (e *BlockStatement) TokenLexeme() string
func (*BlockStatement) TokenLocation ¶
func (e *BlockStatement) TokenLocation() token.Location
type Dictionary ¶
type Dictionary struct { Token token.Token Pairs map[Expression]Expression }
Dictionary literal.
func (*Dictionary) Inspect ¶
func (e *Dictionary) Inspect() string
func (*Dictionary) TokenLexeme ¶
func (e *Dictionary) TokenLexeme() string
func (*Dictionary) TokenLocation ¶
func (e *Dictionary) TokenLocation() token.Location
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
An Expression of code.
type ExpressionList ¶
type ExpressionList struct { Token token.Token Elements []Expression }
ExpressionList holds a list of expressions.
func (*ExpressionList) Inspect ¶
func (e *ExpressionList) Inspect() string
func (*ExpressionList) TokenLexeme ¶
func (e *ExpressionList) TokenLexeme() string
func (*ExpressionList) TokenLocation ¶
func (e *ExpressionList) TokenLocation() token.Location
type ExpressionStatement ¶
type ExpressionStatement struct { Token token.Token Expression Expression }
ExpressionStatement as a statement that holds expressions.
func (*ExpressionStatement) Inspect ¶
func (e *ExpressionStatement) Inspect() string
func (*ExpressionStatement) TokenLexeme ¶
func (e *ExpressionStatement) TokenLexeme() string
func (*ExpressionStatement) TokenLocation ¶
func (e *ExpressionStatement) TokenLocation() token.Location
type Float ¶
Float as a floating point literal.
func (*Float) TokenLexeme ¶
func (*Float) TokenLocation ¶
type For ¶
type For struct { Token token.Token Arguments *IdentifierList Enumerable Expression Body *BlockStatement }
For iterator.
func (*For) TokenLexeme ¶
func (*For) TokenLocation ¶
type Function ¶
type Function struct { Token token.Token Parameters []*FunctionParameter Body *BlockStatement ReturnType *Identifier Variadic bool }
Function expression.
func (*Function) TokenLexeme ¶
func (*Function) TokenLocation ¶
type FunctionCall ¶
type FunctionCall struct { Token token.Token Function Expression Arguments *ExpressionList }
FunctionCall calls a function.
func (*FunctionCall) Inspect ¶
func (e *FunctionCall) Inspect() string
func (*FunctionCall) TokenLexeme ¶
func (e *FunctionCall) TokenLexeme() string
func (*FunctionCall) TokenLocation ¶
func (e *FunctionCall) TokenLocation() token.Location
type FunctionParameter ¶
type FunctionParameter struct { Token token.Token Name *Identifier Type *Identifier Default Expression }
Function parameters.
func (*FunctionParameter) Inspect ¶
func (e *FunctionParameter) Inspect() string
func (*FunctionParameter) TokenLexeme ¶
func (e *FunctionParameter) TokenLexeme() string
func (*FunctionParameter) TokenLocation ¶
func (e *FunctionParameter) TokenLocation() token.Location
type Identifier ¶
Identifier (variable).
func (*Identifier) Inspect ¶
func (e *Identifier) Inspect() string
func (*Identifier) TokenLexeme ¶
func (e *Identifier) TokenLexeme() string
func (*Identifier) TokenLocation ¶
func (e *Identifier) TokenLocation() token.Location
type IdentifierList ¶
type IdentifierList struct { Token token.Token Elements []*Identifier }
IdentifierList holds a list of identifiers.
func (*IdentifierList) Inspect ¶
func (e *IdentifierList) Inspect() string
func (*IdentifierList) TokenLexeme ¶
func (e *IdentifierList) TokenLexeme() string
func (*IdentifierList) TokenLocation ¶
func (e *IdentifierList) TokenLocation() token.Location
type If ¶
type If struct { Token token.Token Condition Expression Then *BlockStatement Else *BlockStatement }
If conditional.
func (*If) TokenLexeme ¶
func (*If) TokenLocation ¶
type InfixExpression ¶
type InfixExpression struct { Token token.Token Left Expression Operator string Right Expression }
InfixExpression with two expressions on the left and right, combined by an operator.
func (*InfixExpression) Inspect ¶
func (e *InfixExpression) Inspect() string
func (*InfixExpression) TokenLexeme ¶
func (e *InfixExpression) TokenLexeme() string
func (*InfixExpression) TokenLocation ¶
func (e *InfixExpression) TokenLocation() token.Location
type Integer ¶
Integer numeric literal.
func (*Integer) TokenLexeme ¶
func (*Integer) TokenLocation ¶
type Is ¶
type Is struct { Token token.Token Left Expression Right *Identifier }
Is infix expression.
func (*Is) TokenLexeme ¶
func (*Is) TokenLocation ¶
type Let ¶
type Let struct { Token token.Token Name *Identifier Value Expression }
Let statement.
func (*Let) TokenLexeme ¶
func (*Let) TokenLocation ¶
type Module ¶
type Module struct { Token token.Token Name *Identifier Body *BlockStatement }
Module block.
func (*Module) TokenLexeme ¶
func (*Module) TokenLocation ¶
type ModuleAccess ¶
type ModuleAccess struct { Token token.Token Object *Identifier Parameter *Identifier }
ModuleAccess to access module properties and methods.
func (*ModuleAccess) Inspect ¶
func (e *ModuleAccess) Inspect() string
func (*ModuleAccess) TokenLexeme ¶
func (e *ModuleAccess) TokenLexeme() string
func (*ModuleAccess) TokenLocation ¶
func (e *ModuleAccess) TokenLocation() token.Location
type Pipe ¶
type Pipe struct { Token token.Token Left Expression Right Expression }
Pipe operator.
func (*Pipe) TokenLexeme ¶
func (*Pipe) TokenLocation ¶
type Placeholder ¶
Placeholder.
func (*Placeholder) Inspect ¶
func (e *Placeholder) Inspect() string
func (*Placeholder) TokenLexeme ¶
func (e *Placeholder) TokenLexeme() string
func (*Placeholder) TokenLocation ¶
func (e *Placeholder) TokenLocation() token.Location
type PrefixExpression ¶
type PrefixExpression struct { Token token.Token Operator string Right Expression }
PrefixExpression as an expression with a prefix operator.
func (*PrefixExpression) Inspect ¶
func (e *PrefixExpression) Inspect() string
func (*PrefixExpression) TokenLexeme ¶
func (e *PrefixExpression) TokenLexeme() string
func (*PrefixExpression) TokenLocation ¶
func (e *PrefixExpression) TokenLocation() token.Location
type Program ¶
type Program struct {
Statements []Statement
}
Program as the root node.
func (*Program) TokenLexeme ¶
func (*Program) TokenLocation ¶
type Return ¶
type Return struct { Token token.Token Value Expression }
Return statement.
func (*Return) TokenLexeme ¶
func (*Return) TokenLocation ¶
type Statement ¶
type Statement interface { Node // contains filtered or unexported methods }
A Statement of code.
type String ¶
type String struct { Token token.Token Value string Interpolated map[string]Expression }
String literal.
func (*String) TokenLexeme ¶
func (*String) TokenLocation ¶
type Subscript ¶
type Subscript struct { Token token.Token Left Expression Index Expression }
Subscript for arrays and dictionaries.
func (*Subscript) TokenLexeme ¶
func (*Subscript) TokenLocation ¶
type Switch ¶
type Switch struct { Token token.Token Control Expression Cases []*SwitchCase Default *BlockStatement }
Switch conditional.
func (*Switch) TokenLexeme ¶
func (*Switch) TokenLocation ¶
type SwitchCase ¶
type SwitchCase struct { Token token.Token Values *ExpressionList Body *BlockStatement }
A SwitchCase on a switch.
func (*SwitchCase) Inspect ¶
func (e *SwitchCase) Inspect() string
func (*SwitchCase) TokenLexeme ¶
func (e *SwitchCase) TokenLexeme() string
func (*SwitchCase) TokenLocation ¶
func (e *SwitchCase) TokenLocation() token.Location
type Var ¶
type Var struct { Token token.Token Name *Identifier Value Expression }
Var statement.