Struct rat_in_a_tube::Compiler
source · pub struct Compiler { /* private fields */ }
Expand description
Compiler instance.
Implementations
sourceimpl Compiler
impl Compiler
pub fn digest_tokens(&mut self) -> Result<CompiledScriptData, CompileError>
sourceimpl Compiler
impl Compiler
sourcepub fn new(target: CompileTarget) -> Compiler
pub fn new(target: CompileTarget) -> Compiler
Instantiate a new compiler instance with the given compile target.
sourcepub fn read_script_data(
&mut self,
filename: &str,
script: &[u8]
) -> Result<(), CompileError>
pub fn read_script_data(
&mut self,
filename: &str,
script: &[u8]
) -> Result<(), CompileError>
Read the tokens from a u8 slice containing string data.
Errors
Errors if the script contains data that could not be decoded, if non-parenthesis tokens exist outside of a block, or if any parenthesis are unmatched.
sourcepub fn compile_script_data(
&mut self
) -> Result<CompiledScriptData, CompileError>
pub fn compile_script_data(
&mut self
) -> Result<CompiledScriptData, CompileError>
Parse all loaded tokens and then clear the tokens if successful.
Errors
Errors if the script data is invalid.
Auto Trait Implementations
impl RefUnwindSafe for Compiler
impl Send for Compiler
impl Sync for Compiler
impl Unpin for Compiler
impl UnwindSafe for Compiler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more