Module foxbox_thinkerbell::compile
[−]
[src]
Compiling an AST into something runnable. A script compiler
This compiler take untrusted code (Script<UncheckedCtx>
) and
performs the following transformations and checks:
- Ensure that the
Script
has at least oneRule
. - Ensure that each
Rule
has at least oneMatch
. - Ensure that each
Rule
has at least oneStatement
. - Ensure that each
Match
has at least onesource
. - Ensure that each
Statement
has at least onedestination
. - Ensure that in each
Match
, the type ofrange
matches thekind
. - Ensure that in each
Statement
, the type ofvalue
matches thekind
. - Transform each
Match
to make sure that the kind of thesource
matches thekind
, even if devices change. - Transform each
Statement
to make sure that the kind of thedestination
matches thekind
, even if devices change.
Structs
CompiledCtx | |
Compiler |
Enums
Error | |
SourceError | |
TypeError |
Traits
ExecutableDevEnv |
The environment in which the code is meant to be executed. This can typically be instantiated either with actual bindings to devices, or with a unit-testing framework. // FIXME: Move this to run.rs |