compiler wip:

This commit is contained in:
2024-11-29 00:11:59 -07:00
parent 9aaaa2935f
commit 2200df4977
4 changed files with 170 additions and 153 deletions

View File

@@ -50,9 +50,6 @@ struct Args {
/// What file should be compiled. If not set, input will be read from stdin.
#[arg(short, long)]
input_file: Option<String>,
/// The stack size for the compiled program. Compilation will fail if the compiler detects that the program will exceed this stack size.
#[arg(short, long, default_value_t = 512)]
stack_size: usize,
/// The output file for the compiled program. If not set, output will go to stdout.
#[arg(short, long)]
output_file: Option<String>,
@@ -85,7 +82,7 @@ fn run_logic() -> Result<(), StationlangError> {
None => BufWriter::new(boxed!(std::io::stdout())),
};
let compiler = Compiler::new(parser, args.stack_size, &mut writer);
let compiler = Compiler::new(parser, &mut writer);
compiler.compile()?;
writer.flush()?;