jnthn / grammar-debugger

Grammar::Debugger and Grammer::Tracer Perl 6 modules
36 stars 20 forks source link

Added the ability to toggle tracer output at runtime. #41

Open Digicrat opened 5 years ago

Digicrat commented 5 years ago

This exports a new function from the Grammar::Trace class, "GrammarTraceMode($mode)", to allow toggling trace output at runtime. Supported options are Always (default, matching existing behavior), Never, or Error. In the latter case, the trace will be output only if the Grammar failed to find a match.

This commit builds upon changes made by nkh to cleanup rendering, though that discrete commit has been squashed due to merge conflicts.