Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileProgram ¶
CompileProgram parses src and lowers it into an ir.Program. The accepted language is intentionally small; unsupported constructs return friendly errors rather than attempting partial lowering.
func CompileProgramWithOptions ¶
func CompileProgramWithOptions(src string, opts CompileOptions) (*ir.Program, error)
CompileProgramWithOptions parses src and lowers it into an ir.Program with the specified compilation options.
func FormatErrors ¶
FormatErrors joins multiple errors when tests want deterministic output.
Types ¶
type CompileOptions ¶
type CompileOptions struct {
// GOARCH is the target architecture ("amd64" or "arm64").
// Used to resolve runtime.GOARCH comparisons at compile time.
GOARCH string
// Flags holds compile-time flags for conditional compilation.
// Used with runtime.Ifdef("flag") to include/exclude code at compile time.
// Undefined flags are treated as false.
Flags map[string]bool
// Config holds compile-time configuration values.
// Used with runtime.Config("key") to inject values at compile time.
// Supported types: string, int64, []string
Config map[string]any
}
CompileOptions specifies options for RTG compilation.
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler holds the state for a single source-to-IR lowering.
Click to show internal directories.
Click to hide internal directories.