-
Notifications
You must be signed in to change notification settings - Fork 3
/
tango-build.rs
32 lines (27 loc) · 871 Bytes
/
tango-build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
extern crate tango;
extern crate lalrpop;
use std::env;
fn main() {
// I do not want lalrpop and tango to step on each others toes.
// So we will segregate the two source trees.
let cwd = env::current_dir().unwrap();
let grammar = {
let mut g = cwd.clone(); g.push("src/grammar"); g
};
let lit = {
let mut l = cwd.clone(); l.push("src/lit"); l
};
println!("grammar: {:?} lit: {:?}", grammar, lit);
env::set_current_dir(&grammar).unwrap();
env::set_current_dir(&lit).unwrap();
env::set_current_dir(grammar).unwrap();
lalrpop::process_root().unwrap();
env::set_current_dir(&lit).unwrap();
match tango::process_root() {
Ok(_) => {}
Err(e) => {
println!("error: {:?}", e);
panic!("error with tango::process_root in lit {}", lit.display());
}
}
}