aboutsummaryrefslogtreecommitdiff
path: root/crates/sloth_vm/src/sloth_std/mod.rs
diff options
context:
space:
mode:
authornic-gaffney <gaffney_nic@protonmail.com>2023-04-14 03:20:23 -0500
committernic-gaffney <gaffney_nic@protonmail.com>2023-04-14 03:20:23 -0500
commitf6e14f4b2b15b0ace8ed312252ae107f139bd33d (patch)
tree34d844e1c4f1be2c95ef87e6363a76b3502bb40f /crates/sloth_vm/src/sloth_std/mod.rs
parent97b7cd10d2bec408cc237e13c61562c810d8fd29 (diff)
downloadsloth-f6e14f4b2b15b0ace8ed312252ae107f139bd33d.tar.gz
Terminal and file stuff
Diffstat (limited to 'crates/sloth_vm/src/sloth_std/mod.rs')
-rw-r--r--crates/sloth_vm/src/sloth_std/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/sloth_vm/src/sloth_std/mod.rs b/crates/sloth_vm/src/sloth_std/mod.rs
index 86611d7..b40fb9a 100644
--- a/crates/sloth_vm/src/sloth_std/mod.rs
+++ b/crates/sloth_vm/src/sloth_std/mod.rs
@@ -4,8 +4,10 @@ use once_cell::sync::Lazy;
use crate::native::NativeFunction;
+pub mod file;
pub mod rand;
pub mod stdio;
+pub mod term;
pub static NATIVE_LIBRARY: Lazy<HashMap<&'static str, NativeFunction>> = Lazy::new(|| {
let mut map = HashMap::new();
@@ -16,9 +18,16 @@ pub static NATIVE_LIBRARY: Lazy<HashMap<&'static str, NativeFunction>> = Lazy::n
// 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
+ map.insert("file$read", file::FILE_READ);
+ map.insert("file$write", file::FILE_WRITE);
map
});