pub struct Compiler<'i> { /* private fields */ }Implementations§
Source§impl<'i> Compiler<'i>
impl<'i> Compiler<'i>
Sourcepub fn compile(
stmts: &[Stmt<'_>],
interner: &'i Interner,
) -> Result<CompiledProgram, String>
pub fn compile( stmts: &[Stmt<'_>], interner: &'i Interner, ) -> Result<CompiledProgram, String>
Compile a statement block to a runnable program.
Sourcepub fn compile_with_types(
stmts: &[Stmt<'_>],
interner: &'i Interner,
types: Option<&TypeRegistry>,
) -> Result<CompiledProgram, String>
pub fn compile_with_types( stmts: &[Stmt<'_>], interner: &'i Interner, types: Option<&TypeRegistry>, ) -> Result<CompiledProgram, String>
Compile with the discovery-pass type registry (struct definitions that
never appear as Stmt::StructDef).
Sourcepub fn compile_with_oracle(
stmts: &[Stmt<'_>],
interner: &'i Interner,
types: Option<&TypeRegistry>,
oracle: Option<OracleFacts>,
) -> Result<CompiledProgram, String>
pub fn compile_with_oracle( stmts: &[Stmt<'_>], interner: &'i Interner, types: Option<&TypeRegistry>, oracle: Option<OracleFacts>, ) -> Result<CompiledProgram, String>
Like compile_with_types, plus the Oracle’s range-analysis facts
(M9) for bounds-check elimination. The live run path computes these
on the exact (optimized) snapshot it then compiles, so an Index
proven in-bounds becomes IndexUnchecked. None ⇒ every index
stays checked (the codegen / test paths).
Sourcepub fn compile_for_debug(
stmts: &[Stmt<'_>],
interner: &'i Interner,
types: Option<&TypeRegistry>,
) -> Result<CompiledProgram, String>
pub fn compile_for_debug( stmts: &[Stmt<'_>], interner: &'i Interner, types: Option<&TypeRegistry>, ) -> Result<CompiledProgram, String>
Like compile_with_types but also captures source variable names into
CompiledProgram::reg_names for the Studio debugger. Used only by the
debugger’s compile path; production callers pay nothing for it.
Auto Trait Implementations§
impl<'i> Freeze for Compiler<'i>
impl<'i> RefUnwindSafe for Compiler<'i>
impl<'i> Send for Compiler<'i>
impl<'i> Sync for Compiler<'i>
impl<'i> Unpin for Compiler<'i>
impl<'i> UnsafeUnpin for Compiler<'i>
impl<'i> UnwindSafe for Compiler<'i>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.