script

package
v0.0.4-beta.15 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

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