pub struct Compiler { /* private fields */ }Expand description
Compiles an AST into bytecode.
Implementations§
Source§impl Compiler
impl Compiler
pub fn new() -> Self
Sourcepub fn compile(self, program: &[SNode]) -> Result<Chunk, CompileError>
pub fn compile(self, program: &[SNode]) -> Result<Chunk, CompileError>
Compile a program (list of top-level nodes) into a Chunk. Finds the entry pipeline and compiles its body, including inherited bodies.
Sourcepub fn compile_named(
self,
program: &[SNode],
pipeline_name: &str,
) -> Result<Chunk, CompileError>
pub fn compile_named( self, program: &[SNode], pipeline_name: &str, ) -> Result<Chunk, CompileError>
Compile a specific named pipeline (for test runners).
Source§impl Compiler
impl Compiler
Sourcepub fn compile_fn_body(
&mut self,
params: &[TypedParam],
body: &[SNode],
) -> Result<CompiledFunction, CompileError>
pub fn compile_fn_body( &mut self, params: &[TypedParam], body: &[SNode], ) -> Result<CompiledFunction, CompileError>
Compile a function body into a CompiledFunction (for import support).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Compiler
impl RefUnwindSafe for Compiler
impl Send for Compiler
impl Sync for Compiler
impl Unpin for Compiler
impl UnsafeUnpin for Compiler
impl UnwindSafe for Compiler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more