Documentation ¶
Index ¶
- func Print(v interface{}) error
- func Sprint(v interface{}) (string, error)
- type Arguments
- type ArrayDeclExpr
- type AsignStmt
- type BinaryExpr
- type BlockStmt
- type BreakStmt
- type BreakTarget
- type CallExpr
- type CallStmt
- type CaseBlock
- type ClassDeclStmt
- type Comment
- type ConstantExpr
- type ContinueStmt
- type ContinueTarget
- type Decl
- type DeleteStmt
- type EnumDeclStmt
- type EnumValue
- type Expr
- type Field
- type File
- type ForStmt
- type FuncDeclExpr
- type FuncDeclStmt
- type IdentExpr
- type IfBlock
- type IfStmt
- type ImportStmt
- type IncStmt
- type IndexAsignStmt
- type IndexExpr
- type KeyValue
- type Lexer
- type MapDeclExpr
- type NewInstanceExpr
- type Node
- type NodeError
- type Position
- type Printer
- type Program
- type RegisterExpr
- type ReturnStmt
- type SelectorExpr
- type Stmt
- type SwitchStmt
- type TailCallStmt
- type Target
- type TernaryExpr
- type ThrowStmt
- type Token
- type TryStmt
- type Type
- type TypeofExpr
- type UnaryExpr
- type VarDeclStmt
- type WhileStmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArrayDeclExpr ¶
func (*ArrayDeclExpr) Position ¶
func (i *ArrayDeclExpr) Position() Position
type BinaryExpr ¶
func (*BinaryExpr) Position ¶
func (i *BinaryExpr) Position() Position
type BlockStmt ¶
type BlockStmt struct { Lbrace Position // Position of "{" List []Stmt Rbrace Position // Position of "}" }
A BlockStmt node represents a braced statement list.
type BreakTarget ¶
type CallExpr ¶
type ClassDeclStmt ¶
type ClassDeclStmt struct { Name string Setters []*FuncDeclStmt Fields []*VarDeclStmt Functions []*FuncDeclStmt Getters []*FuncDeclStmt Attributes []string Pos Position Exported bool }
func (*ClassDeclStmt) Position ¶
func (c *ClassDeclStmt) Position() Position
type ConstantExpr ¶
func (*ConstantExpr) Position ¶
func (i *ConstantExpr) Position() Position
type ContinueStmt ¶
func (*ContinueStmt) Position ¶
func (i *ContinueStmt) Position() Position
type ContinueTarget ¶
type DeleteStmt ¶
func (*DeleteStmt) Position ¶
func (i *DeleteStmt) Position() Position
type EnumDeclStmt ¶
func (*EnumDeclStmt) Position ¶
func (i *EnumDeclStmt) Position() Position
type File ¶
type File struct { Path string Stms []Stmt Global []Stmt Comments []*Comment Imports []*ImportStmt Attributes []string }
func (*File) Import ¶
func (f *File) Import(alias string) *ImportStmt
type ForStmt ¶
type ForStmt struct { Expression Expr Step Stmt InExpression Expr OfExpression Expr Body *BlockStmt Declaration []Stmt Pos Position // contains filtered or unexported fields }
func (*ForStmt) ContinuePC ¶
func (*ForStmt) SetBreakPC ¶
func (*ForStmt) SetContinuePC ¶
type FuncDeclExpr ¶
FuncDeclExpr is a function as a value expression
func (*FuncDeclExpr) Position ¶
func (i *FuncDeclExpr) Position() Position
type FuncDeclStmt ¶
type FuncDeclStmt struct { Args *Arguments Comment *Comment Body *BlockStmt Name string ReceiverType string Attributes []string Pos Position Exported bool Lambda bool Variadic bool }
func (*FuncDeclStmt) Position ¶
func (i *FuncDeclStmt) Position() Position
type ImportStmt ¶
func (*ImportStmt) Position ¶
func (i *ImportStmt) Position() Position
type IndexAsignStmt ¶
func (*IndexAsignStmt) Position ¶
func (i *IndexAsignStmt) Position() Position
type IndexExpr ¶
type MapDeclExpr ¶
func (*MapDeclExpr) Position ¶
func (i *MapDeclExpr) Position() Position
type NewInstanceExpr ¶
type NewInstanceExpr struct { Name Expr Lparen Position Args []Expr Rparen Position Spread bool // if the last argument has a spread operator }
func (*NewInstanceExpr) Position ¶
func (i *NewInstanceExpr) Position() Position
type RegisterExpr ¶
RegisterExpr is just the index of a local register. Is for internal use only, when you need to pass directly the result of a compiled expression of any kind.
func (*RegisterExpr) Position ¶
func (i *RegisterExpr) Position() Position
type ReturnStmt ¶
func (*ReturnStmt) Position ¶
func (i *ReturnStmt) Position() Position
type SelectorExpr ¶
type SelectorExpr struct { X Expr // expression Sel *IdentExpr // field selector Optional bool // Optional chaining ?. First bool // if it is the first part of the expression }
func (*SelectorExpr) Position ¶
func (i *SelectorExpr) Position() Position
type SwitchStmt ¶
type SwitchStmt struct { Expression Expr Default *CaseBlock Blocks []*CaseBlock Pos Position // contains filtered or unexported fields }
func (*SwitchStmt) BreakPC ¶
func (i *SwitchStmt) BreakPC() int
func (*SwitchStmt) Label ¶
func (i *SwitchStmt) Label() string
func (*SwitchStmt) Position ¶
func (i *SwitchStmt) Position() Position
func (*SwitchStmt) SetBreakPC ¶
func (i *SwitchStmt) SetBreakPC(pc int)
func (*SwitchStmt) SetContinuePC ¶
func (i *SwitchStmt) SetContinuePC(pc int)
func (*SwitchStmt) SetLabel ¶
func (i *SwitchStmt) SetLabel(s string)
type TailCallStmt ¶
type TailCallStmt struct {
*CallExpr
}
type TernaryExpr ¶
func (*TernaryExpr) Position ¶
func (i *TernaryExpr) Position() Position
type TryStmt ¶
type TryStmt struct { Body *BlockStmt CatchIdent *VarDeclStmt Catch *BlockStmt Finally *BlockStmt Pos Position }
type Type ¶
type Type byte
const ( ERROR Type = iota EOF COMMENT MULTILINE_COMMENT ATTRIBUTE // Identifiers and basic type literals // (these tokens stand for classes of literals) IDENT // main INT // 12345 HEX // 0xFF FLOAT // 123.45 RUNE // 'a' STRING // "abc" // Operators and delimiters ADD // + SUB // - MUL // * DIV // / MOD // % AND // & BOR // | binary or XOR // ^ LSH // << left shift RSH // >> right shift BNT // ~ bitwise not QUESTION // ? ADD_ASSIGN // += SUB_ASSIGN // -= MUL_ASSIGN // *= DIV_ASSIGN // /= XOR_ASSIGN // ^= BOR_ASSIGN // |= MOD_ASSIGN // %= LAND // && LOR // || NOR // ?? INC // ++ DEC // -- EXP // ** EQL // == SEQ // === NEQ // != SNE // !== LSS // < GTR // > ASSIGN // = NOT // ! LEQ // <= GEQ // >= LPAREN // ( LBRACK // [ LBRACE // { COMMA // , PERIOD // . RPAREN // ) RBRACK // ] RBRACE // } SEMICOLON // ; COLON // : LAMBDA // => // Keywords BREAK CONTINUE IF ELSE FOR WHILE RETURN IMPORT SWITCH CASE DEFAULT LET VAR CONST FUNCTION ENUM NULL UNDEFINED INTERFACE EXPORT DECLARE NEW CLASS TRUE FALSE TRY CATCH FINALLY THROW TYPEOF DELETE )
type TypeofExpr ¶
type TypeofExpr struct {
Expr Expr
}
func (*TypeofExpr) Position ¶
func (i *TypeofExpr) Position() Position
type VarDeclStmt ¶
func (*VarDeclStmt) Position ¶
func (i *VarDeclStmt) Position() Position
type WhileStmt ¶
type WhileStmt struct { Expression Expr Body *BlockStmt Pos Position // contains filtered or unexported fields }
func (*WhileStmt) ContinuePC ¶
func (*WhileStmt) SetBreakPC ¶
func (*WhileStmt) SetContinuePC ¶
Click to show internal directories.
Click to hide internal directories.