Switch to pest-generated parser
This commit is contained in:
parent
9c9e5764f2
commit
1e58672e21
9 changed files with 262 additions and 250 deletions
21
src/parse.rs
21
src/parse.rs
|
|
@ -1,18 +1,3 @@
|
|||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::commands::Command;
|
||||
|
||||
use self::line::parse_lines;
|
||||
|
||||
mod error;
|
||||
mod line;
|
||||
mod parser;
|
||||
|
||||
pub fn parse(file: &Path) -> anyhow::Result<Vec<Command>> {
|
||||
let content = fs::read_to_string(file)?;
|
||||
let lines = parse_lines(&content)?;
|
||||
|
||||
println!("{:#?}", lines);
|
||||
todo!()
|
||||
}
|
||||
#[derive(pest_derive::Parser)]
|
||||
#[grammar = "parse/grammar.pest"]
|
||||
pub struct MyParser;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue