resolver

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnresolvedMark ast.ScopeContext = 0
	TopLevelMark   ast.ScopeContext = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeclKind

type DeclKind int
const (
	DeclKindVar DeclKind = iota
	DeclKindFunction
)

type Hoister

type Hoister struct {
	ast.NoopVisitor
	// contains filtered or unexported fields
}

func NewHoister

func NewHoister(resolver *Resolver) *Hoister

func (*Hoister) VisitArrowFunctionLiteral

func (h *Hoister) VisitArrowFunctionLiteral(n *ast.ArrowFunctionLiteral)

func (*Hoister) VisitBindingTarget

func (h *Hoister) VisitBindingTarget(n *ast.BindingTarget)

func (*Hoister) VisitBlockStatement

func (h *Hoister) VisitBlockStatement(n *ast.BlockStatement)

func (*Hoister) VisitCatchStatement

func (h *Hoister) VisitCatchStatement(n *ast.CatchStatement)

func (*Hoister) VisitExpression

func (h *Hoister) VisitExpression(n *ast.Expression)

func (*Hoister) VisitFunctionDeclaration

func (h *Hoister) VisitFunctionDeclaration(n *ast.FunctionDeclaration)

func (*Hoister) VisitFunctionLiteral

func (h *Hoister) VisitFunctionLiteral(n *ast.FunctionLiteral)

func (*Hoister) VisitStatements

func (h *Hoister) VisitStatements(n *ast.Statements)

func (*Hoister) VisitSwitchStatement

func (h *Hoister) VisitSwitchStatement(n *ast.SwitchStatement)

func (*Hoister) VisitVariableDeclaration

func (h *Hoister) VisitVariableDeclaration(n *ast.VariableDeclaration)

type IdentType

type IdentType int
const (
	IdentTypeRef     IdentType = iota // Reference (read)
	IdentTypeBinding                  // Binding (declaration)
)

type Resolver

type Resolver struct {
	ast.NoopVisitor
	// contains filtered or unexported fields
}

func Resolve

func Resolve(p *ast.Program) *Resolver

func (*Resolver) VisitArrowFunctionLiteral

func (r *Resolver) VisitArrowFunctionLiteral(n *ast.ArrowFunctionLiteral)

func (*Resolver) VisitBlockStatement

func (r *Resolver) VisitBlockStatement(n *ast.BlockStatement)

func (*Resolver) VisitExpression

func (r *Resolver) VisitExpression(expr *ast.Expression)

func (*Resolver) VisitForOfStatement

func (r *Resolver) VisitForOfStatement(n *ast.ForOfStatement)

func (*Resolver) VisitForStatement

func (r *Resolver) VisitForStatement(n *ast.ForStatement)

func (*Resolver) VisitFunctionDeclaration

func (r *Resolver) VisitFunctionDeclaration(n *ast.FunctionDeclaration)

func (*Resolver) VisitFunctionLiteral

func (r *Resolver) VisitFunctionLiteral(n *ast.FunctionLiteral)

func (*Resolver) VisitIdentifier

func (r *Resolver) VisitIdentifier(n *ast.Identifier)

func (*Resolver) VisitProgram

func (r *Resolver) VisitProgram(n *ast.Program)

func (*Resolver) VisitStatements

func (r *Resolver) VisitStatements(n *ast.Statements)

func (*Resolver) VisitVariableDeclaration

func (r *Resolver) VisitVariableDeclaration(n *ast.VariableDeclaration)

type Scope

type Scope struct {
	// contains filtered or unexported fields
}

type ScopeKind

type ScopeKind int
const (
	ScopeKindBlock ScopeKind = iota
	ScopeKindFunction
)

Jump to

Keyboard shortcuts

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