Documentation
¶
Index ¶
- type ArrayLiteral
- type BlockStatement
- type Boolean
- type BreakStatement
- type CallExpression
- type CharLiteral
- type ConstStatement
- type ContinueStatement
- type ELSE_IF
- type Expression
- type ExpressionStatement
- type FloatLiteral
- type ForExpression
- type FunctionLiteral
- type HashLiteral
- type Identifier
- type IfExpression
- type ImportStatement
- type IndexExpression
- type InfixExpression
- type IntegerLiteral
- type LetStatement
- type MemberExpression
- type Node
- type PrefixExpression
- type Program
- type ReturnStatement
- type Statement
- type StringLiteral
- type StructLiteral
- type StructStatement
- type WhileExpression
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
}
array
func (*ArrayLiteral) Column ¶ added in v0.1.1
func (al *ArrayLiteral) Column() int
func (*ArrayLiteral) Line ¶ added in v0.1.1
func (al *ArrayLiteral) Line() int
func (*ArrayLiteral) String ¶
func (al *ArrayLiteral) String() string
func (*ArrayLiteral) TokenLiteral ¶
func (al *ArrayLiteral) TokenLiteral() string
type BlockStatement ¶
func (*BlockStatement) Column ¶ added in v0.1.1
func (bs *BlockStatement) Column() int
func (*BlockStatement) Line ¶ added in v0.1.1
func (bs *BlockStatement) Line() int
func (*BlockStatement) String ¶
func (bs *BlockStatement) String() string
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
type BreakStatement ¶ added in v0.1.10
func (*BreakStatement) Column ¶ added in v0.1.10
func (bs *BreakStatement) Column() int
func (*BreakStatement) Line ¶ added in v0.1.10
func (bs *BreakStatement) Line() int
func (*BreakStatement) String ¶ added in v0.1.10
func (bs *BreakStatement) String() string
func (*BreakStatement) TokenLiteral ¶ added in v0.1.10
func (bs *BreakStatement) TokenLiteral() string
type CallExpression ¶
type CallExpression struct {
Token token.Token
Function Expression
Arguments []Expression
}
call expression
func (*CallExpression) Column ¶ added in v0.1.1
func (ce *CallExpression) Column() int
func (*CallExpression) Line ¶ added in v0.1.1
func (ce *CallExpression) Line() int
func (*CallExpression) String ¶
func (ce *CallExpression) String() string
func (*CallExpression) TokenLiteral ¶
func (ce *CallExpression) TokenLiteral() string
type CharLiteral ¶
char
func (*CharLiteral) Column ¶ added in v0.1.1
func (sl *CharLiteral) Column() int
func (*CharLiteral) Line ¶ added in v0.1.1
func (sl *CharLiteral) Line() int
func (*CharLiteral) String ¶
func (sl *CharLiteral) String() string
func (*CharLiteral) TokenLiteral ¶
func (sl *CharLiteral) TokenLiteral() string
type ConstStatement ¶ added in v0.1.10
type ConstStatement struct {
Token token.Token
Name *Identifier
Value Expression
}
func (*ConstStatement) Column ¶ added in v0.1.10
func (cs *ConstStatement) Column() int
func (*ConstStatement) Line ¶ added in v0.1.10
func (cs *ConstStatement) Line() int
func (*ConstStatement) String ¶ added in v0.1.10
func (cs *ConstStatement) String() string
func (*ConstStatement) TokenLiteral ¶ added in v0.1.10
func (cs *ConstStatement) TokenLiteral() string
type ContinueStatement ¶ added in v0.1.10
func (*ContinueStatement) Column ¶ added in v0.1.10
func (cs *ContinueStatement) Column() int
func (*ContinueStatement) Line ¶ added in v0.1.10
func (cs *ContinueStatement) Line() int
func (*ContinueStatement) String ¶ added in v0.1.10
func (cs *ContinueStatement) String() string
func (*ContinueStatement) TokenLiteral ¶ added in v0.1.10
func (cs *ContinueStatement) TokenLiteral() string
type ELSE_IF ¶ added in v0.1.2
type ELSE_IF struct {
Condition Expression
Consequence *BlockStatement
}
type Expression ¶
type Expression interface {
Node // TokenLiteral and String()
// contains filtered or unexported methods
}
type ExpressionStatement ¶
type ExpressionStatement struct {
Token token.Token
Expression Expression
}
func (*ExpressionStatement) Column ¶ added in v0.1.1
func (i *ExpressionStatement) Column() int
func (*ExpressionStatement) Line ¶ added in v0.1.1
func (i *ExpressionStatement) Line() int
func (*ExpressionStatement) String ¶
func (i *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (i *ExpressionStatement) TokenLiteral() string
type FloatLiteral ¶
float
func (*FloatLiteral) Column ¶ added in v0.1.1
func (sl *FloatLiteral) Column() int
func (*FloatLiteral) Line ¶ added in v0.1.1
func (sl *FloatLiteral) Line() int
func (*FloatLiteral) String ¶
func (sl *FloatLiteral) String() string
func (*FloatLiteral) TokenLiteral ¶
func (sl *FloatLiteral) TokenLiteral() string
type ForExpression ¶ added in v0.1.2
type ForExpression struct {
Token token.Token // The 'for' token
Init Statement // e.g., let i = 0;
Condition Expression // e.g., i < 10;
Post Statement // e.g., i = i + 1; (usually as an expression statement)
Body *BlockStatement
}
func (*ForExpression) Column ¶ added in v0.1.2
func (f *ForExpression) Column() int
func (*ForExpression) Line ¶ added in v0.1.2
func (f *ForExpression) Line() int
func (*ForExpression) String ¶ added in v0.1.2
func (f *ForExpression) String() string
func (*ForExpression) TokenLiteral ¶ added in v0.1.2
func (f *ForExpression) TokenLiteral() string
type FunctionLiteral ¶
type FunctionLiteral struct {
Token token.Token
Parameters []*Identifier
Body BlockStatement
}
function
func (*FunctionLiteral) Column ¶ added in v0.1.1
func (fl *FunctionLiteral) Column() int
func (*FunctionLiteral) Line ¶ added in v0.1.1
func (fl *FunctionLiteral) Line() int
func (*FunctionLiteral) String ¶
func (fl *FunctionLiteral) String() string
func (*FunctionLiteral) TokenLiteral ¶
func (fl *FunctionLiteral) TokenLiteral() string
type HashLiteral ¶
type HashLiteral struct {
Token token.Token
Pairs map[Expression]Expression
}
hash literal
func (*HashLiteral) Column ¶ added in v0.1.1
func (hl *HashLiteral) Column() int
func (*HashLiteral) Line ¶ added in v0.1.1
func (hl *HashLiteral) Line() int
func (*HashLiteral) String ¶
func (hl *HashLiteral) String() string
func (*HashLiteral) TokenLiteral ¶
func (hl *HashLiteral) TokenLiteral() string
type Identifier ¶
func (*Identifier) Column ¶ added in v0.1.1
func (i *Identifier) Column() int
func (*Identifier) Line ¶ added in v0.1.1
func (i *Identifier) Line() int
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
IfElse []*ELSE_IF
Alternative *BlockStatement
}
func (*IfExpression) Column ¶ added in v0.1.1
func (i *IfExpression) Column() int
func (*IfExpression) Line ¶ added in v0.1.1
func (i *IfExpression) Line() int
func (*IfExpression) String ¶
func (i *IfExpression) String() string
func (*IfExpression) TokenLiteral ¶
func (i *IfExpression) TokenLiteral() string
type ImportStatement ¶ added in v0.1.4
func (*ImportStatement) Column ¶ added in v0.1.4
func (i *ImportStatement) Column() int
func (*ImportStatement) Line ¶ added in v0.1.4
func (i *ImportStatement) Line() int
func (*ImportStatement) String ¶ added in v0.1.4
func (i *ImportStatement) String() string
func (*ImportStatement) TokenLiteral ¶ added in v0.1.4
func (i *ImportStatement) TokenLiteral() string
type IndexExpression ¶
type IndexExpression struct {
Token token.Token //[
Left Expression
Index Expression
}
array index expression
func (*IndexExpression) Column ¶ added in v0.1.1
func (ie *IndexExpression) Column() int
func (*IndexExpression) Line ¶ added in v0.1.1
func (ie *IndexExpression) Line() int
func (*IndexExpression) String ¶
func (ie *IndexExpression) String() string
func (*IndexExpression) TokenLiteral ¶
func (ie *IndexExpression) TokenLiteral() string
type InfixExpression ¶
type InfixExpression struct {
Token token.Token
Left Expression
Right Expression
Operator string
}
func (*InfixExpression) Column ¶ added in v0.1.1
func (i *InfixExpression) Column() int
func (*InfixExpression) Line ¶ added in v0.1.1
func (i *InfixExpression) Line() int
func (*InfixExpression) String ¶
func (i *InfixExpression) String() string
func (*InfixExpression) TokenLiteral ¶
func (i *InfixExpression) TokenLiteral() string
type IntegerLiteral ¶
func (*IntegerLiteral) Column ¶ added in v0.1.1
func (i *IntegerLiteral) Column() int
func (*IntegerLiteral) Line ¶ added in v0.1.1
func (i *IntegerLiteral) Line() int
func (*IntegerLiteral) String ¶
func (i *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (i *IntegerLiteral) TokenLiteral() string
type LetStatement ¶
type LetStatement struct {
Token token.Token
Name *Identifier
Value Expression
}
func (*LetStatement) Column ¶ added in v0.1.1
func (ls *LetStatement) Column() int
func (*LetStatement) Line ¶ added in v0.1.1
func (ls *LetStatement) Line() int
func (*LetStatement) String ¶
func (ls *LetStatement) String() string
func (*LetStatement) TokenLiteral ¶
func (ls *LetStatement) TokenLiteral() string
type MemberExpression ¶ added in v0.1.4
type MemberExpression struct {
Token token.Token
Object Expression
Property *Identifier
}
func (*MemberExpression) Column ¶ added in v0.1.4
func (m *MemberExpression) Column() int
func (*MemberExpression) Line ¶ added in v0.1.4
func (m *MemberExpression) Line() int
func (*MemberExpression) String ¶ added in v0.1.4
func (m *MemberExpression) String() string
func (*MemberExpression) TokenLiteral ¶ added in v0.1.4
func (m *MemberExpression) TokenLiteral() string
type PrefixExpression ¶
type PrefixExpression struct {
Token token.Token
Operator string
Right Expression
}
func (*PrefixExpression) Column ¶ added in v0.1.1
func (i *PrefixExpression) Column() int
func (*PrefixExpression) Line ¶ added in v0.1.1
func (i *PrefixExpression) Line() int
func (*PrefixExpression) String ¶
func (i *PrefixExpression) String() string
func (*PrefixExpression) TokenLiteral ¶
func (i *PrefixExpression) TokenLiteral() string
type ReturnStatement ¶
type ReturnStatement struct {
Token token.Token
ReturnValue Expression
}
func (*ReturnStatement) Column ¶ added in v0.1.1
func (i *ReturnStatement) Column() int
func (*ReturnStatement) Line ¶ added in v0.1.1
func (i *ReturnStatement) Line() int
func (*ReturnStatement) String ¶
func (i *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (i *ReturnStatement) TokenLiteral() string
type StringLiteral ¶
strings
func (*StringLiteral) Column ¶ added in v0.1.1
func (sl *StringLiteral) Column() int
func (*StringLiteral) Line ¶ added in v0.1.1
func (sl *StringLiteral) Line() int
func (*StringLiteral) String ¶
func (sl *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (sl *StringLiteral) TokenLiteral() string
type StructLiteral ¶ added in v0.1.9
type StructLiteral struct {
Token token.Token
Name *Identifier
Fields map[string]Expression
}
func (*StructLiteral) Column ¶ added in v0.1.9
func (ss *StructLiteral) Column() int
func (*StructLiteral) Line ¶ added in v0.1.9
func (ss *StructLiteral) Line() int
func (*StructLiteral) String ¶ added in v0.1.9
func (sl *StructLiteral) String() string
func (*StructLiteral) TokenLiteral ¶ added in v0.1.9
func (sl *StructLiteral) TokenLiteral() string
type StructStatement ¶ added in v0.1.9
type StructStatement struct {
Token token.Token
Name *Identifier
Fields map[string]Expression
}
struct
func (*StructStatement) Column ¶ added in v0.1.9
func (ss *StructStatement) Column() int
func (*StructStatement) Line ¶ added in v0.1.9
func (ss *StructStatement) Line() int
func (*StructStatement) String ¶ added in v0.1.9
func (ss *StructStatement) String() string
func (*StructStatement) TokenLiteral ¶ added in v0.1.9
func (ss *StructStatement) TokenLiteral() string
type WhileExpression ¶ added in v0.1.2
type WhileExpression struct {
Token token.Token
Condition Expression
Body *BlockStatement
}
func (*WhileExpression) Column ¶ added in v0.1.2
func (w *WhileExpression) Column() int
func (*WhileExpression) Line ¶ added in v0.1.2
func (w *WhileExpression) Line() int
func (*WhileExpression) String ¶ added in v0.1.2
func (w *WhileExpression) String() string
func (*WhileExpression) TokenLiteral ¶ added in v0.1.2
func (w *WhileExpression) TokenLiteral() string
Click to show internal directories.
Click to hide internal directories.