Documentation
¶
Overview ¶
Package script implements lightweight regex-based parsers for scripting languages: Ruby, Bash/Shell, Lua, Perl, and R. No tree-sitter dependency — pure Go regex extraction.
Index ¶
- type Dependency
- type Entity
- type ParseResult
- func ParseBash(filePath string, content string) *ParseResult
- func ParseDockerfile(filePath string, content string) *ParseResult
- func ParseLua(filePath string, content string) *ParseResult
- func ParsePerl(filePath string, content string) *ParseResult
- func ParseR(filePath string, content string) *ParseResult
- func ParseRuby(filePath string, content string) *ParseResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct {
Path string
Type string // "require", "include", "source", "use", "library"
LineNumber int
}
Dependency represents a require/include/source statement.
type Entity ¶
type Entity struct {
Name string
Type string // "function", "method", "class", "module"
Kind string
Signature string
StartLine int
EndLine int
Parent string
}
Entity represents a named code element.
type ParseResult ¶
type ParseResult struct {
FilePath string
Entities []*Entity
Dependencies []*Dependency
}
ParseResult is the output of a script parse.
func ParseBash ¶
func ParseBash(filePath string, content string) *ParseResult
ParseBash extracts function definitions and source/. includes.
func ParseDockerfile ¶
func ParseDockerfile(filePath string, content string) *ParseResult
ParseDockerfile extracts stages, ARG/ENV declarations, and base image references.
func ParseLua ¶
func ParseLua(filePath string, content string) *ParseResult
ParseLua extracts function definitions and require calls.
func ParsePerl ¶
func ParsePerl(filePath string, content string) *ParseResult
ParsePerl extracts sub definitions, packages, and use/require statements.
func ParseR ¶
func ParseR(filePath string, content string) *ParseResult
ParseR extracts function assignments and library/source calls.
func ParseRuby ¶
func ParseRuby(filePath string, content string) *ParseResult
ParseRuby extracts classes, modules, methods, and require statements.