Start interpreting pest output
This commit is contained in:
parent
1e58672e21
commit
6e53446a08
3 changed files with 35 additions and 7 deletions
|
|
@ -1,11 +1,8 @@
|
|||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use pest::Parser;
|
||||
use structopt::StructOpt;
|
||||
|
||||
use parse::{MyParser, Rule};
|
||||
|
||||
mod commands;
|
||||
mod parse;
|
||||
|
||||
|
|
@ -18,7 +15,7 @@ pub struct Opt {
|
|||
fn main() -> anyhow::Result<()> {
|
||||
let opt = Opt::from_args();
|
||||
let content = fs::read_to_string(&opt.file)?;
|
||||
let parsed = MyParser::parse(Rule::file, &content)?.next().unwrap();
|
||||
println!("{:#?}", parsed);
|
||||
let commands = parse::parse(&content)?;
|
||||
println!("{:#?}", commands);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue