talc/talc-std/src/lib.rs

48 lines
835 B
Rust
Raw Normal View History

2024-11-03 17:50:36 +00:00
#![allow(clippy::mutable_key_type)]
2024-11-04 18:25:31 +00:00
use talc_lang::{
symbol::{symbol, Symbol},
Vm,
};
2024-02-23 19:54:34 +00:00
2024-11-04 18:25:31 +00:00
pub mod collection;
pub mod exception;
pub mod file;
pub mod format;
2024-02-23 19:54:34 +00:00
pub mod io;
pub mod iter;
2024-02-27 05:18:43 +00:00
pub mod num;
2024-11-04 18:25:31 +00:00
#[cfg(feature = "random")]
2024-02-27 05:18:43 +00:00
pub mod random;
2024-11-04 18:25:31 +00:00
pub mod regex;
pub mod string;
pub mod value;
2024-02-23 19:54:34 +00:00
pub fn load_all(vm: &mut Vm) {
2024-02-27 05:18:43 +00:00
value::load(vm);
exception::load(vm);
iter::load(vm);
collection::load(vm);
num::load(vm);
io::load(vm);
2024-03-30 16:21:09 +00:00
string::load(vm);
2024-11-04 17:59:05 +00:00
format::load(vm);
2024-03-30 16:21:09 +00:00
regex::load(vm);
file::load(vm);
2024-11-04 18:25:31 +00:00
#[cfg(feature = "random")]
2024-02-27 05:18:43 +00:00
random::load(vm);
2024-02-23 19:54:34 +00:00
}
lazy_static::lazy_static! {
2024-02-27 05:18:43 +00:00
pub static ref SYM_IO_ERROR: Symbol = symbol!(io_error);
pub static ref SYM_FORMAT_ERROR: Symbol = symbol!(format_error);
2024-02-27 05:18:43 +00:00
}
macro_rules! unpack_args {
($e:expr) => {
($e).try_into().expect("bypassed arity check")
};
2024-02-23 19:54:34 +00:00
}
2024-02-27 05:18:43 +00:00
pub(crate) use unpack_args;