Permalink
Browse files

* Build a standalone ::Parser so we no longer depend on Parse::Yapp

* Regenerate Parser.pm during `make', not Makefile.PL, and only if P::Y exists
* Use Parse::Yapp's perl API instead of depending on `yapp'
* Version 0.37
  • Loading branch information...
1 parent 209f48b commit 46d1f10b0fba091f3db801196a97563d2248b401 @nelhage committed Apr 16, 2008
Showing with 38 additions and 5 deletions.
  1. +1 −1 MANIFEST.SKIP
  2. +1 −1 META.yml
  3. +3 −2 Makefile.PL
  4. +32 −0 build/regen_parser.pl
  5. +1 −1 lib/Data/SExpression.pm
View
@@ -1,9 +1,9 @@
~$
^Makefile([.]old)?$
^blib/
-^lib/Data/SExpression/Parser.pm$
^MANIFEST[.]bak$
^MANIFEST[.]SKIP$
^test.pl$
^pm_to_blib$
^Data-SExpression-[\d.]+.tar.gz$
+^\.git
View
@@ -12,9 +12,9 @@ meta-spec:
name: Data-SExpression
no_index:
directory:
+ - build
- inc
- t
requires:
Class::Accessor::Fast: 0
- Parse::Yapp: 0
version: 0.36
View
@@ -6,14 +6,15 @@ license('Perl');
version_from('lib/Data/SExpression.pm');
requires('Class::Accessor::Fast');
-requires('Parse::Yapp');
build_requires('Test::More');
build_requires('Test::Deep');
postamble(<<"END_MAKEFILE");
lib/Data/SExpression/Parser.pm: lib/Data/SExpression/Parser.yp
-\tyapp -m Data::SExpression::Parser -o \$@ \$<
+\t\$(PERL) build/regen_parser.pl
END_MAKEFILE
+no_index directory => 'build';
+
WriteAll;
View
@@ -0,0 +1,32 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+=head1 DESCRIPTION
+
+Regenerate lib/Data/SExpression/Parser.pm from Parser.yp using
+Parse::Yapp
+
+This script is used during the build process instead of depending on
+being able to locate `yapp'.
+
+=cut
+
+my $INFILE = "lib/Data/SExpression/Parser.yp";
+my $OUTFILE = "lib/Data/SExpression/Parser.pm";
+my $PACKAGE = "Data::SExpression::Parser";
+
+eval "use Parse::Yapp";
+if($@) {
+ warn "Parse::Yapp uninstalled, unable to regenerate Parse.pm.\n";
+ exit 0;
+}
+
+my $parser = Parse::Yapp->new(inputfile => $INFILE);
+
+open(my $out, ">", $OUTFILE);
+
+print $out $parser->Output(classname => $PACKAGE,
+ standalone => 1);
+
+close($out);
View
@@ -3,7 +3,7 @@ use strict;
package Data::SExpression;
-our $VERSION = '0.36';
+our $VERSION = '0.37';
=head1 NAME

0 comments on commit 46d1f10

Please sign in to comment.