Full std imports; limited prelude

This commit is contained in:
NotTheDr01ds 2024-09-25 18:30:49 -04:00
parent a76cd758c1
commit 2ffde2acab
3 changed files with 40 additions and 8 deletions

View File

@ -17,12 +17,16 @@ pub fn load_standard_library(
let std_dir = PathBuf::from("std");
let mut std_files = vec![
("mod.nu", include_str!("../std/mod.nu")),
// Loaded at startup
("core", include_str!("../std/core.nu")),
// std module - Loads all commands and submodules
("mod.nu", include_str!("../std/mod.nu")),
// Faster - Loads a subset of commands and submodules
("prelude", include_str!("../std/prelude.nu")),
// std submodules
("assert", include_str!("../std/assert.nu")),
("bench", include_str!("../std/bench.nu")),
("dirs", include_str!("../std/dirs.nu")),
("deprecated_dirs", include_str!("../std/deprecated_dirs.nu")),
("dt", include_str!("../std/dt.nu")),
("formats", include_str!("../std/formats.nu")),
("help", include_str!("../std/help.nu")),
@ -32,6 +36,8 @@ pub fn load_standard_library(
("math", include_str!("../std/math.nu")),
("lib", include_str!("../std/lib.nu")),
("xml", include_str!("../std/xml.nu")),
// Remove in following release
("deprecated_dirs", include_str!("../std/deprecated_dirs.nu")),
];
let mut working_set = StateWorkingSet::new(engine_state);

View File

@ -1,9 +1,26 @@
# std.nu, `used` to load base standard library components
# std.nu, `used` to load all standard library components
export use lib *
export module assert
export module bench
export use dirs main
export module dirs {
export use dirs [
add
drop
next
prev
goto
]
}
export module dt
export use dt *
export module formats
export use formats *
export module help
export module input
export module iter
# Make certain commands available in the top-level namespace
export use lib *
export use formats *
export use dt *
export module log
export use math *
export module xml
export use xml *

View File

@ -0,0 +1,9 @@
# std.nu, `used` to load base standard library components
export module input
export module iter
# Make certain commands available in the top-level namespace
export use lib *
export use formats *
export use dt *