Struct dyon::Module [] [src]

pub struct Module {
    pub source: Option<String>,
    pub functions: HashMap<Arc<String>, Arc<Function>>,
    pub ext_prelude: HashMap<Arc<String>, (fn(&mut Runtime) -> Result<()String>, PreludeFunction)>,
}

Fields

source: Option<String> functions: HashMap<Arc<String>, Arc<Function>> ext_prelude: HashMap<Arc<String>, (fn(&mut Runtime) -> Result<()String>, PreludeFunction)>

Methods

impl Module
[src]

fn new() -> Module

fn register(&mut self, function: Arc<Function>)

fn error(&self, range: Range, msg: &str) -> String

fn add(&mut self, name: Arc<String>, f: fn(&mut Runtime) -> Result<()String>, prelude_function: PreludeFunction)

Adds a new extended prelude function.