small fixes

This commit is contained in:
jusax23 2024-10-27 17:09:39 +01:00
parent 9112736652
commit 664d464895
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41
2 changed files with 4 additions and 8 deletions

View file

@ -343,7 +343,7 @@ impl<
// stack of table driven parser // stack of table driven parser
// content of the vec: // content of the vec:
// - first element: all of them combined represent the complete stack, of the parser. // - 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<Sentential<T, N>>, ParseTree<N, S>)> = vec![( let mut stack: Vec<(Vec<Sentential<T, N>>, ParseTree<N, S>)> = vec![(
vec![Sentential::NoneTerminal(self.grammar.start.clone())], vec![Sentential::NoneTerminal(self.grammar.start.clone())],
ParseTree::new(None), ParseTree::new(None),
@ -434,7 +434,6 @@ impl<
} }
} }
// //
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View file

@ -102,8 +102,8 @@ scanner!(
#[derive(Debug, PartialEq, Eq, Hash, Clone)] #[derive(Debug, PartialEq, Eq, Hash, Clone)]
enum NoneTerminals { enum NoneTerminals {
P, // Program, ; separated P, // Program, ; separated
L, L, // Line of code
Li, Li, // line extended for assignments
E, // Expression E, // Expression
Ei, // Expression extended additive Ei, // Expression extended additive
T, // Term, only containing Factors T, // Term, only containing Factors
@ -169,8 +169,5 @@ fn main() {
println!("conflict: {conflict}"); println!("conflict: {conflict}");
println!("prase table: {:?}", grammar.parse_table); println!("prase table: {:?}", grammar.parse_table);
println!("parse\n\n"); println!("parse\n\n");
println!( println!("parsed: {:?}", grammar.parser(&mut m.iter_mut()).parse())
"parsed: {:?}",
grammar.parser(&mut m.iter_mut()).parse()
)
} }