pub struct Compiler { /* private fields */ }Implementations§
source§impl Compiler
impl Compiler
sourcepub fn create() -> Result<Self, CompileError>
pub fn create() -> Result<Self, CompileError>
Creates a new Compiler.
§Panics
May Panics if OOM
§Errors CompileError::CreationFailed
This function will return an error if inner instructions creation have failed
sourcepub fn bytecode(self) -> Result<Bytecode, CompileError>
pub fn bytecode(self) -> Result<Bytecode, CompileError>
Generate bytecode as compile result
§Errors CompileError::NotFinishedInMain
This function will return an error if scope_idx is not 0 ( it means that compiling had not ended in main )
sourcepub fn compile(&mut self, src: Program) -> Result<bool, CompileError>
pub fn compile(&mut self, src: Program) -> Result<bool, CompileError>
compile given src: Program
§Errors CompileError
This function will return an error if inner function failed.
if have successfully compiled, returns Ok(True)
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 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