From c1769503a8edf93ed5ceeeee4664b53995fc86f6 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 14 Jun 2022 07:35:07 -0400 Subject: [PATCH] Add Item#complete? --- lib/propane/parser/item.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/propane/parser/item.rb b/lib/propane/parser/item.rb index 6ed9cf5..d694691 100644 --- a/lib/propane/parser/item.rb +++ b/lib/propane/parser/item.rb @@ -72,6 +72,15 @@ class Propane end end + # Return whether the item is "complete", meaning that the parse position + # marker is at the end of the rule. + # + # @return [Boolean] + # Whether the item is "complete". + def complete? + @position == @rule.components.size + end + # Get the following symbol for the Item. # # That is, the symbol which follows the parse position marker in the