Documentation
¶
Overview ¶
Package luau provides debug functionality for Lua scripts.
Package luau provides filter definitions in TOML format.
Package luau provides a stub implementation when Lua is not available. Set build tag 'lua' to enable full Lua support with gopher-lua.
Index ¶
- func FormatDebugOutput(info *DebugInfo) string
- type DebugError
- type DebugInfo
- type Debugger
- type FilterAPI
- type FilterDef
- type FilterRegistry
- func (r *FilterRegistry) Apply(name string, content string) (string, error)
- func (r *FilterRegistry) ApplyAll(content string) (string, error)
- func (r *FilterRegistry) Get(name string) (*FilterDef, bool)
- func (r *FilterRegistry) List() []string
- func (r *FilterRegistry) LoadFromDir(dir string) ([]*FilterDef, error)
- func (r *FilterRegistry) LoadFromFile(path string) (*FilterDef, error)
- type Hotspot
- type Pool
- type ProfileResult
- type Sandbox
- type VM
- type ValidationIssue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDebugOutput ¶
FormatDebugOutput formats debug info for display.
Types ¶
type DebugError ¶
DebugError represents a debug error.
type DebugInfo ¶
type DebugInfo struct {
Script string
Input string
Output string
ExecutionTime time.Duration
MemoryUsed int
Instructions int
Errors []DebugError
LineNumbers map[int]int // line -> execution count
}
DebugInfo contains debugging information.
type Debugger ¶
type Debugger struct {
// contains filtered or unexported fields
}
Debugger provides debugging capabilities.
func (*Debugger) ClearBreakpoint ¶
ClearBreakpoint clears a breakpoint.
func (*Debugger) SetBreakpoint ¶
SetBreakpoint sets a breakpoint at a line.
type FilterAPI ¶
type FilterAPI struct {
// contains filtered or unexported fields
}
FilterAPI provides functions callable from filters.
type FilterDef ¶
type FilterDef struct {
Name string `toml:"name"`
Description string `toml:"description"`
Version string `toml:"version"`
Author string `toml:"author"`
Script string `toml:"script"`
ScriptFile string `toml:"script_file"`
EntryPoint string `toml:"entry_point"`
Config map[string]interface{} `toml:"config"`
Enabled bool `toml:"enabled"`
Priority int `toml:"priority"`
Tags []string `toml:"tags"`
}
FilterDef represents a filter definition from TOML.
type FilterRegistry ¶
type FilterRegistry struct {
// contains filtered or unexported fields
}
FilterRegistry manages loaded filters.
func NewFilterRegistry ¶
func NewFilterRegistry(vmPool *Pool) *FilterRegistry
NewFilterRegistry creates a new filter registry.
func (*FilterRegistry) Apply ¶
func (r *FilterRegistry) Apply(name string, content string) (string, error)
Apply applies a filter to content.
func (*FilterRegistry) ApplyAll ¶
func (r *FilterRegistry) ApplyAll(content string) (string, error)
ApplyAll applies all enabled filters in priority order.
func (*FilterRegistry) Get ¶
func (r *FilterRegistry) Get(name string) (*FilterDef, bool)
Get gets a filter by name.
func (*FilterRegistry) List ¶
func (r *FilterRegistry) List() []string
List returns all filter names.
func (*FilterRegistry) LoadFromDir ¶
func (r *FilterRegistry) LoadFromDir(dir string) ([]*FilterDef, error)
LoadFromDir loads all filters from a directory.
func (*FilterRegistry) LoadFromFile ¶
func (r *FilterRegistry) LoadFromFile(path string) (*FilterDef, error)
LoadFromFile loads a filter from a TOML file.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool provides a pool of reusable VMs.
type ProfileResult ¶
type ProfileResult struct {
TotalTime time.Duration
AvgTime time.Duration
Calls int
MemoryPeak int
Hotspots []Hotspot
}
ProfileResult contains profiling results.
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
VM provides a Lua-like virtual machine (stub implementation).
func (*VM) ExecuteFilter ¶
ExecuteFilter runs a filter script on content (stub - uses Go regex).
func (*VM) LoadFilter ¶
LoadFilter loads a filter from a string.
type ValidationIssue ¶
ValidationIssue represents a validation issue.
func ValidateScript ¶
func ValidateScript(script string) []ValidationIssue
ValidateScript checks a script for common issues.