nodes

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CST

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

Represents a Concreate Syntax Tree (CST) of a *single* source file We will use TreeSitter as the only supported parser. However, we can have language specific wrappers over TreeSitter CST to make it easy for high level modules to operate

func NewCST

func NewCST(tree *sitter.Tree, lang *sitter.Language, code []byte) *CST

func (*CST) Close

func (n *CST) Close()

func (*CST) Code

func (n *CST) Code() []byte

func (*CST) Root

func (n *CST) Root() *sitter.Node

func (*CST) SubTree

func (n *CST) SubTree(node *sitter.Node) (*CST, error)

type CSTFunctionCallNode

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

func NewCSTFunctionCallNode

func NewCSTFunctionCallNode(cst *CST) *CSTFunctionCallNode

func (CSTFunctionCallNode) CallNode

func (n CSTFunctionCallNode) CallNode() *sitter.Node

func (CSTFunctionCallNode) Callee

func (n CSTFunctionCallNode) Callee() string

func (CSTFunctionCallNode) Receiver

func (n CSTFunctionCallNode) Receiver() string

func (CSTFunctionCallNode) ReceiverNode

func (n CSTFunctionCallNode) ReceiverNode() *sitter.Node

func (*CSTFunctionCallNode) WithArgs

func (n *CSTFunctionCallNode) WithArgs(args *sitter.Node) *CSTFunctionCallNode

func (*CSTFunctionCallNode) WithCall

func (n *CSTFunctionCallNode) WithCall(call *sitter.Node) *CSTFunctionCallNode

func (*CSTFunctionCallNode) WithCallee

func (n *CSTFunctionCallNode) WithCallee(callee *sitter.Node) *CSTFunctionCallNode

func (*CSTFunctionCallNode) WithCaller

Should we mutate the receiver or make a copy?

func (*CSTFunctionCallNode) WithReceiver

func (n *CSTFunctionCallNode) WithReceiver(receiver *sitter.Node) *CSTFunctionCallNode

type CSTFunctionNode

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

func NewCSTFunctionNode

func NewCSTFunctionNode(cst *CST) *CSTFunctionNode

func (CSTFunctionNode) Container

func (n CSTFunctionNode) Container() string

func (*CSTFunctionNode) ContainerNode

func (n *CSTFunctionNode) ContainerNode() *sitter.Node

func (*CSTFunctionNode) Declaration

func (n *CSTFunctionNode) Declaration() *sitter.Node

func (CSTFunctionNode) Id

func (n CSTFunctionNode) Id() string

Human readable Id for use in graph query

func (CSTFunctionNode) Name

func (n CSTFunctionNode) Name() string

func (*CSTFunctionNode) NameNode

func (n *CSTFunctionNode) NameNode() *sitter.Node

func (*CSTFunctionNode) WithArgs

func (n *CSTFunctionNode) WithArgs(args *sitter.Node) *CSTFunctionNode

func (*CSTFunctionNode) WithBody

func (n *CSTFunctionNode) WithBody(body *sitter.Node) *CSTFunctionNode

func (*CSTFunctionNode) WithContainer

func (n *CSTFunctionNode) WithContainer(container *sitter.Node) *CSTFunctionNode

func (*CSTFunctionNode) WithDeclaration

func (n *CSTFunctionNode) WithDeclaration(declaration *sitter.Node) *CSTFunctionNode

func (*CSTFunctionNode) WithName

func (n *CSTFunctionNode) WithName(name *sitter.Node) *CSTFunctionNode

type CSTImportNode

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

func NewCSTImportNode

func NewCSTImportNode(cst *CST) *CSTImportNode

func (CSTImportNode) ImportAlias

func (n CSTImportNode) ImportAlias() string

func (CSTImportNode) ImportItem

func (n CSTImportNode) ImportItem() string

func (CSTImportNode) ImportName

func (n CSTImportNode) ImportName() string

func (*CSTImportNode) WithModuleAlias

func (n *CSTImportNode) WithModuleAlias(moduleAlias *sitter.Node) *CSTImportNode

func (*CSTImportNode) WithModuleItem

func (n *CSTImportNode) WithModuleItem(moduleItem *sitter.Node) *CSTImportNode

func (*CSTImportNode) WithModuleName

func (n *CSTImportNode) WithModuleName(moduleName *sitter.Node) *CSTImportNode

Jump to

Keyboard shortcuts

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