Documentation
¶
Overview ¶
Package expr compiles a statically checked subset of the Expr language to a compact, allocation-free bytecode evaluator. The checked Go+ AST lives in package typed; this package is its ordinary-Go parsing and erasure boundary.
Index ¶
- func Eval(input string, environment any, options ...Option) (any, error)
- func ParseTyped(input string, environment Environment) (typed.SomeExpr, error)
- func Run(program *Program, environment any) (any, error)
- func RunBool(program *Program, environment Environment) (bool, error)
- func RunInt(program *Program, environment Environment) (int, error)
- func RunString(program *Program, environment Environment) (string, error)
- type CompileError
- type Environment
- type Kind
- type Option
- type Program
- type RuntimeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTyped ¶
func ParseTyped(input string, environment Environment) (typed.SomeExpr, error)
ParseTyped parses at the existential boundary and returns one of the finite checked result families. Exhaustive matching on typed.SomeExpr recovers T.
func RunBool ¶
func RunBool(program *Program, environment Environment) (bool, error)
RunBool evaluates a boolean program without boxing its result.
Types ¶
type CompileError ¶
type CompileError struct{ Cause error }
CompileError is a parse, elaboration, option, or static type failure.
func (*CompileError) Error ¶
func (e *CompileError) Error() string
func (*CompileError) Unwrap ¶
func (e *CompileError) Unwrap() error
type Environment ¶
Environment is the typed, no-reflection execution boundary.
type Kind ¶
type Kind uint8
Kind is the finite result-type universe supported by the checked engine.
type Option ¶
type Option func(*config) error
Option configures compilation. It mirrors the high-value part of Expr's option model while keeping unsupported dynamic features explicit.
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is immutable and safe for concurrent evaluation.
type RuntimeError ¶
type RuntimeError struct{ Cause error }
RuntimeError is an environment or evaluation failure after compilation.
func (*RuntimeError) Error ¶
func (e *RuntimeError) Error() string
func (*RuntimeError) Unwrap ¶
func (e *RuntimeError) Unwrap() error
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
cmd/apimanifest
command
Command apimanifest inventories the exported API of the pinned Expr tree.
|
Command apimanifest inventories the exported API of the pinned Expr tree. |
|
Package typed is the no-any checked core for expression programs.
|
Package typed is the no-any checked core for expression programs. |