Struct dyon::Module [−][src]
pub struct Module { pub functions: Vec<Function>, pub ext_prelude: Vec<FnExternal>, pub intrinsics: Arc<HashMap<Arc<String>, usize>>, pub register_namespace: Arc<Vec<Arc<String>>>, }
Fields
functions: Vec<Function>
ext_prelude: Vec<FnExternal>
intrinsics: Arc<HashMap<Arc<String>, usize>>
register_namespace: Arc<Vec<Arc<String>>>
Methods
impl Module
[src]
impl Module
pub fn new() -> Module
[src]
pub fn new() -> Module
pub fn new_intrinsics(intrinsics: Arc<HashMap<Arc<String>, usize>>) -> Module
[src]
pub fn new_intrinsics(intrinsics: Arc<HashMap<Arc<String>, usize>>) -> Module
pub fn ns(&mut self, ns: &str)
[src]
pub fn ns(&mut self, ns: &str)
Sets namespace for following added functions.
pub fn no_ns(&mut self)
[src]
pub fn no_ns(&mut self)
Sets no namespace.
pub fn register(&mut self, function: Function)
[src]
pub fn register(&mut self, function: Function)
pub fn find_function(&self, name: &Arc<String>, relative: usize) -> FnIndex
[src]
pub fn find_function(&self, name: &Arc<String>, relative: usize) -> FnIndex
Find function relative another function index.
pub fn error(&self, range: Range, msg: &str, rt: &Runtime) -> String
[src]
pub fn error(&self, range: Range, msg: &str, rt: &Runtime) -> String
pub fn error_fnindex(&self, range: Range, msg: &str, fnindex: usize) -> String
[src]
pub fn error_fnindex(&self, range: Range, msg: &str, fnindex: usize) -> String
pub fn error_source(
&self,
range: Range,
msg: &str,
source: &Arc<String>
) -> String
[src]
pub fn error_source(
&self,
range: Range,
msg: &str,
source: &Arc<String>
) -> String
pub fn add(
&mut self,
name: Arc<String>,
f: fn(_: &mut Runtime) -> Result<(), String>,
prelude_function: Dfn
)
[src]
pub fn add(
&mut self,
name: Arc<String>,
f: fn(_: &mut Runtime) -> Result<(), String>,
prelude_function: Dfn
)
Adds a new external prelude function.