Documentation
¶
Overview ¶
Package ast provides language-specific AST parsing for context-aware compression.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Function ¶
type Function struct {
Name string
Receiver string // for methods
Params []Param
Returns []string
Line int
EndLine int
Doc string
IsExported bool
BodySize int // lines of code
}
Function represents a function or method.
type Language ¶
type Language int
Language represents a supported programming language.
func DetectLanguage ¶
DetectLanguage detects the language from file extension.
type ParseResult ¶
type ParseResult struct {
Language Language
FilePath string
Package string
Imports []Import
Types []TypeDef
Functions []Function
Variables []Variable
Constants []Constant
Comments []Comment
RawAST interface{} // language-specific AST
}
ParseResult contains the parsed AST and extracted information.
func (*ParseResult) GetOutline ¶
func (r *ParseResult) GetOutline() string
GetOutline returns a simplified outline of the file.
func (*ParseResult) GetSymbols ¶
func (r *ParseResult) GetSymbols() []Symbol
GetSymbols returns all symbols for code folding.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses source code into AST.
type Symbol ¶
type Symbol struct {
Name string
Kind string
Line int
EndLine int
Type string
Value string
Receiver string
Detail string
}
Symbol represents a code symbol.
Click to show internal directories.
Click to hide internal directories.