2020-11-23 00:47:27 +01:00
|
|
|
use std::env;
|
2020-11-23 00:59:03 +01:00
|
|
|
use std::fs;
|
|
|
|
use std::io;
|
|
|
|
use std::io::Write;
|
|
|
|
use std::process;
|
2020-11-23 00:47:27 +01:00
|
|
|
|
2021-01-17 18:31:03 +01:00
|
|
|
mod bytecode;
|
2021-01-17 10:13:52 +01:00
|
|
|
mod treewalk;
|
2020-11-23 00:47:27 +01:00
|
|
|
|
|
|
|
fn main() {
|
2021-01-17 18:31:03 +01:00
|
|
|
match env::var("LOX_INTERPRETER").as_ref().map(String::as_str) {
|
|
|
|
Ok("treewalk") => treewalk::main(),
|
|
|
|
_ => bytecode::main(),
|
2020-12-31 11:27:10 +01:00
|
|
|
}
|
|
|
|
}
|