Skip to content

Commit

Permalink
More PEG parser progress output.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Sep 3, 2024
1 parent 98fec25 commit 8531d6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ebnf/peg/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def debug(*args, &block)
def onStart(prod)
handler = self.class.start_handlers[prod]
@productions << prod
debug("#{prod}(:start)", "",
progress("#{prod}(:start)", "",
lineno: (scanner.lineno if scanner),
pos: (scanner.pos if scanner)
) do
Expand Down Expand Up @@ -422,7 +422,7 @@ def onFinish(result)
@recovering = false
end
end
debug("#{prod}(:finish)", "",
progress("#{prod}(:finish)", "",
lineno: (scanner.lineno if scanner),
level: result == :unmatched ? 0 : 1) do
"#{result.inspect}@(#{scanner ? scanner.pos : '?'}), rest: #{scanner ? scanner.rest[0..20].inspect : '?'}"
Expand Down

0 comments on commit 8531d6d

Please sign in to comment.