ast

package
v0.0.0-...-312e67f Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content *[]byte

TreeSitter requires the content to be available to get the symbols from the source code for a given node

func ToContent

func ToContent(data []byte) Content

type FunctionDeclarationNode

type FunctionDeclarationNode struct {
	Node

	// Name of the function
	FunctionNameNode *sitter.Node

	// Function parameters
	FunctionParameterNodes []*sitter.Node

	// Function return type
	FunctionReturnTypeNode *sitter.Node

	// Function body
	FunctionBodyNode *sitter.Node
}

TODO: Does this makes sense?

type ImportNode

type ImportNode struct {
	Node
	// contains filtered or unexported fields
}

ImportNode represents an import statement in a source file This is a language agnostic representation of an import statement. Not all attributes may be present in all languages

func NewImportNode

func NewImportNode(content Content) *ImportNode

NewImportNode creates a new ImportNode instance using the import statement node from the tree-sitter parser

func (*ImportNode) GetModuleAliasNode

func (i *ImportNode) GetModuleAliasNode() *sitter.Node

func (*ImportNode) GetModuleItemNode

func (i *ImportNode) GetModuleItemNode() *sitter.Node

func (*ImportNode) GetModuleNameNode

func (i *ImportNode) GetModuleNameNode() *sitter.Node

func (*ImportNode) IsWildcardImport

func (i *ImportNode) IsWildcardImport() bool

func (*ImportNode) ModuleAlias

func (i *ImportNode) ModuleAlias() string

func (*ImportNode) ModuleItem

func (i *ImportNode) ModuleItem() string

func (*ImportNode) ModuleName

func (i *ImportNode) ModuleName() string

func (*ImportNode) SetIsWildcardImport

func (i *ImportNode) SetIsWildcardImport(isWildcardImport bool)

func (*ImportNode) SetModuleAliasNode

func (i *ImportNode) SetModuleAliasNode(node *sitter.Node)

func (*ImportNode) SetModuleItemNode

func (i *ImportNode) SetModuleItemNode(node *sitter.Node)

func (*ImportNode) SetModuleNameNode

func (i *ImportNode) SetModuleNameNode(node *sitter.Node)

func (*ImportNode) String

func (i *ImportNode) String() string

type Node

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

Jump to

Keyboard shortcuts

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