compile

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCompileFailed = errors.New("failed to compile risor script")
	ErrContentNil    = errors.New("risor content is nil")
)

Functions

func Compile

func Compile(scriptContent *string, options ...risorCompiler.Option) (*risorCompiler.Code, error)

Compile parses and compiles the script content into bytecode

func CompileWithGlobals

func CompileWithGlobals(scriptContent *string, globals []string) (*risorCompiler.Code, error)

CompileWithGlobals parses and compiles the script content into bytecode, with custom global names which are needed when parsing a script that will eventually have globals injected at eval time. For example, if a script uses a request or response object, it needs to be compiled with those global names, even though they won't be available until eval time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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