From 98fec25ee0e908124c7e29e27ee3b5c0d690c221 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 28 Aug 2024 16:00:49 -0700 Subject: [PATCH] Add informative/progress output for entry to productions as well as exit. --- lib/ebnf/ll1/parser.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ebnf/ll1/parser.rb b/lib/ebnf/ll1/parser.rb index e8f5159..af0104e 100644 --- a/lib/ebnf/ll1/parser.rb +++ b/lib/ebnf/ll1/parser.rb @@ -603,7 +603,7 @@ def onStart(prod) if handler # Create a new production data element, potentially allowing handler # to customize before pushing on the @prod_data stack - debug("#{prod}(:start):#{@prod_data.length}") {@prod_data.last} + progress("#{prod}(:start):#{@prod_data.length}") {@prod_data.last} data = {} begin self.class.eval_with_binding(self) { @@ -617,12 +617,12 @@ def onStart(prod) elsif [:merge, :star].include?(@cleanup[prod]) # Save current data to merge later @prod_data << {} - debug("#{prod}(:start}:#{@prod_data.length}:cleanup:#{@cleanup[prod]}") { get_token.inspect + (@recovering ? ' recovering' : '')} + progress("#{prod}(:start}:#{@prod_data.length}:cleanup:#{@cleanup[prod]}") { get_token.inspect + (@recovering ? ' recovering' : '')} else # Make sure we push as many was we pop, even if there is no # explicit start handler @prod_data << {} if self.class.production_handlers[prod] - debug("#{prod}(:start:#{@prod_data.length})") { get_token.inspect + (@recovering ? ' recovering' : '')} + progress("#{prod}(:start:#{@prod_data.length})") { get_token.inspect + (@recovering ? ' recovering' : '')} end #puts "prod_data(s): " + @prod_data.inspect end