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},
|
2024-11-14 19:16:33 +00:00
|
|
|
vm::Vm,
|
2024-11-04 18:25:31 +00:00
|
|
|
};
|
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-12-21 05:55:45 +00:00
|
|
|
pub mod ints;
|
2024-02-23 19:54:34 +00:00
|
|
|
pub mod io;
|
|
|
|
pub mod iter;
|
2024-12-21 05:55:45 +00:00
|
|
|
pub mod math;
|
2024-11-04 18:25:31 +00:00
|
|
|
pub mod string;
|
|
|
|
pub mod value;
|
2024-02-23 19:54:34 +00:00
|
|
|
|
2024-11-14 19:16:33 +00:00
|
|
|
#[cfg(feature = "rand")]
|
|
|
|
pub mod random;
|
|
|
|
#[cfg(feature = "regex")]
|
|
|
|
pub mod regex;
|
|
|
|
|
2024-02-23 19:54:34 +00:00
|
|
|
pub fn load_all(vm: &mut Vm) {
|
2024-11-14 19:16:33 +00:00
|
|
|
collection::load(vm);
|
2024-02-27 05:18:43 +00:00
|
|
|
exception::load(vm);
|
2024-11-14 19:16:33 +00:00
|
|
|
file::load(vm);
|
|
|
|
format::load(vm);
|
|
|
|
io::load(vm);
|
2024-02-27 05:18:43 +00:00
|
|
|
iter::load(vm);
|
2024-12-21 05:55:45 +00:00
|
|
|
math::load(vm);
|
|
|
|
ints::load(vm);
|
2024-03-30 16:21:09 +00:00
|
|
|
string::load(vm);
|
2024-11-14 19:16:33 +00:00
|
|
|
value::load(vm);
|
|
|
|
|
|
|
|
#[cfg(feature = "rand")]
|
2024-02-27 05:18:43 +00:00
|
|
|
random::load(vm);
|
2024-11-14 19:16:33 +00:00
|
|
|
#[cfg(feature = "regex")]
|
|
|
|
regex::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);
|
2024-10-31 16:36:53 +00:00
|
|
|
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;
|