From 1a38462fbefd58cc7aff98f28520152e37c5ae55 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Fri, 15 Aug 2025 22:13:24 +0300 Subject: feat: standard library & loading it by default --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 639e675..2e9ee5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,9 +38,10 @@ fn main() { let mut file_to_execute: Option = None; - let mut bind_files: Vec = vec![]; + let mut bind_files: Vec = vec!["stdlib.slip".to_string()]; let mut next_is_load = false; + let mut no_stdlib = false; for arg in env::args() { if next_is_load { @@ -52,6 +53,7 @@ fn main() { match arg.as_str() { s if s.ends_with("myslip") => continue, "-l" | "--load" => next_is_load = true, + "--no-stdlib" => no_stdlib = true, s => match file_to_execute { Some(n) => { println!("Error: can't execute both '{}' and '{}', please specify just one file", s, n); @@ -68,6 +70,9 @@ fn main() { ); return; } + if no_stdlib { + bind_files.remove(0); + } let binds = match read_bind_files(bind_files) { Ok(x) => x, -- cgit v1.2.3