astutil

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectNodesInTrueBranches

func CollectNodesInTrueBranches(node parser.Node, typ []parser.NodeType, vars map[string]interface{}, p *parser.Parser) []parser.Node

the minimal unit of the target nodes is expr

func GetName

func GetName(node parser.Node) string

func GetNodeNames added in v0.0.11

func GetNodeNames(node parser.Node) []string

func GetParent

func GetParent(ctx *walk.VisitorCtx, targetTyp, barrierTyp []parser.NodeType) (parser.Node, *walk.VisitorCtx)

func GetStaticPropertyName

func GetStaticPropertyName(node parser.Node) string

func GetVarDec added in v0.0.13

func GetVarDec(name string, varDecStmt *parser.VarDecStmt) *parser.VarDec

func IdOfLocalInImportDec added in v0.0.13

func IdOfLocalInImportDec(local string, n *parser.ImportDec) string

func IsFn added in v0.0.13

func IsFn(node parser.Node) bool

func IsFnDepsOnNode added in v0.0.13

func IsFnDepsOnNode(graph *FnDepGraph, fn parser.Node, target parser.Node) bool

func IsIdentBoundInImportDec added in v0.0.13

func IsIdentBoundInImportDec(ident *parser.Ident, scope *parser.Scope) *parser.ImportDec

func IsNodeContains

func IsNodeContains(parent, sub parser.Node) bool

func IsPlainArr added in v0.0.11

func IsPlainArr(node parser.Node) bool

func IsPlainObj added in v0.0.11

func IsPlainObj(node parser.Node) bool

func IsPlainObjLit added in v0.0.11

func IsPlainObjLit(node parser.Node) bool

func IsPrimitive added in v0.0.11

func IsPrimitive(node parser.Node) bool

func NamesInDecNode added in v0.0.11

func NamesInDecNode(node parser.Node) (ret []string, all bool)

func SelectTrueBranches

func SelectTrueBranches(node parser.Node, vars map[string]interface{}, p *parser.Parser) []parser.Node

Types

type FnDepGraph added in v0.0.13

type FnDepGraph struct {
	Nodes map[parser.Node]*FnDepNode
}

func BuildFnDepGraph added in v0.0.13

func BuildFnDepGraph(node parser.Node, symtab *parser.SymTab) *FnDepGraph

type FnDepNode added in v0.0.13

type FnDepNode struct {
	// the ast node defines this dep node
	Dec parser.Node

	// the refs captured by this fn
	Captures []*parser.Ref

	// the fns which this fn depends on
	Deps []*FnDepNode
}

type SwitchBranch

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

func BinExprToSwitchBranch

func BinExprToSwitchBranch(node *parser.BinExpr) []*SwitchBranch

func CondExprToSwitchBranches

func CondExprToSwitchBranches(node *parser.CondExpr) []*SwitchBranch

func IfStmtToSwitchBranches

func IfStmtToSwitchBranches(node *parser.IfStmt) []*SwitchBranch

func NodeToSwitchBranches

func NodeToSwitchBranches(node parser.Node) []*SwitchBranch

Jump to

Keyboard shortcuts

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