ast

package
v0.0.0-...-41221c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

https://github.com/estree/estree

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnonymousDefaultExportedClassDeclaration

type AnonymousDefaultExportedClassDeclaration struct {
	SuperClass Expression
	Body       *ClassBody
}

type AnonymousDefaultExportedFunctionDeclaration

type AnonymousDefaultExportedFunctionDeclaration struct {
	Params    []Pattern
	Body      *BlockStatement
	Generator bool
}

type ArrayExpression

type ArrayExpression struct {
	Elements []ArrayExpressionElement
}

type ArrayExpressionElement

type ArrayExpressionElement interface {
	VisitArrayExpressionElement(ArrayExpressionElementVisitor)
}

type ArrayExpressionElementVisitor

type ArrayExpressionElementVisitor struct {
	Expression    func(Expression)
	SpreadElement func(*SpreadElement)
}

type ArrayPattern

type ArrayPattern struct {
	Elements []Pattern
}

type ArrowFunctionExpression

type ArrowFunctionExpression struct {
	Body       ArrowFunctionExpressionBody
	Expression bool
}

type ArrowFunctionExpressionBody

type ArrowFunctionExpressionBody interface {
	VisitArrowFunctionExpressionBody(ArrowFunctionExpressionBodyVisitor)
}

type ArrowFunctionExpressionBodyVisitor

type ArrowFunctionExpressionBodyVisitor struct {
	BlockStatement func(*BlockStatement)
	Expression     func(Expression)
}

type AssignmentExpression

type AssignmentExpression struct {
	Operator string
	Left     Pattern
	Right    Expression
}

func (*AssignmentExpression) VisitExpression

func (e *AssignmentExpression) VisitExpression(v ExpressionVisitor)

type AssignmentPattern

type AssignmentPattern struct {
	Left  Pattern
	Right Expression
}

type AssignmentProperty

type AssignmentProperty struct {
	Key       Expression
	Value     Pattern
	Shorthand bool
	Computed  bool
}

type AwaitExpression

type AwaitExpression struct {
	Argument Expression
}

type BinaryExpression

type BinaryExpression struct {
	Operator string
	Left     Expression
	Right    Expression
}

func (*BinaryExpression) VisitExpression

func (e *BinaryExpression) VisitExpression(v ExpressionVisitor)

type BlockStatement

type BlockStatement struct {
	Body []Statement
}

func (*BlockStatement) VisitProgramBody

func (p *BlockStatement) VisitProgramBody(v ProgramBodyVisitor)

func (*BlockStatement) VisitStatement

func (s *BlockStatement) VisitStatement(v StatementVisitor)

type BooleanLiteral

type BooleanLiteral struct {
	Value bool
}

func (*BooleanLiteral) VisitExpression

func (e *BooleanLiteral) VisitExpression(v ExpressionVisitor)

func (*BooleanLiteral) VisitLiteral

func (l *BooleanLiteral) VisitLiteral(v LiteralVisitor)

type BreakStatement

type BreakStatement struct {
	Label *Identifier
}

type CallExpression

type CallExpression struct {
	Callee    CallExpressionCallee
	Arguments []CallExpressionArgument
}

type CallExpressionArgument

type CallExpressionArgument interface {
	VisitCallExpressionArgument(CallExpressionArgumentVisitor)
}

type CallExpressionArgumentVisitor

type CallExpressionArgumentVisitor struct {
	Expression    func(Expression)
	SpreadElement func(*SpreadElement)
}

type CallExpressionCallee

type CallExpressionCallee interface {
	VisitCallExpressionCallee(CallExpressionCalleeVisitor)
}

type CallExpressionCalleeVisitor

type CallExpressionCalleeVisitor struct {
	Expression func(Expression)
	Super      func(*Super)
}

type CatchClause

type CatchClause struct {
	Param Pattern
	Body  *BlockStatement
}

type Class

type Class struct {
	ID         *Identifier
	SuperClass Expression
	Body       ClassBody
}

type ClassBody

type ClassBody struct {
	Body []*MethodDefinition
}

type ClassDeclaration

type ClassDeclaration struct {
	ID         *Identifier
	SuperClass Expression
	Body       *ClassBody
}

type ClassExpression

type ClassExpression struct {
	ID         *Identifier
	SuperClass Expression
	Body       *ClassBody
}

type ConditionalExpression

type ConditionalExpression struct {
	Test       Expression
	Alternate  Expression
	Consequent Expression
}

func (*ConditionalExpression) VisitExpression

func (e *ConditionalExpression) VisitExpression(v ExpressionVisitor)

type ContinueStatement

type ContinueStatement struct {
	Label *Identifier
}

type DebuggerStatement

type DebuggerStatement struct{}

type Declaration

type Declaration interface {
	Statement
	VisitDeclaration(DeclarationVisitor)
}

type DeclarationVisitor

type DeclarationVisitor struct {
	FunctionDeclaration func(*FunctionDeclaration)
	VariableDeclaration func(*VariableDeclaration)
	ClassDeclaration    func(*ClassDeclaration)
}

type DoWhileStatement

type DoWhileStatement struct {
	Test Expression
	Body Statement
}

type EmptyStatement

type EmptyStatement struct{}

type ExportAllDeclaration

type ExportAllDeclaration struct {
	Source Literal
}

type ExportDefaultDeclaration

type ExportDefaultDeclaration struct {
	Declaration ExportDefaultDeclarationDeclaration
}

type ExportDefaultDeclarationDeclaration

type ExportDefaultDeclarationDeclaration interface {
	VisitExportDefaultDeclarationDeclaration(ExportDefaultDeclarationDeclarationVisitor)
}

type ExportDefaultDeclarationDeclarationVisitor

type ExportDefaultDeclarationDeclarationVisitor struct {
	AnonymousDefaultExportedFunctionDeclaration func(*AnonymousDefaultExportedFunctionDeclaration)
	FunctionDeclaration                         func(*FunctionDeclaration)
	AnonymousDefaultExportedClassDeclaration    func(*AnonymousDefaultExportedClassDeclaration)
	ClassDeclaration                            func(*ClassDeclaration)
	Expression                                  func(Expression)
}

type ExportNamedDeclaration

type ExportNamedDeclaration struct {
	Declaration Declaration
	Specifiers  []*ExportSpecifier
	Source      *StringLiteral
}

type ExportSpecifier

type ExportSpecifier struct {
	Local    *Identifier
	Exported *Identifier
}

type Expression

type Expression interface {
	VisitExpression(ExpressionVisitor)
}

type ExpressionStatement

type ExpressionStatement struct {
	Expression Expression
}

func (*ExpressionStatement) VisitProgramBody

func (p *ExpressionStatement) VisitProgramBody(v ProgramBodyVisitor)

func (*ExpressionStatement) VisitStatement

func (s *ExpressionStatement) VisitStatement(v StatementVisitor)

type ExpressionVisitor

type ExpressionVisitor struct {
	Identifier               func(*Identifier)
	Literal                  func(Literal)
	ThisExpression           func(*ThisExpression)
	ArrayExpression          func(*ArrayExpression)
	ObjectExpression         func(*ObjectExpression)
	FunctionExpression       func(*FunctionExpression)
	UnaryExpression          func(*UnaryExpression)
	UpdateExpression         func(*UpdateExpression)
	BinaryExpression         func(*BinaryExpression)
	AssignmentExpression     func(*AssignmentExpression)
	LogicalExpression        func(*LogicalExpression)
	ConditionalExpression    func(*ConditionalExpression)
	CallExpression           func(*CallExpression)
	NewExpression            func(*NewExpression)
	SequenceExpression       func(*SequenceExpression)
	ArrowFunctionExpression  func(*ArrowFunctionExpression)
	YieldExpression          func(*YieldExpression)
	AwaitExpression          func(*AwaitExpression)
	TemplateLiteral          func(*TemplateLiteral)
	TaggedTemplateExpression func(*TaggedTemplateExpression)
	ClassExpression          func(*ClassExpression)
}

type ForInStatement

type ForInStatement struct {
	Left  ForInStatementLeft
	Right Expression
	Body  Statement
}

type ForInStatementLeft

type ForInStatementLeft interface {
	VisitForInStatementLeft(ForInStatementLeftVisitor)
}

type ForInStatementLeftVisitor

type ForInStatementLeftVisitor struct {
	VariableDeclaration func(*VariableDeclaration)
	Pattern             func(Pattern)
}

type ForOfStatement

type ForOfStatement struct {
	Left  ForOfStatementLeft
	Right Expression
	Body  Statement
	Await bool
}

type ForOfStatementLeft

type ForOfStatementLeft interface {
	VisitForOfStatementLeft(ForOfStatementLeftVisitor)
}

type ForOfStatementLeftVisitor

type ForOfStatementLeftVisitor struct {
	VariableDeclaration func(*VariableDeclaration)
	Pattern             func(Pattern)
}

type ForStatement

type ForStatement struct {
	Init   ForStatementInit
	Test   Expression
	Update Expression
	Body   Statement
}

type ForStatementInit

type ForStatementInit interface {
	VisitForStatementInit(ForStatementInitVisitor)
}

type ForStatementInitVisitor

type ForStatementInitVisitor struct {
	VariableDeclaration func(*VariableDeclaration)
	Expression          func(Expression)
}

type FunctionDeclaration

type FunctionDeclaration struct {
	ID        *Identifier
	Params    []Pattern
	Body      *BlockStatement
	Generator bool
	Async     bool
}

type FunctionExpression

type FunctionExpression struct {
	ID        *Identifier
	Params    []Pattern
	Body      *BlockStatement
	Generator bool
	Async     bool
}

type Identifier

type Identifier struct {
	Name string
}

func (*Identifier) VisitExpression

func (e *Identifier) VisitExpression(v ExpressionVisitor)

func (*Identifier) VisitPattern

func (p *Identifier) VisitPattern(v PatternVisitor)

type IfStatement

type IfStatement struct {
	Test       Expression
	Consequent Statement
	Alternate  Statement
}

type ImportDeclaration

type ImportDeclaration struct {
	Specifiers []ImportDeclarationSpecifier
	Source     *StringLiteral
}

func (*ImportDeclaration) VisitModuleDeclaration

func (m *ImportDeclaration) VisitModuleDeclaration(v ModuleDeclarationVisitor)

func (*ImportDeclaration) VisitProgramBody

func (p *ImportDeclaration) VisitProgramBody(v ProgramBodyVisitor)

type ImportDeclarationSpecifier

type ImportDeclarationSpecifier interface {
	VisitImportDeclarationSpecifier(ImportDeclarationSpecifierVisitor)
}

type ImportDeclarationSpecifierVisitor

type ImportDeclarationSpecifierVisitor struct {
	ImportSpecifier          func(*ImportSpecifier)
	ImportDefaultSpecifier   func(*ImportDefaultSpecifier)
	ImportNamespaceSpecifier func(*ImportNamespaceSpecifier)
}

type ImportDefaultSpecifier

type ImportDefaultSpecifier struct {
	Local *Identifier
}

func (*ImportDefaultSpecifier) VisitImportDeclarationSpecifier

func (i *ImportDefaultSpecifier) VisitImportDeclarationSpecifier(v ImportDeclarationSpecifierVisitor)

type ImportNamespaceSpecifier

type ImportNamespaceSpecifier struct {
	Local *Identifier
}

func (*ImportNamespaceSpecifier) VisitImportDeclarationSpecifier

func (i *ImportNamespaceSpecifier) VisitImportDeclarationSpecifier(v ImportDeclarationSpecifierVisitor)

type ImportSpecifier

type ImportSpecifier struct {
	Local    *Identifier
	Imported *Identifier
}

func (*ImportSpecifier) VisitImportDeclarationSpecifier

func (i *ImportSpecifier) VisitImportDeclarationSpecifier(v ImportDeclarationSpecifierVisitor)

type LabeledStatement

type LabeledStatement struct {
	Label *Identifier
	Body  Statement
}

type Literal

type Literal interface {
	Expression
	VisitLiteral(LiteralVisitor)
}

type LiteralVisitor

type LiteralVisitor struct {
	StringLiteral  func(*StringLiteral)
	BooleanLiteral func(*BooleanLiteral)
	NullLiteral    func(*NullLiteral)
	NumberLiteral  func(*NumberLiteral)
	RegExpLiteral  func(*RegExpLiteral)
}

type LogicalExpression

type LogicalExpression struct {
	Operator string
	Left     Expression
	Right    Expression
}

func (*LogicalExpression) VisitExpression

func (e *LogicalExpression) VisitExpression(v ExpressionVisitor)

type MemberExpression

type MemberExpression struct {
	Object   MemberExpressionObject
	Property Expression
	Computed bool
}

func (*MemberExpression) VisitPattern

func (p *MemberExpression) VisitPattern(v PatternVisitor)

type MemberExpressionObject

type MemberExpressionObject interface {
	VisitMemberExpressionObject(MemberExpressionObjectVisitor)
}

type MemberExpressionObjectVisitor

type MemberExpressionObjectVisitor struct {
	Expression func(Expression)
	Super      func(*Super)
}

type MetaProperty

type MetaProperty struct {
	Meta     *Identifier
	Property *Identifier
}

type MethodDefinition

type MethodDefinition struct {
	Key      Expression
	Value    *FunctionExpression
	Kind     string
	Computed bool
	Static   bool
}

type ModuleDeclaration

type ModuleDeclaration interface {
	ProgramBody
	VisitModuleDeclaration(ModuleDeclarationVisitor)
}

type ModuleDeclarationVisitor

type ModuleDeclarationVisitor struct {
	ImportDeclaration        func(*ImportDeclaration)
	ExportNamedDeclaration   func(*ExportNamedDeclaration)
	ExportDefaultDeclaration func(*ExportDefaultDeclaration)
	ExportAllDeclaration     func(*ExportAllDeclaration)
}

type NewExpression

type NewExpression struct {
	Callee    Expression
	Arguments []NewExpressionArgument
}

type NewExpressionArgument

type NewExpressionArgument interface {
	VisitNewExpressionArgument(NewExpressionArgumentVisitor)
}

type NewExpressionArgumentVisitor

type NewExpressionArgumentVisitor struct {
	Expression    func(Expression)
	SpreadElement func(*SpreadElement)
}

type NullLiteral

type NullLiteral struct{}

func (*NullLiteral) VisitExpression

func (e *NullLiteral) VisitExpression(v ExpressionVisitor)

func (*NullLiteral) VisitLiteral

func (l *NullLiteral) VisitLiteral(v LiteralVisitor)

type NumberLiteral

type NumberLiteral struct {
	Value float64
}

func (*NumberLiteral) VisitExpression

func (e *NumberLiteral) VisitExpression(v ExpressionVisitor)

func (*NumberLiteral) VisitLiteral

func (l *NumberLiteral) VisitLiteral(v LiteralVisitor)

type ObjectExpression

type ObjectExpression struct {
	Properties []ObjectExpressionProperty
}

type ObjectExpressionProperty

type ObjectExpressionProperty interface {
	VisitObjectExpressionProperty(ObjectExpressionPropertyVisitor)
}

type ObjectExpressionPropertyVisitor

type ObjectExpressionPropertyVisitor struct {
	Property      func(*Property)
	SpreadElement func(*SpreadElement)
}

type ObjectPattern

type ObjectPattern struct {
	Properties []ObjectPatternProperty
}

type ObjectPatternProperty

type ObjectPatternProperty interface {
	VisitObjectPatternProperty(ObjectPatternPropertyVisitor)
}

type ObjectPatternPropertyVisitor

type ObjectPatternPropertyVisitor struct {
	AssignmentProperty func(*AssignmentProperty)
	RestElement        func(*RestElement)
}

type Pattern

type Pattern interface {
	VisitPattern(PatternVisitor)
}

type PatternVisitor

type PatternVisitor struct {
	Identifier       func(*Identifier)
	MemberExpression func(*MemberExpression)
}

type Program

type Program struct {
	SourceType SourceType
	Body       []ProgramBody
}

type ProgramBody

type ProgramBody interface {
	VisitProgramBody(ProgramBodyVisitor)
}

type ProgramBodyVisitor

type ProgramBodyVisitor struct {
	Statement         func(Statement)
	ModuleDeclaration func(ModuleDeclaration)
}

type Property

type Property struct {
	Key       Expression
	Value     Expression
	Kind      string
	Method    bool
	Shorthand bool
	Computed  bool
}

type RegExpLiteral

type RegExpLiteral struct {
	Regex struct {
		Pattern string
		Flags   string
	}
}

func (*RegExpLiteral) VisitExpression

func (e *RegExpLiteral) VisitExpression(v ExpressionVisitor)

func (*RegExpLiteral) VisitLiteral

func (l *RegExpLiteral) VisitLiteral(v LiteralVisitor)

type RestElement

type RestElement struct {
	Argument Pattern
}

type ReturnStatement

type ReturnStatement struct {
	Argument Expression
}

type SequenceExpression

type SequenceExpression struct {
	Expression []Expression
}

func (*SequenceExpression) VisitExpression

func (e *SequenceExpression) VisitExpression(v ExpressionVisitor)

type SourceType

type SourceType string
const (
	Script SourceType = "script"
	Module SourceType = "module"
)

type SpreadElement

type SpreadElement struct {
	Argument Expression
}

type Statement

type Statement interface {
	ProgramBody
	VisitStatement(StatementVisitor)
}

type StatementVisitor

type StatementVisitor struct {
	Declaration         func(Declaration)
	ExpressionStatement func(*ExpressionStatement)
	BlockStatement      func(*BlockStatement)
	EmptyStatement      func(*EmptyStatement)
	DebuggerStatement   func(*DebuggerStatement)
	WithStatement       func(*WithStatement)
	ReturnStatement     func(*ReturnStatement)
	LabeledStatement    func(*LabeledStatement)
	BreakStatement      func(*BreakStatement)
	ContinueStatement   func(*ContinueStatement)
	IfStatement         func(*IfStatement)
	SwitchStatement     func(*SwitchStatement)
	ThrowStatement      func(*ThrowStatement)
	TryStatement        func(*TryStatement)
	WhileStatement      func(*WhileStatement)
	DoWhileStatement    func(*DoWhileStatement)
	ForStatement        func(*ForStatement)
	ForInStatement      func(*ForInStatement)
	ForOfStatement      func(*ForOfStatement)
}

type StringLiteral

type StringLiteral struct {
	Value string
}

func (*StringLiteral) VisitExpression

func (e *StringLiteral) VisitExpression(v ExpressionVisitor)

func (*StringLiteral) VisitLiteral

func (l *StringLiteral) VisitLiteral(v LiteralVisitor)

type Super

type Super struct{}

type SwitchCase

type SwitchCase struct {
	Test       Expression
	Consequent []Statement
}

type SwitchStatement

type SwitchStatement struct {
	Discriminant Expression
	Cases        []*SwitchCase
}

type TaggedTemplateExpression

type TaggedTemplateExpression struct {
	Tag   Expression
	Quasi TemplateLiteral
}

type TemplateElement

type TemplateElement struct {
	Tail  bool
	Value struct {
		Cooked *string
		Raw    string
	}
}

type TemplateLiteral

type TemplateLiteral struct {
	Quasis      []*TemplateElement
	Expressions []Expression
}

type ThisExpression

type ThisExpression struct{}

type ThrowStatement

type ThrowStatement struct {
	Argument Expression
}

type TryStatement

type TryStatement struct {
	Block     *BlockStatement
	Handler   *CatchClause
	Finalizer *BlockStatement
}

type UnaryExpression

type UnaryExpression struct {
	Operator string
	Prefix   bool
	Argument Expression
}

func (*UnaryExpression) VisitExpression

func (e *UnaryExpression) VisitExpression(v ExpressionVisitor)

type UpdateExpression

type UpdateExpression struct {
	Operator string
	Prefix   bool
	Argument Expression
}

func (*UpdateExpression) VisitExpression

func (e *UpdateExpression) VisitExpression(v ExpressionVisitor)

type VariableDeclaration

type VariableDeclaration struct {
	Kind         string
	Declarations []*VariableDeclarator
}

type VariableDeclarator

type VariableDeclarator struct {
	ID   Pattern
	Init Expression
}

type WhileStatement

type WhileStatement struct {
	Test Expression
	Body Statement
}

type WithStatement

type WithStatement struct {
	Object Expression
	Body   Statement
}

type YieldExpression

type YieldExpression struct {
	Argument Expression
	Delegate bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL