Switch to pest-generated parser

This commit is contained in:
Joscha 2021-11-18 02:49:38 +01:00
parent 9c9e5764f2
commit 1e58672e21
9 changed files with 262 additions and 250 deletions

View file

@ -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;