mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2025-09-25 07:51:30 +02:00
implement basic namespacing for types, traits and commands
This commit is contained in:
parent
3cca2bc2cc
commit
b6b8c5085a
5 changed files with 287 additions and 6 deletions
14
src/builtins/mod.rs
Normal file
14
src/builtins/mod.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
use self::namespace::{GlobalNamespace, TypeDef};
|
||||
|
||||
pub mod namespace;
|
||||
|
||||
pub fn initialise_globals() -> GlobalNamespace {
|
||||
let mut ns = GlobalNamespace::init();
|
||||
|
||||
let numeric = ns.register_trait("Numeric").unwrap();
|
||||
|
||||
ns.register_type("integer").unwrap().add_trait(&numeric);
|
||||
ns.register_type("float").unwrap().add_trait(&numeric);
|
||||
|
||||
ns
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue