executor

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ScriptHelpText = `` /* 5625-byte string literal not displayed */

Variables

This section is empty.

Functions

func Eval

func Eval(line string, ctx *script.ScriptContext) error

Evaluate a single line with provided context

func EvalBatch

func EvalBatch(r io.Reader, ctx *script.ScriptContext) error

Evaluate from input source line by line, passing each result to callback provided

func NewScriptContext

func NewScriptContext(
	getSession func() *session.Session,
	resetSession func() error,
	st *store.Store,
	writer io.Writer,
) (script.ScriptContext, context.CancelFunc)

Types

type Instruction

type Instruction struct {
	Text   string
	LineNo int
	Type   string
}

We strip out comments and blanks, so track original line# for debugging

type Jump

type Jump struct {
	TargetOnFalse int // If -> elif; elif -> else; while -> endwhile
	TargetOnEnd   int // If/elif/else -> endif; endwhile -> while; break -> endwhile; continue -> while
}

Keeps track of where the Program Counter (PC) should move next. PC is just the index of the slice of instructions. On true, we always execute the next immediate line.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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