Documentation
¶
Index ¶
- Constants
- type ArrayLiteral
- type AssignmentStatement
- type BlockStatement
- type BooleanLiteral
- type BreakStatement
- type CallExpression
- type ContinueStatement
- type ErrorLevel
- type Expression
- type ExpressionStatement
- type FloatLiteral
- type FunctionLiteral
- type HashLiteral
- type Identifier
- type IfExpression
- type ImportStatement
- type IndexExpression
- type InfixExpression
- type IntegerLiteral
- type InterpolatedString
- type Node
- type NullLiteral
- type Parser
- type ParserError
- type PrefixExpression
- type Program
- type ReturnStatement
- type Statement
- type StringLiteral
- type StructStatement
- type WhileExpression
Constants ¶
View Source
const ( LOWEST int OR // atau AND // dan EQUALS // == LESSGREATER // > or < BITOR // | BITXOR // ^ BITAND // & SHIFT // << or >> SUM // + PRODUCT // * PREFIX // -X or !X or ~X CALL // myFunction(X) INDEX // array[index] )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayLiteral ¶
type ArrayLiteral struct {
Token lexer.Token // '['
Elements []Expression
}
func (*ArrayLiteral) String ¶
func (al *ArrayLiteral) String() string
func (*ArrayLiteral) TokenLiteral ¶
func (al *ArrayLiteral) TokenLiteral() string
type AssignmentStatement ¶
type AssignmentStatement struct {
Token lexer.Token
Name Expression
Value Expression
}
func (*AssignmentStatement) String ¶
func (as *AssignmentStatement) String() string
func (*AssignmentStatement) TokenLiteral ¶
func (as *AssignmentStatement) TokenLiteral() string
type BlockStatement ¶
func (*BlockStatement) String ¶
func (bs *BlockStatement) String() string
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
type BooleanLiteral ¶
func (*BooleanLiteral) String ¶
func (b *BooleanLiteral) String() string
func (*BooleanLiteral) TokenLiteral ¶
func (b *BooleanLiteral) TokenLiteral() string
type BreakStatement ¶
func (*BreakStatement) String ¶
func (bs *BreakStatement) String() string
func (*BreakStatement) TokenLiteral ¶
func (bs *BreakStatement) TokenLiteral() string
type CallExpression ¶
type CallExpression struct {
Token lexer.Token
Function Expression
Arguments []Expression
}
func (*CallExpression) String ¶
func (ce *CallExpression) String() string
func (*CallExpression) TokenLiteral ¶
func (ce *CallExpression) TokenLiteral() string
type ContinueStatement ¶
func (*ContinueStatement) String ¶
func (cs *ContinueStatement) String() string
func (*ContinueStatement) TokenLiteral ¶
func (cs *ContinueStatement) TokenLiteral() string
type ErrorLevel ¶
type ErrorLevel string
const ( LEVEL_ERROR ErrorLevel = "ERROR" LEVEL_WARNING ErrorLevel = "WARNING" LEVEL_PANIC ErrorLevel = "PANIC" )
type Expression ¶
type Expression interface {
Node
// contains filtered or unexported methods
}
type ExpressionStatement ¶
type ExpressionStatement struct {
Token lexer.Token
Expression Expression
}
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
type FloatLiteral ¶
func (*FloatLiteral) String ¶
func (fl *FloatLiteral) String() string
func (*FloatLiteral) TokenLiteral ¶
func (fl *FloatLiteral) TokenLiteral() string
type FunctionLiteral ¶
type FunctionLiteral struct {
Token lexer.Token
Name string
Parameters []*Identifier
Body *BlockStatement
Doc string
}
func (*FunctionLiteral) String ¶
func (fl *FunctionLiteral) String() string
func (*FunctionLiteral) TokenLiteral ¶
func (fl *FunctionLiteral) TokenLiteral() string
type HashLiteral ¶
type HashLiteral struct {
Token lexer.Token // '{'
Pairs map[Expression]Expression
}
func (*HashLiteral) String ¶
func (hl *HashLiteral) String() string
func (*HashLiteral) TokenLiteral ¶
func (hl *HashLiteral) 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 lexer.Token
Condition Expression
Consequence *BlockStatement
Alternative *BlockStatement
}
func (*IfExpression) String ¶
func (ie *IfExpression) String() string
func (*IfExpression) TokenLiteral ¶
func (ie *IfExpression) TokenLiteral() string
type ImportStatement ¶
type ImportStatement struct {
Token lexer.Token // The 'ambil' or 'dari' token
Path string // The file path
Identifiers []string // Imported identifiers (if 'dari')
}
func (*ImportStatement) String ¶
func (is *ImportStatement) String() string
func (*ImportStatement) TokenLiteral ¶
func (is *ImportStatement) TokenLiteral() string
type IndexExpression ¶
type IndexExpression struct {
Token lexer.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 lexer.Token
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 InterpolatedString ¶
type InterpolatedString struct {
Token lexer.Token // The first part
Parts []Expression
}
func (*InterpolatedString) String ¶
func (is *InterpolatedString) String() string
func (*InterpolatedString) TokenLiteral ¶
func (is *InterpolatedString) TokenLiteral() string
type NullLiteral ¶
func (*NullLiteral) String ¶
func (n *NullLiteral) String() string
func (*NullLiteral) TokenLiteral ¶
func (n *NullLiteral) TokenLiteral() string
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Errors ¶
func (p *Parser) Errors() []ParserError
func (*Parser) ParseProgram ¶
type ParserError ¶
type ParserError struct {
Level ErrorLevel
Message string
Line int
Column int
File string
Context string
}
func (ParserError) String ¶
func (e ParserError) String() string
type PrefixExpression ¶
type PrefixExpression struct {
Token lexer.Token
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 lexer.Token
ReturnValue 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
type StructStatement ¶
type StructStatement struct {
Token lexer.Token // The 'struktur' token
Name *Identifier
Fields []*Identifier
Doc string
}
func (*StructStatement) String ¶
func (ss *StructStatement) String() string
func (*StructStatement) TokenLiteral ¶
func (ss *StructStatement) TokenLiteral() string
type WhileExpression ¶
type WhileExpression struct {
Token lexer.Token
Condition Expression
Body *BlockStatement
}
func (*WhileExpression) String ¶
func (we *WhileExpression) String() string
func (*WhileExpression) TokenLiteral ¶
func (we *WhileExpression) TokenLiteral() string
Click to show internal directories.
Click to hide internal directories.