Documentation ¶
Index ¶
- type BlockStatement
- type BooleanLiteral
- type CallExpression
- type Expression
- type ExpressionStatement
- type FunctionLiteral
- type Identifier
- type InfixExpression
- type LetStatement
- type NilLiteral
- type Node
- type NumberLiteral
- 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 BlockStatement ¶
type BlockStatement struct { Token token.Token Statements []Statement RBraceToken token.Token //used in End() method }
func (*BlockStatement) End ¶
func (bs *BlockStatement) End() token.Position
func (*BlockStatement) Pos ¶
func (bs *BlockStatement) Pos() token.Position
func (*BlockStatement) String ¶
func (bs *BlockStatement) String() string
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
type BooleanLiteral ¶
func (*BooleanLiteral) End ¶
func (b *BooleanLiteral) End() token.Position
func (*BooleanLiteral) Pos ¶
func (b *BooleanLiteral) Pos() token.Position
func (*BooleanLiteral) String ¶
func (b *BooleanLiteral) String() string
func (*BooleanLiteral) TokenLiteral ¶
func (b *BooleanLiteral) TokenLiteral() string
type CallExpression ¶
type CallExpression struct { Token token.Token // The '(' token Function Expression // Identifier or FunctionLiteral Arguments []Expression }
func (*CallExpression) End ¶
func (ce *CallExpression) End() token.Position
func (*CallExpression) Pos ¶
func (ce *CallExpression) Pos() token.Position
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 Expression Expression }
func (*ExpressionStatement) End ¶
func (es *ExpressionStatement) End() token.Position
func (*ExpressionStatement) Pos ¶
func (es *ExpressionStatement) Pos() token.Position
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
type FunctionLiteral ¶
type FunctionLiteral struct { Token token.Token // The 'fn' token Parameters []*Identifier Body *BlockStatement }
func (*FunctionLiteral) End ¶
func (fl *FunctionLiteral) End() token.Position
func (*FunctionLiteral) Pos ¶
func (fl *FunctionLiteral) Pos() token.Position
func (*FunctionLiteral) String ¶
func (fl *FunctionLiteral) String() string
func (*FunctionLiteral) TokenLiteral ¶
func (fl *FunctionLiteral) TokenLiteral() string
type Identifier ¶
func (*Identifier) End ¶
func (i *Identifier) End() token.Position
func (*Identifier) Pos ¶
func (i *Identifier) Pos() token.Position
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type InfixExpression ¶
type InfixExpression struct { Token token.Token Operator string Right Expression Left Expression }
1 + 2 * 3
func (*InfixExpression) End ¶
func (ie *InfixExpression) End() token.Position
func (*InfixExpression) Pos ¶
func (ie *InfixExpression) Pos() token.Position
func (*InfixExpression) String ¶
func (ie *InfixExpression) String() string
func (*InfixExpression) TokenLiteral ¶
func (ie *InfixExpression) TokenLiteral() string
type LetStatement ¶
type LetStatement struct { Token token.Token Name *Identifier Value Expression }
let <identifier> = <expression>
func (*LetStatement) End ¶
func (ls *LetStatement) End() token.Position
func (*LetStatement) Pos ¶
func (ls *LetStatement) Pos() token.Position
func (*LetStatement) String ¶
func (ls *LetStatement) String() string
func (*LetStatement) TokenLiteral ¶
func (ls *LetStatement) TokenLiteral() string
type NilLiteral ¶
func (*NilLiteral) End ¶
func (n *NilLiteral) End() token.Position
func (*NilLiteral) Pos ¶
func (n *NilLiteral) Pos() token.Position
func (*NilLiteral) String ¶
func (n *NilLiteral) String() string
func (*NilLiteral) TokenLiteral ¶
func (n *NilLiteral) TokenLiteral() string
type NumberLiteral ¶
func (*NumberLiteral) End ¶
func (nl *NumberLiteral) End() token.Position
func (*NumberLiteral) Pos ¶
func (nl *NumberLiteral) Pos() token.Position
func (*NumberLiteral) String ¶
func (nl *NumberLiteral) String() string
func (*NumberLiteral) TokenLiteral ¶
func (nl *NumberLiteral) TokenLiteral() string
type PrefixExpression ¶
type PrefixExpression struct { Token token.Token Operator string Right Expression }
-2, -3
func (*PrefixExpression) End ¶
func (pe *PrefixExpression) End() token.Position
func (*PrefixExpression) Pos ¶
func (pe *PrefixExpression) Pos() token.Position
func (*PrefixExpression) String ¶
func (pe *PrefixExpression) String() string
func (*PrefixExpression) TokenLiteral ¶
func (pe *PrefixExpression) TokenLiteral() string
type ReturnStatement ¶
type ReturnStatement struct { Token token.Token // the 'return' token ReturnValue Expression }
func (*ReturnStatement) End ¶
func (rs *ReturnStatement) End() token.Position
func (*ReturnStatement) Pos ¶
func (rs *ReturnStatement) Pos() token.Position
func (*ReturnStatement) String ¶
func (rs *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
type StringLiteral ¶
func (*StringLiteral) End ¶
func (s *StringLiteral) End() token.Position
func (*StringLiteral) Pos ¶
func (s *StringLiteral) Pos() token.Position
func (*StringLiteral) String ¶
func (s *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (s *StringLiteral) TokenLiteral() string
Click to show internal directories.
Click to hide internal directories.