-- import "github.com/dop251/goja/ast"
Package ast declares types representing a JavaScript AST.
The parser and AST interfaces are still works-in-progress (particularly where node types are concerned) and may change in the future.
type ArrayLiteral struct {
LeftBracket file.Idx
RightBracket file.Idx
Value []Expression
}
func (self *ArrayLiteral) Idx0() file.Idx
func (self *ArrayLiteral) Idx1() file.Idx
type AssignExpression struct {
Operator token.Token
Left Expression
Right Expression
}
func (self *AssignExpression) Idx0() file.Idx
func (self *AssignExpression) Idx1() file.Idx
type BadExpression struct {
From file.Idx
To file.Idx
}
func (self *BadExpression) Idx0() file.Idx
func (self *BadExpression) Idx1() file.Idx
type BadStatement struct {
From file.Idx
To file.Idx
}
func (self *BadStatement) Idx0() file.Idx
func (self *BadStatement) Idx1() file.Idx
type BinaryExpression struct {
Operator token.Token
Left Expression
Right Expression
Comparison bool
}
func (self *BinaryExpression) Idx0() file.Idx
func (self *BinaryExpression) Idx1() file.Idx
type BlockStatement struct {
LeftBrace file.Idx
List []Statement
RightBrace file.Idx
}
func (self *BlockStatement) Idx0() file.Idx
func (self *BlockStatement) Idx1() file.Idx
type BooleanLiteral struct {
Idx file.Idx
Literal string
Value bool
}
func (self *BooleanLiteral) Idx0() file.Idx
func (self *BooleanLiteral) Idx1() file.Idx
type BracketExpression struct {
Left Expression
Member Expression
LeftBracket file.Idx
RightBracket file.Idx
}
func (self *BracketExpression) Idx0() file.Idx
func (self *BracketExpression) Idx1() file.Idx
type BranchStatement struct {
Idx file.Idx
Token token.Token
Label *Identifier
}
func (self *BranchStatement) Idx0() file.Idx
func (self *BranchStatement) Idx1() file.Idx
type CallExpression struct {
Callee Expression
LeftParenthesis file.Idx
ArgumentList []Expression
RightParenthesis file.Idx
}
func (self *CallExpression) Idx0() file.Idx
func (self *CallExpression) Idx1() file.Idx
type CaseStatement struct {
Case file.Idx
Test Expression
Consequent []Statement
}
func (self *CaseStatement) Idx0() file.Idx
func (self *CaseStatement) Idx1() file.Idx
type CatchStatement struct {
Catch file.Idx
Parameter *Identifier
Body Statement
}
func (self *CatchStatement) Idx0() file.Idx
func (self *CatchStatement) Idx1() file.Idx
type ConditionalExpression struct {
Test Expression
Consequent Expression
Alternate Expression
}
func (self *ConditionalExpression) Idx0() file.Idx
func (self *ConditionalExpression) Idx1() file.Idx
type DebuggerStatement struct {
Debugger file.Idx
}
func (self *DebuggerStatement) Idx0() file.Idx
func (self *DebuggerStatement) Idx1() file.Idx
type Declaration interface {
// contains filtered or unexported methods
}
All declaration nodes implement the Declaration interface.
type DoWhileStatement struct {
Do file.Idx
Test Expression
Body Statement
}
func (self *DoWhileStatement) Idx0() file.Idx
func (self *DoWhileStatement) Idx1() file.Idx
type DotExpression struct {
Left Expression
Identifier Identifier
}
func (self *DotExpression) Idx0() file.Idx
func (self *DotExpression) Idx1() file.Idx
type EmptyStatement struct {
Semicolon file.Idx
}
func (self *EmptyStatement) Idx0() file.Idx
func (self *EmptyStatement) Idx1() file.Idx
type Expression interface {
Node
// contains filtered or unexported methods
}
All expression nodes implement the Expression interface.
type ExpressionStatement struct {
Expression Expression
}
func (self *ExpressionStatement) Idx0() file.Idx
func (self *ExpressionStatement) Idx1() file.Idx
type ForInStatement struct {
For file.Idx
Into Expression
Source Expression
Body Statement
}
func (self *ForInStatement) Idx0() file.Idx
func (self *ForInStatement) Idx1() file.Idx
type ForStatement struct {
For file.Idx
Initializer Expression
Update Expression
Test Expression
Body Statement
}
func (self *ForStatement) Idx0() file.Idx
func (self *ForStatement) Idx1() file.Idx
type FunctionDeclaration struct {
Function *FunctionLiteral
}
type FunctionLiteral struct {
Function file.Idx
Name *Identifier
ParameterList *ParameterList
Body Statement
Source string
DeclarationList []Declaration
}
func (self *FunctionLiteral) Idx0() file.Idx
func (self *FunctionLiteral) Idx1() file.Idx
type Identifier struct {
Name string
Idx file.Idx
}
func (self *Identifier) Idx0() file.Idx
func (self *Identifier) Idx1() file.Idx
type IfStatement struct {
If file.Idx
Test Expression
Consequent Statement
Alternate Statement
}
func (self *IfStatement) Idx0() file.Idx
func (self *IfStatement) Idx1() file.Idx
type LabelledStatement struct {
Label *Identifier
Colon file.Idx
Statement Statement
}
func (self *LabelledStatement) Idx0() file.Idx
func (self *LabelledStatement) Idx1() file.Idx
type NewExpression struct {
New file.Idx
Callee Expression
LeftParenthesis file.Idx
ArgumentList []Expression
RightParenthesis file.Idx
}
func (self *NewExpression) Idx0() file.Idx
func (self *NewExpression) Idx1() file.Idx
type Node interface {
Idx0() file.Idx // The index of the first character belonging to the node
Idx1() file.Idx // The index of the first character immediately after the node
}
All nodes implement the Node interface.
type NullLiteral struct {
Idx file.Idx
Literal string
}
func (self *NullLiteral) Idx0() file.Idx
func (self *NullLiteral) Idx1() file.Idx
type NumberLiteral struct {
Idx file.Idx
Literal string
Value interface{}
}
func (self *NumberLiteral) Idx0() file.Idx
func (self *NumberLiteral) Idx1() file.Idx
type ObjectLiteral struct {
LeftBrace file.Idx
RightBrace file.Idx
Value []Property
}
func (self *ObjectLiteral) Idx0() file.Idx
func (self *ObjectLiteral) Idx1() file.Idx
type ParameterList struct {
Opening file.Idx
List []*Identifier
Closing file.Idx
}
type Program struct {
Body []Statement
DeclarationList []Declaration
File *file.File
}
func (self *Program) Idx0() file.Idx
func (self *Program) Idx1() file.Idx
type Property struct {
Key string
Kind string
Value Expression
}
type RegExpLiteral struct {
Idx file.Idx
Literal string
Pattern string
Flags string
Value string
}
func (self *RegExpLiteral) Idx0() file.Idx
func (self *RegExpLiteral) Idx1() file.Idx
type ReturnStatement struct {
Return file.Idx
Argument Expression
}
func (self *ReturnStatement) Idx0() file.Idx
func (self *ReturnStatement) Idx1() file.Idx
type SequenceExpression struct {
Sequence []Expression
}
func (self *SequenceExpression) Idx0() file.Idx
func (self *SequenceExpression) Idx1() file.Idx
type Statement interface {
Node
// contains filtered or unexported methods
}
All statement nodes implement the Statement interface.
type StringLiteral struct {
Idx file.Idx
Literal string
Value string
}
func (self *StringLiteral) Idx0() file.Idx
func (self *StringLiteral) Idx1() file.Idx
type SwitchStatement struct {
Switch file.Idx
Discriminant Expression
Default int
Body []*CaseStatement
}
func (self *SwitchStatement) Idx0() file.Idx
func (self *SwitchStatement) Idx1() file.Idx
type ThisExpression struct {
Idx file.Idx
}
func (self *ThisExpression) Idx0() file.Idx
func (self *ThisExpression) Idx1() file.Idx
type ThrowStatement struct {
Throw file.Idx
Argument Expression
}
func (self *ThrowStatement) Idx0() file.Idx
func (self *ThrowStatement) Idx1() file.Idx
type TryStatement struct {
Try file.Idx
Body Statement
Catch *CatchStatement
Finally Statement
}
func (self *TryStatement) Idx0() file.Idx
func (self *TryStatement) Idx1() file.Idx
type UnaryExpression struct {
Operator token.Token
Idx file.Idx // If a prefix operation
Operand Expression
Postfix bool
}
func (self *UnaryExpression) Idx0() file.Idx
func (self *UnaryExpression) Idx1() file.Idx
type VariableDeclaration struct {
Var file.Idx
List []*VariableExpression
}
type VariableExpression struct {
Name string
Idx file.Idx
Initializer Expression
}
func (self *VariableExpression) Idx0() file.Idx
func (self *VariableExpression) Idx1() file.Idx
type VariableStatement struct {
Var file.Idx
List []Expression
}
func (self *VariableStatement) Idx0() file.Idx
func (self *VariableStatement) Idx1() file.Idx
type WhileStatement struct {
While file.Idx
Test Expression
Body Statement
}
func (self *WhileStatement) Idx0() file.Idx
func (self *WhileStatement) Idx1() file.Idx
type WithStatement struct {
With file.Idx
Object Expression
Body Statement
}
func (self *WithStatement) Idx0() file.Idx
func (self *WithStatement) Idx1() file.Idx
-- godocdown http://github.com/robertkrimen/godocdown