jnthn / grammar-debugger

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

Using .parse twice on the same Grammar does not work when using Tracer #32

Open rogbro opened 7 years ago

rogbro commented 7 years ago

Example :

use v6.c;
use Grammar::Tracer;

grammar MyGr {
    token TOP { 'A' | 'B' }
}

my $mo = MyGr.parse('A');
say $mo;

my $mo2 = MyGr.parse('B');
say $mo2;

gives this output

TOP
* MATCH "A"
「A」
TOP
* MATCH "A"
「A」

When commenting the "use Grammar::Tracer" line, I get the expected output with B match.

「A」
「B」