Documentation
¶
Index ¶
- type ArrayLiteral
- type AssignStatement
- type BlockStatement
- type Boolean
- type CallExpression
- type Expression
- type ExpressionStatement
- type FuncLiteral
- type HashMapLiteral
- type Identifier
- type IfExpression
- type IndexExpression
- type InfixExpression
- type IntegerLiteral
- type LetStatement
- type Node
- type PrefixExpression
- type Program
- type ReturnStatement
- type Statement
- type StringLiteral
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayLiteral ¶
type ArrayLiteral struct {
Token token.Token // "["
Elements []Expression
}
func (*ArrayLiteral) String ¶
func (al *ArrayLiteral) String() string
func (*ArrayLiteral) TokenLiteral ¶
func (al *ArrayLiteral) TokenLiteral() string
type AssignStatement ¶
type AssignStatement struct {
Token token.Token // "=" token
Identifier *Identifier
Value Expression
}
func (*AssignStatement) String ¶
func (as *AssignStatement) String() string
func (*AssignStatement) TokenLiteral ¶
func (as *AssignStatement) 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 // "("
Function Expression // either Identifier or Function declaration
Arguments []Expression
}
func (*CallExpression) String ¶
func (ce *CallExpression) String() string
func (*CallExpression) TokenLiteral ¶
func (ce *CallExpression) TokenLiteral() string
type Expression ¶
type Expression interface {
Node
// contains filtered or unexported methods
}
type ExpressionStatement ¶
type ExpressionStatement struct {
Token token.Token // first token of the expression
Value Expression
}
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
type FuncLiteral ¶
type FuncLiteral struct {
Token token.Token // The token "fn"
Parameters []*Identifier
Body *BlockStatement
Identifier *Identifier
}
func (*FuncLiteral) String ¶
func (fl *FuncLiteral) String() string
func (*FuncLiteral) TokenLiteral ¶
func (fl *FuncLiteral) TokenLiteral() string
type HashMapLiteral ¶
type HashMapLiteral struct {
Token token.Token // "{"
Pairs map[Expression]Expression
}
func (*HashMapLiteral) String ¶
func (hml *HashMapLiteral) String() string
func (*HashMapLiteral) TokenLiteral ¶
func (hml *HashMapLiteral) TokenLiteral() string
type Identifier ¶
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type IfExpression ¶
type IfExpression struct {
Token token.Token // The token "if"
Condition Expression
Consequence *BlockStatement
Alternative *BlockStatement
}
func (*IfExpression) String ¶
func (ife *IfExpression) String() string
func (*IfExpression) TokenLiteral ¶
func (ife *IfExpression) TokenLiteral() string
type IndexExpression ¶
type IndexExpression struct {
Token token.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 infix 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 IntegerLiteral ¶
func (*IntegerLiteral) String ¶
func (il *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
type LetStatement ¶
type LetStatement struct {
Token token.Token // "let" token
Identifier *Identifier
Value Expression
}
func (*LetStatement) String ¶
func (ls *LetStatement) String() string
func (*LetStatement) TokenLiteral ¶
func (ls *LetStatement) 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 ReturnStatement ¶
type ReturnStatement struct {
Token token.Token // "return" token
Value Expression
}
func (*ReturnStatement) String ¶
func (rs *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
type StringLiteral ¶
func (*StringLiteral) String ¶
func (sl *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (sl *StringLiteral) TokenLiteral() string
Click to show internal directories.
Click to hide internal directories.