Skip to content

Commit

Permalink
Remove Pegex bootstrapping from TestML
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Aug 27, 2011
1 parent bf3545a commit 4b8b716
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion lib/TestML/Grammar.pm
@@ -1,6 +1,5 @@
package TestML::Grammar;
use base 'Pegex::Grammar';
# use base 'Pegex::Grammar::Bootstrap';

sub build_tree {
return +{
Expand Down
9 changes: 9 additions & 0 deletions lib/TestML/Runtime/TAP.pm
Expand Up @@ -3,6 +3,15 @@ use TestML::Runtime -base;

use Test::Builder;

if ($TestML::Test::Differences) {
no warnings 'redefine';
require Test::Differences;
*Test::Builder::is_eq = sub {
my $self = shift;
\&Test::Differences::eq_or_diff(@_);
};
}

has 'test_builder' => -init => 'Test::Builder->new';

sub title {
Expand Down
15 changes: 2 additions & 13 deletions src/grammar.pl
@@ -1,26 +1,15 @@
# XXX This code currently depends on too much bootstrapping stuffs.
use Pegex::Compiler;

use lib "../../pegex-pm/lib";
# use Pegex::Compiler;
use Pegex::Compiler::Bootstrap;

open IN, shift or die;
my $testml = do {local $/; <IN>};
# my $pegex = Pegex::Compiler->new;
my $pegex = Pegex::Compiler::Bootstrap->new;
$pegex->compile($testml);
my $perl = $pegex->to_perl;
my $perl = Pegex::Compiler->compile_file(shift)->to_perl;
chomp($perl);

print <<"...";
package TestML::Grammar;
use base 'Pegex::Grammar';
# use base 'Pegex::Grammar::Bootstrap';
sub build_tree {
return +$perl;
}
1;
...

0 comments on commit 4b8b716

Please sign in to comment.