From 1d8102b9faa185fef9c7fe280e926df2979c4a21 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 28 Dec 2016 16:04:28 -0800 Subject: [PATCH] Make compilation controllable --- src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 33d1db3..8c30e46 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,7 +28,7 @@ fn main() { run_repl(); }, [_, ref filename, ..] => { - run_noninteractive(filename); + run_noninteractive(filename, !option_matches.opt_present("i")); } }; } @@ -39,7 +39,7 @@ fn program_options() -> getopts::Options { options } -fn run_noninteractive(filename: &String) { +fn run_noninteractive(filename: &str, compile: bool) { let mut source_file = File::open(&Path::new(filename)).unwrap(); let mut buffer = String::new(); source_file.read_to_string(&mut buffer).unwrap(); @@ -54,8 +54,6 @@ fn run_noninteractive(filename: &String) { Err(err) => { println!("Parse error: {:?}", err); return; } }; - let compile = true; - if compile { compilation_sequence(ast, filename); } else {