Trait darklua_core::process::Scope[][src]

pub trait Scope {
    fn push(&mut self);
fn pop(&mut self);
fn insert(&mut self, identifier: &mut String);
fn insert_local(
        &mut self,
        identifier: &mut String,
        value: Option<&mut Expression>
    );
fn insert_local_function(&mut self, function: &mut LocalFunctionStatement); }
Expand description

Defines methods to interact with the concept of lexical scoping. The struct implementing this trait should be able to keep track of identifiers when used along the ScopeVisitor.

Required methods

This method is called when a new block is entered.

When a block is left, this method should should free all identifiers inserted in the previous block.

Called when entering a function block (with each parameters of the function), with the identifiers from a generic for statement or the identifier from a numeric for loop.

Called when a new local variable is initialized.

Called when a new local function is initialized.

Implementors