Organize crates

This commit is contained in:
Shunsuke Shibayama 2022-08-13 06:38:12 +09:00
parent 6ddef21fec
commit f9d91aa38e
71 changed files with 6 additions and 14 deletions

View file

@ -0,0 +1,22 @@
extern crate erg_common;
extern crate erg_parser;
use std::process;
use erg_common::config::ErgConfig;
use erg_common::traits::Runnable;
use erg_parser::lex::LexerRunner;
use erg_parser::ParserRunner;
fn main() {
let cfg = ErgConfig::parse();
match cfg.mode {
"lex" => { LexerRunner::run(cfg); }
"parse" | "exec" => { ParserRunner::run(cfg); }
other => {
println!("invalid mode: {other}");
process::exit(1);
}
}
}