diff options
| author | Cody <cody@codyq.dev> | 2023-05-24 00:23:13 -0500 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2023-05-24 00:23:13 -0500 |
| commit | 9c41dd96cd3652ce9c46307184e8055704655338 (patch) | |
| tree | 07071d74da7398593fc5b9cfe5c4df0229ee4eb0 /crates/sloth_vm/src/sloth_std/mod.rs | |
| parent | 2418d68631f6e338251f2d988de2d3fde206982b (diff) | |
| parent | df00e9ff2c2b563c79beb71ba8c510233b04f3bf (diff) | |
| download | sloth-9c41dd96cd3652ce9c46307184e8055704655338.tar.gz | |
Merge branch 'master' into compiler
Diffstat (limited to 'crates/sloth_vm/src/sloth_std/mod.rs')
| -rw-r--r-- | crates/sloth_vm/src/sloth_std/mod.rs | 19 |
1 files changed, 19 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..ff761a6 100644 --- a/crates/sloth_vm/src/sloth_std/mod.rs +++ b/crates/sloth_vm/src/sloth_std/mod.rs @@ -4,8 +4,12 @@ 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(); @@ -16,9 +20,24 @@ 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 + // 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 }); |
