-
Notifications
You must be signed in to change notification settings - Fork 0
API Host CompileBlockOptions
Liu.Yandong.Hanks edited this page Aug 21, 2026
·
3 revisions
Options for compiling a lightweight script block.
Namespace: AuroraScript. Kind: class.
Back to .NET Host API Reference
CompileBlockOptions defines the positional parameter names of a block and the virtual source name used in diagnostics.
Important
A block accepts a statement body only; it cannot contain @module, @global(), import, include, export, or declare.
A minimal use of CompileBlockOptions.
using var block = engine.CompileBlock("return left + right;", new CompileBlockOptions
{
Parameters = ["left", "right"],
SourceName = "rules/sum.as"
});IReadOnlyList<string> ParametersNames of positional arguments exposed as local variables.
Parameters
None.
Returns
Returns IReadOnlyList<string>.
Behavior
Names cannot be empty, duplicate, or use global, $args, or $state.
var options = new CompileBlockOptions { Parameters = ["left", "right"] };string SourceNameVirtual source name used in diagnostics.
Parameters
None.
Returns
Returns string.
var options = new CompileBlockOptions { SourceName = "rules/discount.as" };AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License