Skip to content

Commit

Permalink
Update parser.rs (#14)
Browse files Browse the repository at this point in the history
Comment for just_add()
  • Loading branch information
v-jkegler authored Sep 20, 2024
1 parent 9688aae commit e9bac67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions parser/src/earley/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ impl Scratch {
self.item_props[target_item_idx].merge(origin);
}

// Add an Earley item to the Earley table. It is "just" added in the sense
// that no checks are performed, except the one that ensures there is enough
// space in the table. The other checks are assumed to be unnecessary
// or to have been performed. For example, it is assumed the caller knows
// that this Earley item will be unique.
#[inline(always)]
fn just_add(&mut self, item: Item, origin_item_idx: usize, info: &str) {
self.ensure_items(self.row_end + 1);
Expand Down

0 comments on commit e9bac67

Please sign in to comment.