| 18 | pub mod uuid; |
| 19 | |
| 20 | pub(in crate::module::std_lib) fn func<'heap>( |
| 21 | lib: &StandardLibrary<'_, 'heap>, |
| 22 | def: &mut ModuleDef<'heap>, |
| 23 | |
| 24 | name: &'static str, |
| 25 | alias: &[&'static str], |
| 26 | |
| 27 | r#type: TypeDef<'heap>, |
| 28 | ) { |
| 29 | let value = IntrinsicValueItem { name, r#type }; |
| 30 | |
| 31 | let ident = name.rsplit_once("::").expect("path should be non-empty").1; |
| 32 | |
| 33 | def.push_aliased( |
| 34 | iter::once(ident) |
| 35 | .chain(alias.iter().copied()) |
| 36 | .map(|name| lib.heap.intern_symbol(name)), |
| 37 | ItemDef::intrinsic(value), |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | pub(in crate::module::std_lib) struct Core; |
| 42 | |