parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package parser extracts code structure from source files. Uses go/ast for Go files and regex-based extraction for Python and TypeScript.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Qualify

func Qualify(filePath, parent, name string) string

Qualify creates a qualified name for a code entity.

Types

type Language

type Language string

Language represents a supported programming language.

const (
	LangGo         Language = "go"
	LangPython     Language = "python"
	LangTypeScript Language = "typescript"
	LangJavaScript Language = "javascript"
	LangUnknown    Language = "unknown"
)

func DetectLanguage

func DetectLanguage(filePath string) Language

DetectLanguage determines the language from a file extension.

type ParseResult

type ParseResult struct {
	FilePath string
	Language Language
	Nodes    []graph.Node
	Edges    []graph.Edge
}

ParseResult holds the extracted nodes and edges from a file.

func ParseFile

func ParseFile(filePath string, source []byte) (*ParseResult, error)

ParseFile parses a source file and extracts code structure.

Jump to

Keyboard shortcuts

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