Remove unused system library and simplify environment initialization

The `system.myc` file, containing macros and core utilities, has been
removed as its functionality is now handled by an embedded string. This
simplifies the build process and eliminates a file that was no longer
strictly necessary.

Additionally, the `with_cwd()` method on the `Environment` has been
removed. The environment now automatically adds the current working
directory and its `rtl` subdirectory to the search paths during
initialization. This streamlines the setup for file-based usage and
ensures standard search paths are always considered.
This commit is contained in:
Michael Schimmel
2026-03-08 13:09:53 +01:00
parent 4dfdc75545
commit b622f7f8bd
6 changed files with 42 additions and 98 deletions
+1 -11
View File
@@ -42,7 +42,7 @@ struct Cli {
fn main() {
let cli = Cli::parse();
let mut env = Environment::new().with_cwd();
let mut env = Environment::new();
env.optimization = !cli.no_opt;
// Load libraries (Now just search paths)
@@ -74,11 +74,6 @@ fn main() {
}
if let Some(script_str) = cli.eval {
if let Err(e) = env.preload_dependencies(&script_str, None) {
eprintln!("❌ Error resolving dependencies: {}", e);
std::process::exit(1);
}
if cli.dump {
match env.dump_ast(&script_str) {
Ok(dump) => println!("{}", dump),
@@ -92,11 +87,6 @@ fn main() {
} else if let Some(file_path) = cli.file {
match fs::read_to_string(&file_path) {
Ok(content) => {
if let Err(e) = env.preload_dependencies(&content, Some(&file_path)) {
eprintln!("❌ Error resolving dependencies for {:?}:\n{}", file_path, e);
std::process::exit(1);
}
if cli.dump {
match env.dump_ast(&content) {
Ok(dump) => println!("{}", dump),