[−][src]Struct ucglib::build::scope::Scope
Defines a scope for execution in ucg.
Scopes in ucg are defined by the currently executing file and the complex data types in that file. (Tuple, List, Modules, and the left operands for dot selectors).
UCG Scopes do not descend up into their parent scopes so we do not maintain a stack for those.
Fields
import_stack: Vec<String>env: Rc<Val>curr_val: Option<Rc<Val>>build_output: ValueMapsearch_curr_val: boolstrict: boolImplementations
impl Scope[src]
pub fn new(env: Rc<Val>) -> Self[src]
pub fn use_strict(self) -> Self[src]
pub fn use_curr_val(self) -> Self[src]
pub fn spawn_child(&self) -> Self[src]
Spawn a child scope based on the current scope but without the current val set.
pub fn spawn_clean(&self) -> Self[src]
pub fn push_import<S: Into<String>>(&mut self, path: S)[src]
Push an import onto the import stack.
pub fn prepend_import_stack(&mut self, imports: &Vec<String>)[src]
pub fn set_curr_val(self, val: Rc<Val>) -> Self[src]
Set the current value for our execution context.
pub fn lookup_idx(
&self,
pos: &Position,
idx: &Val
) -> Result<Rc<Val>, Box<dyn Error>>[src]
&self,
pos: &Position,
idx: &Val
) -> Result<Rc<Val>, Box<dyn Error>>
Lookup up a list index in the current value
pub fn lookup_sym(
&self,
sym: &PositionedItem<String>,
is_symbol: bool
) -> Option<Rc<Val>>[src]
&self,
sym: &PositionedItem<String>,
is_symbol: bool
) -> Option<Rc<Val>>
Lookup a symbol in the current execution context.
The lookup rules are simple.
envis always an environment variable lookup.selfis always the current value. This symbol is only valid when the current value is a tuple.- everything else is looked up in the currently accumulated build output for this execution context.
Trait Implementations
impl Clone for Scope[src]
impl Debug for Scope[src]
impl PartialEq<Scope> for Scope[src]
impl StructuralPartialEq for Scope[src]
Auto Trait Implementations
impl !RefUnwindSafe for Scope
impl !Send for Scope
impl !Sync for Scope
impl Unpin for Scope
impl !UnwindSafe for Scope
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>,