[][src]Struct yolk::environment::Environment

pub struct Environment { /* fields omitted */ }

Represents a Yolk program environment.

Methods

impl Environment[src]

pub fn new() -> Environment[src]

Creates an empty environment.

pub fn context(&self) -> Context[src]

Gets the context of an environment.

pub fn variable(&self, ident: &str) -> Result<Value, TranspileError>[src]

Gets the value of a variable from an environment.

pub fn function(&self, ident: &str) -> Result<Function, TranspileError>[src]

Gets a function from an environment.

pub fn import(&mut self, ident: &str) -> Result<(), TranspileError>[src]

Imports a variable into an environment.

pub fn define(
    &mut self,
    ident: &str,
    function: Function
) -> Result<(), TranspileError>
[src]

Defines a function in an environmnent.

pub fn let_value(
    &mut self,
    ident: &str,
    value: Value
) -> Result<Vec<YololNode>, TranspileError>
[src]

Assigns a value to a variable in an environment.

Returns the associated Yolol assign statements.

pub fn export(&mut self, ident: &str) -> Result<(), TranspileError>[src]

Exports a variable from an environment.

Tracks which variable identifiers must not be eliminated.

Trait Implementations

impl Clone for Environment[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Environment[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]