Skip to content

Instantly share code, notes, and snippets.

@pstuifzand
Created April 15, 2013 08:07
Show Gist options
  • Save pstuifzand/5386527 to your computer and use it in GitHub Desktop.
Save pstuifzand/5386527 to your computer and use it in GitHub Desktop.
If I call show_progress then lexeme_read doesn't work anymore.
P0 @0-0 [:start] -> . test
P1 @0-0 test -> . marker end
Can't locate object method "lexeme_read" via package "Marpa::R2::Recognizer" at t/show_progress.t line 20.
use 5.10.0;
use Marpa::R2 '2.051_009';
use Test::More;
my $g = Marpa::R2::Scanless::G->new({
default_action => '::array',
source => \<<'GRAMMAR',
:start ::= test
test ::= marker end
marker ~ '<<'
end ~ 'END'
GRAMMAR
});
my $re = Marpa::R2::Scanless::R->new({grammar => $g });
my $input = "<<END";
$re->read(\$input, 0, 0);
say $re->show_progress;
$re->lexeme_read('marker', 0, 2, '<<') // die;
$re->lexeme_read('end', 2, 3, 'END') // die;
ok(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment