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 JavaParser ¶
type JavaParser struct{}
JavaParser parses Java source files using regex.
func (*JavaParser) CanParse ¶
func (j *JavaParser) CanParse(filename string) bool
CanParse returns true for .java files.
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 PythonParser ¶
type PythonParser struct{}
PythonParser parses Python source files using regex.
func (*PythonParser) CanParse ¶
func (p *PythonParser) CanParse(filename string) bool
CanParse returns true for .py files.
type RustParser ¶
type RustParser struct{}
RustParser parses Rust source files using regex.
func (*RustParser) CanParse ¶
func (r *RustParser) CanParse(filename string) bool
CanParse returns true for .rs files.
type TypeScriptParser ¶
type TypeScriptParser struct{}
TypeScriptParser parses TypeScript and JavaScript files using regex.
func (*TypeScriptParser) CanParse ¶
func (t *TypeScriptParser) CanParse(filename string) bool
CanParse returns true for .ts, .tsx, .js, .jsx, .mjs, .cjs files.