Skip to content

Commit

Permalink
Add informative/progress output for entry to productions as well as e…
Browse files Browse the repository at this point in the history
…xit.
  • Loading branch information
gkellogg committed Aug 28, 2024
1 parent cb49ee9 commit 98fec25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ebnf/ll1/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit 98fec25

Please sign in to comment.