Documentation ¶
Index ¶
- type ArgumentDeclaration
- type AssignmentStatement
- type Ast
- type BinaryExpression
- type BlockStatement
- type BraceLiteralExpression
- type CallExpression
- type CastExpression
- type Declare
- type DeclareStatement
- type Expression
- type ForStatement
- type FunctionDeclaration
- type IdentExpression
- type IfStatment
- type IndexExpression
- type LiteralExpression
- type Node
- type ParenLiteralExpression
- type ReturnStatement
- type Scope
- type SliceExpression
- type Statement
- type TypeExpression
- type UnaryExpression
- type VaribleDeclaration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgumentDeclaration ¶
type ArgumentDeclaration struct { Name *IdentExpression Type types.Type }
func (*ArgumentDeclaration) First ¶
func (e *ArgumentDeclaration) First() lexer.Token
func (*ArgumentDeclaration) Last ¶
func (e *ArgumentDeclaration) Last() lexer.Token
type AssignmentStatement ¶
type AssignmentStatement struct { Left Expression Assign lexer.Token Right Expression }
AssignmentStatement is a statement in the form: expression = expression
func (*AssignmentStatement) First ¶
func (e *AssignmentStatement) First() lexer.Token
func (*AssignmentStatement) Last ¶
func (e *AssignmentStatement) Last() lexer.Token
type Ast ¶
type Ast struct { Scope *Scope Functions []*FunctionDeclaration }
type BinaryExpression ¶
type BinaryExpression struct { IsFp bool Left Expression Operator lexer.Token Right Expression }
BinaryExpression is an expression in the form: expression operator expression
func (*BinaryExpression) First ¶
func (e *BinaryExpression) First() lexer.Token
func (*BinaryExpression) Last ¶
func (e *BinaryExpression) Last() lexer.Token
type BlockStatement ¶
type BlockStatement struct { Scope *Scope LeftBrace lexer.Token Statements []Statement RightBrace lexer.Token }
BlockStatement is a statement in the form: {statement; statement; ...}
func (*BlockStatement) First ¶
func (e *BlockStatement) First() lexer.Token
func (*BlockStatement) Last ¶
func (e *BlockStatement) Last() lexer.Token
type BraceLiteralExpression ¶
type BraceLiteralExpression struct { Type types.Type LeftBrace lexer.Token Elements []Expression RightBrace lexer.Token }
BraceLiteralExpression is an expression in the form: type{expression, expression, ...}
func (*BraceLiteralExpression) First ¶
func (e *BraceLiteralExpression) First() lexer.Token
func (*BraceLiteralExpression) Last ¶
func (e *BraceLiteralExpression) Last() lexer.Token
type CallExpression ¶
type CallExpression struct { Function Expression Arguments *ParenLiteralExpression }
CallExpression is an expression in the form: expression(expression, expression, ...)
func (*CallExpression) First ¶
func (e *CallExpression) First() lexer.Token
func (*CallExpression) Last ¶
func (e *CallExpression) Last() lexer.Token
type CastExpression ¶
type CastExpression struct { LeftParen lexer.Token Type types.Type RightParen lexer.Token Expression Expression }
CastExpression is an expression in the form: (type)expression
func (*CastExpression) First ¶
func (e *CastExpression) First() lexer.Token
func (*CastExpression) Last ¶
func (e *CastExpression) Last() lexer.Token
type DeclareStatement ¶
type DeclareStatement struct {
Statement Declare
}
func (*DeclareStatement) First ¶
func (e *DeclareStatement) First() lexer.Token
func (*DeclareStatement) Last ¶
func (e *DeclareStatement) Last() lexer.Token
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
type ForStatement ¶
type ForStatement struct { For lexer.Token Index Statement Semi1 lexer.Token Condition Expression Semi2 lexer.Token Increment Statement Body *BlockStatement }
ForStatement is a statement in the form: for statement; expression; statement {statement; ...}
func (*ForStatement) First ¶
func (e *ForStatement) First() lexer.Token
func (*ForStatement) Last ¶
func (e *ForStatement) Last() lexer.Token
type FunctionDeclaration ¶
type FunctionDeclaration struct { Name *IdentExpression DoubleColon lexer.Token Arguments []*ArgumentDeclaration Return types.Type Body *BlockStatement }
FunctionDeclaration is a declare node in the form: ident :: type ident, ... -> type { statement; ... }
func (*FunctionDeclaration) First ¶
func (e *FunctionDeclaration) First() lexer.Token
func (*FunctionDeclaration) Last ¶
func (e *FunctionDeclaration) Last() lexer.Token
type IdentExpression ¶
IdentExpression is any identifier
func (*IdentExpression) First ¶
func (e *IdentExpression) First() lexer.Token
func (*IdentExpression) Last ¶
func (e *IdentExpression) Last() lexer.Token
type IfStatment ¶
type IfStatment struct { If lexer.Token Condition Expression Body *BlockStatement Else *IfStatment }
IfStatment is a statement in the form: if expression {statement; ...} ...
func (*IfStatment) First ¶
func (e *IfStatment) First() lexer.Token
func (*IfStatment) Last ¶
func (e *IfStatment) Last() lexer.Token
type IndexExpression ¶
type IndexExpression struct { Expression Expression LeftBrack lexer.Token Index Expression RightBrack lexer.Token }
IndexExpression is an expression in the form: expression[expression]
func (*IndexExpression) First ¶
func (e *IndexExpression) First() lexer.Token
func (*IndexExpression) Last ¶
func (e *IndexExpression) Last() lexer.Token
type LiteralExpression ¶
LiteralExpression is an expression in the form: interger || float || string
func (*LiteralExpression) First ¶
func (e *LiteralExpression) First() lexer.Token
func (*LiteralExpression) Last ¶
func (e *LiteralExpression) Last() lexer.Token
type ParenLiteralExpression ¶
type ParenLiteralExpression struct { LeftParen lexer.Token Elements []Expression RightParen lexer.Token }
ParenLiteralExpression is an expression in the form: (expression, expression, ...)
func (*ParenLiteralExpression) First ¶
func (e *ParenLiteralExpression) First() lexer.Token
func (*ParenLiteralExpression) Last ¶
func (e *ParenLiteralExpression) Last() lexer.Token
type ReturnStatement ¶
type ReturnStatement struct { Return lexer.Token Result Expression }
ReturnStatement is a statement in the form: return expression
func (*ReturnStatement) First ¶
func (e *ReturnStatement) First() lexer.Token
func (*ReturnStatement) Last ¶
func (e *ReturnStatement) Last() lexer.Token
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
type SliceExpression ¶
type SliceExpression struct { Expression Expression LeftBrack lexer.Token Low Expression Colon lexer.Token High Expression RightBrack lexer.Token }
SliceExpression represents an expression in the form: expression[expression:expression]
func (*SliceExpression) First ¶
func (e *SliceExpression) First() lexer.Token
func (*SliceExpression) Last ¶
func (e *SliceExpression) Last() lexer.Token
type TypeExpression ¶
TypeExpression is a type
func (*TypeExpression) First ¶
func (e *TypeExpression) First() lexer.Token
func (*TypeExpression) Last ¶
func (e *TypeExpression) Last() lexer.Token
type UnaryExpression ¶
type UnaryExpression struct { Operator lexer.Token Expression Expression }
UnaryExpression is an expression in the form: operator expression
func (*UnaryExpression) First ¶
func (e *UnaryExpression) First() lexer.Token
func (*UnaryExpression) Last ¶
func (e *UnaryExpression) Last() lexer.Token
type VaribleDeclaration ¶
type VaribleDeclaration struct { Type types.Type Name *IdentExpression Value Expression }
VaribleDeclaration is a declare node in the form: ident := expression || type ident = expression
func (*VaribleDeclaration) First ¶
func (e *VaribleDeclaration) First() lexer.Token
func (*VaribleDeclaration) Last ¶
func (e *VaribleDeclaration) Last() lexer.Token