syside.Compiler
- class Compiler(max_steps: int = 100000)
Initialization
- property max_steps: int
Maximum number of steps an expression evaluation may take. When this is reached, evaluation stops with an error. Actual steps are an implementation detail.
- evaluate(expr: syside.Expression, stdlib: syside.Stdlib | None = None, scope: syside.Type | None = None) tuple[syside.Value | None, syside.CompilationReport]
Evaluate expression. Note that custom functions and expressions, and most except a few standard library functions are not evaluatable. Constructor expressions evaluate as themselves because the constructor expressions conform to the constructed object implicitly. This primarily evaluates operator, metadata access, and feature reference expressions. If provided,
stdlib
is used to accelerate some common evaluations, e.g. checking forself
expressions.
- evaluate_feature(feature: syside.Feature, scope: syside.Type, stdlib: syside.Stdlib | None = None) tuple[syside.Value | None, syside.CompilationReport]
Evaluate
feature
inscope
, taking into account redefinitions. Iffeature
is anExpression
, this effectively performsevaluate
.