From 63640911b950905057f2ca925e0b2b2c530721ec Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 Mar 2015 00:01:18 +0200 Subject: Don't create items with point at end --- src/state.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/state.cpp') diff --git a/src/state.cpp b/src/state.cpp index e798dce..958ab3e 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -55,11 +55,8 @@ void state_t::add_rule_terminal(unsigned char term) { void state_t::add_rule() { rules.emplace(current.get_lhs(), current); - while (true) { + while (current.has_next()) { items.emplace(current.get_next_symbol(), current); - if (!current.can_shift()) - break; - current.shift(); } } -- cgit v1.2.3