[−][src]Struct wlambda::compiler::CompileEnv
Compile time environment for allocating and storing variables inside a function scope.
Also handles upvalues. Upvalues in WLambda are copied to every scope that they are passed through until they are needed.
Fields
global: GlobalEnvRef
Reference to the global environment
implicit_arity: (ArityParam, ArityParam)
Stores the implicitly calculated arity of this function.
explicit_arity: (ArityParam, ArityParam)
Stores the explicitly defined arity of this function.
recent_var: String
Recently accessed variable name:
recent_sym: String
Recently compiled symbol:
quote_func: bool
If set, the next compile() is compiling a function as block.
Implementations
impl CompileEnv
[src]
pub fn new(g: GlobalEnvRef) -> Rc<RefCell<Self>>
[src]
pub fn create_env(
parent: Option<Rc<RefCell<CompileEnv>>>
) -> Rc<RefCell<CompileEnv>>
[src]
parent: Option<Rc<RefCell<CompileEnv>>>
) -> Rc<RefCell<CompileEnv>>
pub fn def_const(&mut self, s: &str, val: VVal)
[src]
pub fn def_local(&mut self, s: &str, idx: usize)
[src]
pub fn find_or_new_local(&mut self, var: &str) -> usize
[src]
pub fn next_local(&mut self) -> usize
[src]
pub fn get_local_space(&self) -> usize
[src]
pub fn def(&mut self, s: &str, is_global: bool) -> VarPos
[src]
pub fn get_upval_pos(&self) -> Vec<VarPos>
[src]
pub fn local_env_size(&self) -> usize
[src]
pub fn push_block_env(&mut self)
[src]
pub fn pop_block_env(&mut self) -> (usize, usize)
[src]
pub fn get(&mut self, s: &str) -> VarPos
[src]
Trait Implementations
impl Clone for CompileEnv
[src]
fn clone(&self) -> CompileEnv
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CompileEnv
[src]
Auto Trait Implementations
impl !RefUnwindSafe for CompileEnv
impl !Send for CompileEnv
impl !Sync for CompileEnv
impl Unpin for CompileEnv
impl !UnwindSafe for CompileEnv
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,