exec_dbg/exec_dbg.rs
1fn main() {
2 use mii_http::parse::exec::parse_exec;
3 let cases = [
4 "echo Hello, [%name] [%guest]",
5 "$ | xargs echo",
6 "echo title=[$.title] count=[$.count]",
7 "echo user [:user_id]",
8 ];
9 for c in &cases {
10 println!("--- {}", c);
11 match parse_exec(c, 0) {
12 Ok(stages) => {
13 for s in &stages {
14 println!(" {:#?}", s);
15 }
16 }
17 Err(e) => println!(" ERR: {} @ {:?}", e.message, e.span),
18 }
19 }
20}