Skip to content

Commit

Permalink
Use new Pegex::Grammar / Pegex::Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Aug 31, 2011
1 parent ba41401 commit 6a61d7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 2 additions & 4 deletions lib/TestML/Compiler.pm
Expand Up @@ -4,7 +4,6 @@ use TestML::Base -base;
use TestML::Grammar;

has 'base';
has 'debug' => init => '$TestML::Compiler::Debug';

sub compile {
my $self = shift;
Expand All @@ -21,11 +20,10 @@ sub compile {

my ($code, $data) = @$result{qw(code data)};

my $debug = $self->debug;
$debug = $result->{DebugPegex} if defined $result->{DebugPegex};
# my $debug = $self->debug;
# $debug = $result->{DebugPegex} if defined $result->{DebugPegex};
my $grammar = TestML::Grammar->new(
receiver => TestML::Receiver->new,
debug => $debug,
);
$grammar->parse($code, 'code_section')
or die "Parse TestML code section failed";
Expand Down
3 changes: 2 additions & 1 deletion lib/TestML/Grammar.pm
@@ -1,7 +1,8 @@
package TestML::Grammar;
use base 'Pegex::Grammar';
use strict;

sub build_tree {
sub tree_ {
return +{
'+top' => 'TOP',
'NEVER' => {
Expand Down
3 changes: 2 additions & 1 deletion src/grammar.pl
Expand Up @@ -6,8 +6,9 @@
print <<"...";
package TestML::Grammar;
use base 'Pegex::Grammar';
use strict;
sub build_tree {
sub tree_ {
return +$perl;
}
Expand Down

0 comments on commit 6a61d7a

Please sign in to comment.