compiler

package
v0.87.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCalls

func ValidateCalls(exprs []core.Expr, registry *stdlib.Registry) error

ValidateCalls walks the AST and checks that every function call refers to a function that exists in the registry. This is a lightweight static check - argument types are validated at runtime

The walk also prepares nodes in place, so it must run before the program is evaluated: regex literals are compiled, timestamp literals are parsed, and constant sub-expressions are folded into core.ConstExpr (see fold.go).

Types

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

Compiler builds an AST from a slice of tokens.

func NewCompiler

func NewCompiler(source string) (*Compiler, error)

func (*Compiler) Compile

func (c *Compiler) Compile() ([]core.Expr, error)

Jump to

Keyboard shortcuts

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