UseSymbol

Trait UseSymbol 

Source
pub trait UseSymbol {
    // Required methods
    fn use_symbol(
        &mut self,
        visibility: Visibility,
        name: &QualifiedName,
        id: Option<Identifier>,
        within: &QualifiedName,
    ) -> EvalResult<Symbol>;
    fn use_symbols_of(
        &mut self,
        visibility: Visibility,
        name: &QualifiedName,
        within: &QualifiedName,
    ) -> EvalResult<Symbol>;
}
Expand description

Trait used by UseDeclaration and implemented by SymbolTable and passed through by Context to put symbols on the Stack (for use statements).

Required Methods§

Source

fn use_symbol( &mut self, visibility: Visibility, name: &QualifiedName, id: Option<Identifier>, within: &QualifiedName, ) -> EvalResult<Symbol>

Find a symbol in the symbol table and copy it to the locals.

Might load any related external file if not already loaded.

§Arguments
  • name: Name of the symbol to search for
  • id: if given overwrites the ID from qualified name (use as)
  • within: Target symbol
Source

fn use_symbols_of( &mut self, visibility: Visibility, name: &QualifiedName, within: &QualifiedName, ) -> EvalResult<Symbol>

Find a symbol in the symbol table and copy all it’s children to the locals and the target.

Might load any related external file if not already loaded.

§Arguments
  • name: Name of the symbol to search for
  • within: Target symbol

Implementors§