mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
Organize crates
This commit is contained in:
parent
6ddef21fec
commit
f9d91aa38e
71 changed files with 6 additions and 14 deletions
22
compiler/erg_parser/main.rs
Normal file
22
compiler/erg_parser/main.rs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue