Documentation ¶
Index ¶
- type AssignExpression
- type BlockStatement
- type Boolean
- type CallExpression
- type DictLiteral
- type Expression
- type ExpressionStatement
- type ForExpression
- type FunctionLiteral
- type Identifier
- type IfExpression
- type IndexExpression
- type InfixExpression
- type LetStatement
- type Node
- type Null
- type NumberLiteral
- type PrefixExpression
- type Program
- type RangeExpression
- type ReturnStatement
- type Statement
- type StringLiteral
- type VectorLiteral
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignExpression ¶
type AssignExpression struct { Token token.Token // the identifier Left Expression Value Expression }
expression node for `<identifier> = <expression>`
func (*AssignExpression) String ¶
func (ae *AssignExpression) String() string
func (*AssignExpression) TokenLiteral ¶
func (ae *AssignExpression) TokenLiteral() string
type BlockStatement ¶
func (*BlockStatement) String ¶
func (bs *BlockStatement) String() string
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
type Boolean ¶
func (*Boolean) TokenLiteral ¶
type CallExpression ¶
type CallExpression struct { Token token.Token // The '(' token Function Expression // Function literal or identifier Arguments []Expression }
func (*CallExpression) String ¶
func (ce *CallExpression) String() string
func (*CallExpression) TokenLiteral ¶
func (ce *CallExpression) TokenLiteral() string
type DictLiteral ¶
type DictLiteral struct { Token token.Token // the '{' token Pairs map[Expression]Expression }
func (*DictLiteral) String ¶
func (ml *DictLiteral) String() string
func (*DictLiteral) TokenLiteral ¶
func (ml *DictLiteral) TokenLiteral() string
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
Abstract expression node
type ExpressionStatement ¶
type ExpressionStatement struct { Token token.Token // the first token of the expression Expression Expression }
Statement node for an expression, e.g. x + 5;
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
type ForExpression ¶
type ForExpression struct { Token token.Token // the 'for' token Iterator Expression IterValues Expression Statements *BlockStatement }
func (*ForExpression) String ¶
func (fe *ForExpression) String() string
func (*ForExpression) TokenLiteral ¶
func (fe *ForExpression) TokenLiteral() string
type FunctionLiteral ¶
type FunctionLiteral struct { Token token.Token Parameters []*Identifier Defaults map[string]Expression Body *BlockStatement }
func (*FunctionLiteral) String ¶
func (fl *FunctionLiteral) String() string
func (*FunctionLiteral) TokenLiteral ¶
func (fl *FunctionLiteral) TokenLiteral() string
type Identifier ¶
expression node for identifier itself
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type IfExpression ¶
type IfExpression struct { Token token.Token Condition Expression Consequence *BlockStatement Alternative *BlockStatement }
func (*IfExpression) String ¶
func (ie *IfExpression) String() string
func (*IfExpression) TokenLiteral ¶
func (ie *IfExpression) TokenLiteral() string
type IndexExpression ¶
type IndexExpression struct { Token token.Token // The [ token Left Expression Index Expression }
func (*IndexExpression) String ¶
func (ie *IndexExpression) String() string
func (*IndexExpression) TokenLiteral ¶
func (ie *IndexExpression) TokenLiteral() string
type InfixExpression ¶
type InfixExpression struct { Token token.Token // The operator token, e.g. + Left Expression Operator string Right Expression }
func (*InfixExpression) String ¶
func (ie *InfixExpression) String() string
func (*InfixExpression) TokenLiteral ¶
func (ie *InfixExpression) TokenLiteral() string
type LetStatement ¶
type LetStatement struct { Token token.Token // {Type: token.LET, Literal: "LET"} Name *Identifier Value Expression }
statement node for `let <identifier> = <expression>`
func (*LetStatement) String ¶
func (ls *LetStatement) String() string
func (*LetStatement) TokenLiteral ¶
func (ls *LetStatement) TokenLiteral() string
type Null ¶
func (*Null) TokenLiteral ¶
type NumberLiteral ¶
func (*NumberLiteral) String ¶
func (nl *NumberLiteral) String() string
func (*NumberLiteral) TokenLiteral ¶
func (nl *NumberLiteral) TokenLiteral() string
type PrefixExpression ¶
type PrefixExpression struct { Token token.Token // The prefix token, e.g. ! Operator string Right Expression }
func (*PrefixExpression) String ¶
func (pe *PrefixExpression) String() string
func (*PrefixExpression) TokenLiteral ¶
func (pe *PrefixExpression) TokenLiteral() string
type Program ¶
type Program struct {
Statements []Statement
}
slice of statement nodes
func (*Program) TokenLiteral ¶
type RangeExpression ¶
type RangeExpression struct { Token token.Token // The token.COLON token Start Expression End Expression }
func (*RangeExpression) String ¶
func (re *RangeExpression) String() string
func (*RangeExpression) TokenLiteral ¶
func (re *RangeExpression) TokenLiteral() string
type ReturnStatement ¶
type ReturnStatement struct { Token token.Token Value Expression }
statement node for `return <expression>`
func (*ReturnStatement) String ¶
func (rs *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
type Statement ¶
type Statement interface { Node // contains filtered or unexported methods }
Abstract statement node
type StringLiteral ¶
func (*StringLiteral) String ¶
func (sl *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (sl *StringLiteral) TokenLiteral() string
type VectorLiteral ¶
type VectorLiteral struct { Token token.Token // the '[' token Elements []Expression }
func (*VectorLiteral) String ¶
func (al *VectorLiteral) String() string
func (*VectorLiteral) TokenLiteral ¶
func (al *VectorLiteral) TokenLiteral() string
Click to show internal directories.
Click to hide internal directories.