pub struct Context {
pub scope_level: usize,
pub variables: HashMap<usize, Vec<Variable>>,
pub functions: HashMap<String, Function>,
pub optimization_level: u8,
}Fields§
§scope_level: usize§variables: HashMap<usize, Vec<Variable>>§functions: HashMap<String, Function>Function definitions
optimization_level: u8Implementations§
Source§impl Context
impl Context
pub fn new(optimization_level: u8) -> Self
pub fn push_scope(&mut self)
pub fn pop_scope(&mut self)
pub fn add_variable(&mut self, statement: Statement)
pub fn get_variable(&self, name: String) -> Option<&Variable>
pub fn add_function(&mut self, function: &Function) -> Result<(), String>
pub fn get_function(&self, name: &str) -> Option<Function>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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