Trait SymbolResolver

Source
pub trait SymbolResolver {
    // Required methods
    fn resolve_variable(&self, name: &str) -> Option<&Symbol>;
    fn resolve_function(&self, name: &str) -> Option<&Symbol>;
    fn resolve_value(&self, name: &str) -> Option<&Symbol>;
}
Expand description

Trait for symbol resolution operations

This trait abstracts symbol lookup operations, allowing for different implementations and easier testing through mocking.

Required Methods§

Source

fn resolve_variable(&self, name: &str) -> Option<&Symbol>

Resolve a variable symbol by name

Returns the symbol if found and it’s a variable, None otherwise

Source

fn resolve_function(&self, name: &str) -> Option<&Symbol>

Resolve a function symbol by name

Returns the symbol if found and it’s a function, None otherwise

Source

fn resolve_value(&self, name: &str) -> Option<&Symbol>

Resolve a symbol that can be used as a value (variables and functions)

This allows functions to be accessed as first-class values

Implementors§