Skip to content

Commit

Permalink
Advance dependency body when symbol has been processed
Browse files Browse the repository at this point in the history
  • Loading branch information
exellentcoin26 committed Sep 13, 2023
1 parent 7b3b033 commit 03cea79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ mod body_iter {

impl<V, T> Grammar<V, T>
where
V: std::fmt::Debug + Copy + Eq + Hash,
T: std::fmt::Debug + Eq + Hash,
V: Copy + Eq + Hash,
T: Eq + Hash,
{
fn first(&self, variable: V) -> HashSet<&Symbol<V, T>> {

Check warning on line 90 in src/grammar.rs

View workflow job for this annotation

GitHub Actions / clippy

methods `first`, `first_body`, `first_bodies`, and `follow_set` are never used

warning: methods `first`, `first_body`, `first_bodies`, and `follow_set` are never used --> src/grammar.rs:90:8 | 85 | impl<V, T> Grammar<V, T> | ------------------------ methods in this implementation ... 90 | fn first(&self, variable: V) -> HashSet<&Symbol<V, T>> { | ^^^^^ ... 98 | fn first_body<'a, B>(&'a self, variable: Option<V>, body: B) -> HashSet<&'a Symbol<V, T>> | ^^^^^^^^^^ ... 106 | fn first_bodies<'a, Bs, B>( | ^^^^^^^^^^^^ ... 274 | pub(super) fn follow_set(&self) -> HashMap<V, HashSet<&Symbol<V, T>>> { | ^^^^^^^^^^
self.first_bodies(
Expand Down Expand Up @@ -169,7 +169,7 @@ where
visited_variables.insert(variable);
}
for body in bodies {
let last_body = body.clone();
let mut last_body = body.clone();
let mut body = body.peekable();
while let Some(symbol) = body.next() {
match symbol {
Expand Down Expand Up @@ -257,6 +257,7 @@ where
}
_ => (),
}
last_body.next();
}
}
}
Expand Down

0 comments on commit 03cea79

Please sign in to comment.