diff options
Diffstat (limited to 'crates/sloth_vm/src/sloth_std/mod.rs')
| -rw-r--r-- | crates/sloth_vm/src/sloth_std/mod.rs | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/crates/sloth_vm/src/sloth_std/mod.rs b/crates/sloth_vm/src/sloth_std/mod.rs deleted file mode 100644 index ff761a6..0000000 --- a/crates/sloth_vm/src/sloth_std/mod.rs +++ /dev/null @@ -1,43 +0,0 @@ -use std::collections::HashMap; - -use once_cell::sync::Lazy; - -use crate::native::NativeFunction; - -pub mod file; -pub mod misc; -pub mod rand; -pub mod stdio; -pub mod term; -pub mod time; - -pub static NATIVE_LIBRARY: Lazy<HashMap<&'static str, NativeFunction>> = Lazy::new(|| { - let mut map = HashMap::new(); - - // rand - map.insert("rand$gen", rand::GEN_FUNCTION); - map.insert("rand$gen_range", rand::GEN_RANGE_FUNCTION); - - // stdio - map.insert("write", stdio::WRITE_FUNCTION); - map.insert("writeln", stdio::WRITELN_FUNCTION); - map.insert("read", stdio::READ_FUNCTION); - - // term - map.insert("term$clear", term::TERM_CLEAR); - map.insert("term$setpos", term::TERM_SETPOS); - - // filesystem - // TODO: Make the files commands work by making a global file variable with - // certain permissions created by 'file.open' instead of just reading the file. - map.insert("file$read", file::FILE_READ); - map.insert("file$write", file::FILE_WRITE); - - // time - map.insert("wait", time::WAIT); - - // doc - map.insert("docs", misc::DOCS); - - map -}); |
