-- 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.Idxfunc (self *ArrayLiteral) Idx1() file.Idxtype AssignExpression struct {
Operator token.Token
Left Expression
Right Expression
}func (self *AssignExpression) Idx0() file.Idxfunc (self *AssignExpression) Idx1() file.Idxtype BadExpression struct {
From file.Idx
To file.Idx
}func (self *BadExpression) Idx0() file.Idxfunc (self *BadExpression) Idx1() file.Idxtype BadStatement struct {
From file.Idx
To file.Idx
}func (self *BadStatement) Idx0() file.Idxfunc (self *BadStatement) Idx1() file.Idxtype BinaryExpression struct {
Operator token.Token
Left Expression
Right Expression
Comparison bool
}func (self *BinaryExpression) Idx0() file.Idxfunc (self *BinaryExpression) Idx1() file.Idxtype BlockStatement struct {
LeftBrace file.Idx
List []Statement
RightBrace file.Idx
}func (self *BlockStatement) Idx0() file.Idxfunc (self *BlockStatement) Idx1() file.Idxtype BooleanLiteral struct {
Idx file.Idx
Literal string
Value bool
}func (self *BooleanLiteral) Idx0() file.Idxfunc (self *BooleanLiteral) Idx1() file.Idxtype BracketExpression struct {
Left Expression
Member Expression
LeftBracket file.Idx
RightBracket file.Idx
}func (self *BracketExpression) Idx0() file.Idxfunc (self *BracketExpression) Idx1() file.Idxtype BranchStatement struct {
Idx file.Idx
Token token.Token
Label *Identifier
}func (self *BranchStatement) Idx0() file.Idxfunc (self *BranchStatement) Idx1() file.Idxtype CallExpression struct {
Callee Expression
LeftParenthesis file.Idx
ArgumentList []Expression
RightParenthesis file.Idx
}func (self *CallExpression) Idx0() file.Idxfunc (self *CallExpression) Idx1() file.Idxtype CaseStatement struct {
Case file.Idx
Test Expression
Consequent []Statement
}func (self *CaseStatement) Idx0() file.Idxfunc (self *CaseStatement) Idx1() file.Idxtype CatchStatement struct {
Catch file.Idx
Parameter *Identifier
Body Statement
}func (self *CatchStatement) Idx0() file.Idxfunc (self *CatchStatement) Idx1() file.Idxtype ConditionalExpression struct {
Test Expression
Consequent Expression
Alternate Expression
}func (self *ConditionalExpression) Idx0() file.Idxfunc (self *ConditionalExpression) Idx1() file.Idxtype DebuggerStatement struct {
Debugger file.Idx
}func (self *DebuggerStatement) Idx0() file.Idxfunc (self *DebuggerStatement) Idx1() file.Idxtype 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.Idxfunc (self *DoWhileStatement) Idx1() file.Idxtype DotExpression struct {
Left Expression
Identifier Identifier
}func (self *DotExpression) Idx0() file.Idxfunc (self *DotExpression) Idx1() file.Idxtype EmptyStatement struct {
Semicolon file.Idx
}func (self *EmptyStatement) Idx0() file.Idxfunc (self *EmptyStatement) Idx1() file.Idxtype 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.Idxfunc (self *ExpressionStatement) Idx1() file.Idxtype ForInStatement struct {
For file.Idx
Into Expression
Source Expression
Body Statement
}func (self *ForInStatement) Idx0() file.Idxfunc (self *ForInStatement) Idx1() file.Idxtype ForStatement struct {
For file.Idx
Initializer Expression
Update Expression
Test Expression
Body Statement
}func (self *ForStatement) Idx0() file.Idxfunc (self *ForStatement) Idx1() file.Idxtype 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.Idxfunc (self *FunctionLiteral) Idx1() file.Idxtype Identifier struct {
Name string
Idx file.Idx
}func (self *Identifier) Idx0() file.Idxfunc (self *Identifier) Idx1() file.Idxtype IfStatement struct {
If file.Idx
Test Expression
Consequent Statement
Alternate Statement
}func (self *IfStatement) Idx0() file.Idxfunc (self *IfStatement) Idx1() file.Idxtype LabelledStatement struct {
Label *Identifier
Colon file.Idx
Statement Statement
}func (self *LabelledStatement) Idx0() file.Idxfunc (self *LabelledStatement) Idx1() file.Idxtype NewExpression struct {
New file.Idx
Callee Expression
LeftParenthesis file.Idx
ArgumentList []Expression
RightParenthesis file.Idx
}func (self *NewExpression) Idx0() file.Idxfunc (self *NewExpression) Idx1() file.Idxtype 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.Idxfunc (self *NullLiteral) Idx1() file.Idxtype NumberLiteral struct {
Idx file.Idx
Literal string
Value interface{}
}func (self *NumberLiteral) Idx0() file.Idxfunc (self *NumberLiteral) Idx1() file.Idxtype ObjectLiteral struct {
LeftBrace file.Idx
RightBrace file.Idx
Value []Property
}func (self *ObjectLiteral) Idx0() file.Idxfunc (self *ObjectLiteral) Idx1() file.Idxtype 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.Idxfunc (self *Program) Idx1() file.Idxtype 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.Idxfunc (self *RegExpLiteral) Idx1() file.Idxtype ReturnStatement struct {
Return file.Idx
Argument Expression
}func (self *ReturnStatement) Idx0() file.Idxfunc (self *ReturnStatement) Idx1() file.Idxtype SequenceExpression struct {
Sequence []Expression
}func (self *SequenceExpression) Idx0() file.Idxfunc (self *SequenceExpression) Idx1() file.Idxtype 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.Idxfunc (self *StringLiteral) Idx1() file.Idxtype SwitchStatement struct {
Switch file.Idx
Discriminant Expression
Default int
Body []*CaseStatement
}func (self *SwitchStatement) Idx0() file.Idxfunc (self *SwitchStatement) Idx1() file.Idxtype ThisExpression struct {
Idx file.Idx
}func (self *ThisExpression) Idx0() file.Idxfunc (self *ThisExpression) Idx1() file.Idxtype ThrowStatement struct {
Throw file.Idx
Argument Expression
}func (self *ThrowStatement) Idx0() file.Idxfunc (self *ThrowStatement) Idx1() file.Idxtype TryStatement struct {
Try file.Idx
Body Statement
Catch *CatchStatement
Finally Statement
}func (self *TryStatement) Idx0() file.Idxfunc (self *TryStatement) Idx1() file.Idxtype UnaryExpression struct {
Operator token.Token
Idx file.Idx // If a prefix operation
Operand Expression
Postfix bool
}func (self *UnaryExpression) Idx0() file.Idxfunc (self *UnaryExpression) Idx1() file.Idxtype VariableDeclaration struct {
Var file.Idx
List []*VariableExpression
}type VariableExpression struct {
Name string
Idx file.Idx
Initializer Expression
}func (self *VariableExpression) Idx0() file.Idxfunc (self *VariableExpression) Idx1() file.Idxtype VariableStatement struct {
Var file.Idx
List []Expression
}func (self *VariableStatement) Idx0() file.Idxfunc (self *VariableStatement) Idx1() file.Idxtype WhileStatement struct {
While file.Idx
Test Expression
Body Statement
}func (self *WhileStatement) Idx0() file.Idxfunc (self *WhileStatement) Idx1() file.Idxtype WithStatement struct {
With file.Idx
Object Expression
Body Statement
}func (self *WithStatement) Idx0() file.Idxfunc (self *WithStatement) Idx1() file.Idx-- godocdown http://github.com/robertkrimen/godocdown