Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
type FileInfo struct {
Path string `json:"path"`
Language string `json:"language"`
Imports []string `json:"imports,omitempty"`
Exports []string `json:"exports,omitempty"`
TypeDefs map[string]string `json:"type_defs,omitempty"` // type name -> brief definition
LineCount int `json:"line_count"`
IsEntrypoint bool `json:"is_entrypoint,omitempty"`
}
FileInfo holds the result of parsing a source file.
type GenericParser ¶
type GenericParser struct{}
GenericParser is a fallback parser that identifies languages by file extension but does not perform import/export analysis.
func (*GenericParser) CanParse ¶
func (g *GenericParser) CanParse(_ string) bool
CanParse always returns true — the generic parser handles any file.
type GoParser ¶
type GoParser struct{}
GoParser parses Go source files using the stdlib go/parser + go/ast.
type Parser ¶
type Parser interface {
CanParse(filename string) bool
Parse(path string, content []byte) (*FileInfo, error)
}
Parser extracts structured information from a source file.
type TreeSitterParser ¶ added in v0.2.0
type TreeSitterParser struct{}
TreeSitterParser uses tree-sitter ASTs to extract structured info from source files. Handles all languages that have tree-sitter grammars, except Go (which uses stdlib AST).
func (*TreeSitterParser) CanParse ¶ added in v0.2.0
func (p *TreeSitterParser) CanParse(filename string) bool
Click to show internal directories.
Click to hide internal directories.