Struct dyon::Module [] [src]

pub struct Module {
    pub functions: Vec<Function>,
    pub ext_prelude: Vec<FnExternal>,
    pub intrinsics: Arc<HashMap<Arc<String>, usize>>,
}

Fields

functions: Vec<Function> ext_prelude: Vec<FnExternal> intrinsics: Arc<HashMap<Arc<String>, usize>>

Methods

impl Module
[src]

fn new() -> Module

fn new_intrinsics(intrinsics: Arc<HashMap<Arc<String>, usize>>) -> Module

fn register(&mut self, function: Function)

fn find_function(&self, name: &Arc<String>, relative: usize) -> FnIndex

Find function relative another function index.

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

fn error_fnindex(&self, range: Range, msg: &str, fnindex: usize) -> String

fn error_source(&self, range: Range, msg: &str, source: &Arc<String>) -> String

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

Adds a new extended prelude function.

Trait Implementations

impl Clone for Module
[src]

fn clone(&self) -> Module

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more