From e9bac67447c0d808168980a11358934f60fd250e Mon Sep 17 00:00:00 2001 From: v-jkegler Date: Fri, 20 Sep 2024 16:16:25 -0400 Subject: [PATCH] Update parser.rs (#14) Comment for just_add() --- parser/src/earley/parser.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parser/src/earley/parser.rs b/parser/src/earley/parser.rs index cc2d87cb..c0d436db 100644 --- a/parser/src/earley/parser.rs +++ b/parser/src/earley/parser.rs @@ -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);