7ccbd9258f
- updated comments in compiler codegen - deleted old dsa compiler outputs - settings for zed
20 lines
488 B
Rust
20 lines
488 B
Rust
use std::path::Path;
|
|
|
|
fn main() {
|
|
// read from input file: syntax "c_compiler <src.c> [output.dsa]"
|
|
let args: Vec<String> = std::env::args().collect();
|
|
if args.len() < 2 {
|
|
eprintln!("Usage: c_compiler <src.dsc> [output.dsa]");
|
|
return;
|
|
}
|
|
|
|
let input_file = &args[1];
|
|
let output_file = if args.len() > 2 {
|
|
&args[2]
|
|
} else {
|
|
"output.dsa"
|
|
};
|
|
|
|
compiler::compile_file(Path::new(input_file), Path::new(output_file)).unwrap();
|
|
}
|