From 664d4648958bf5aadabc43675ba1e238e41aa0e2 Mon Sep 17 00:00:00 2001 From: jusax23 Date: Sun, 27 Oct 2024 17:09:39 +0100 Subject: [PATCH] small fixes --- src/ll_grammar.rs | 3 +-- src/main.rs | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ll_grammar.rs b/src/ll_grammar.rs index 9393d23..819607f 100644 --- a/src/ll_grammar.rs +++ b/src/ll_grammar.rs @@ -343,7 +343,7 @@ impl< // stack of table driven parser // content of the vec: // - first element: all of them combined represent the complete stack, of the parser. - // - secount element: rule has to able to derive the code defined, by its inner childs and the unparsed code from the accompanying first element. + // - secount element: rule has to able to derive the code defined, by its inner childs and the unparsed code from the accompanying first element. let mut stack: Vec<(Vec>, ParseTree)> = vec![( vec![Sentential::NoneTerminal(self.grammar.start.clone())], ParseTree::new(None), @@ -434,7 +434,6 @@ impl< } } - // #[derive(Debug, Clone)] diff --git a/src/main.rs b/src/main.rs index d562677..d474a6d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,8 +102,8 @@ scanner!( #[derive(Debug, PartialEq, Eq, Hash, Clone)] enum NoneTerminals { P, // Program, ; separated - L, - Li, + L, // Line of code + Li, // line extended for assignments E, // Expression Ei, // Expression extended additive T, // Term, only containing Factors @@ -169,8 +169,5 @@ fn main() { println!("conflict: {conflict}"); println!("prase table: {:?}", grammar.parse_table); println!("parse\n\n"); - println!( - "parsed: {:?}", - grammar.parser(&mut m.iter_mut()).parse() - ) + println!("parsed: {:?}", grammar.parser(&mut m.iter_mut()).parse()) }