parser

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindChildByType

func FindChildByType(node *sitter.Node, typeString string) *sitter.Node

func FindChildIdentifier

func FindChildIdentifier(node *sitter.Node) *sitter.Node

func GetLanguage

func GetLanguage(l uniast.Language) *sitter.Language

func GetModuleMap

func GetModuleMap(root *ModuleInfo) map[string]string

func GetModulePaths

func GetModulePaths(root *ModuleInfo) []string

func GetModuleStructMap

func GetModuleStructMap(root *ModuleInfo) map[string]*ModuleInfo

func NewParser

func NewParser() *sitter.Parser

func Parse

func Parse(ctx context.Context, content []byte) (*sitter.Tree, error)

func PrintProjectTree

func PrintProjectTree(module *ModuleInfo, indent string)

PrintProjectTree prints the project structure in a hierarchical format.

func Utf8ToUtf16Position

func Utf8ToUtf16Position(content []byte, row, byteColumn uint32) (line, character int)

Types

type DebugNode

type DebugNode struct {
	Type     string       `json:"type"`
	Content  string       `json:"content"`
	Start    sitter.Point `json:"start"`
	End      sitter.Point `json:"end"`
	Children []*DebugNode `json:"children"`
}

func NewDebugTree

func NewDebugTree(ctx context.Context, content []byte) (*DebugNode, error)

NewDebugTree parses the source code and builds a Go-native debug tree. This function is designed to be used in testing and debugging scenarios.

type ModuleInfo

type ModuleInfo struct {
	ArtifactID     string
	GroupID        string
	Version        string
	Coordinates    string
	Path           string
	SourcePath     string
	TestSourcePath string
	TargetPath     string
	SubModules     []*ModuleInfo
	Properties     map[string]string
}

ModuleInfo stores information about a Maven module.

func ParseMavenProject

func ParseMavenProject(pomPath string) (*ModuleInfo, error)

ParseMavenProject recursively parses a module and its submodules. pomPath: The path to the pom.xml file to parse.

Jump to

Keyboard shortcuts

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