mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 20:14:45 +00:00
Organize crates
This commit is contained in:
parent
6ddef21fec
commit
f9d91aa38e
71 changed files with 6 additions and 14 deletions
28
compiler/erg_compiler/main.rs
Normal file
28
compiler/erg_compiler/main.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
extern crate erg_common;
|
||||
extern crate erg_compiler;
|
||||
extern crate erg_parser;
|
||||
|
||||
use std::process;
|
||||
|
||||
use erg_common::deserialize::Deserializer;
|
||||
use erg_common::config::{ErgConfig};
|
||||
use erg_common::traits::Runnable;
|
||||
|
||||
use erg_compiler::Compiler;
|
||||
|
||||
use erg_parser::lex::LexerRunner;
|
||||
use erg_parser::ParserRunner;
|
||||
|
||||
fn main() {
|
||||
let cfg = ErgConfig::parse();
|
||||
match cfg.mode {
|
||||
"lex" => { LexerRunner::run(cfg); }
|
||||
"parse" => { ParserRunner::run(cfg); }
|
||||
"compile" | "exec" => { Compiler::run(cfg); }
|
||||
"read" => { Deserializer::run(cfg); }
|
||||
other => {
|
||||
println!("invalid mode: {other}");
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue