New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Makefile.PL way to rebuild `Grammar` class #62

Closed
wants to merge 1 commit into
base: master
from
Jump to file or symbol
Failed to load files and symbols.
+16 −0
Diff settings

Always

Just for now

View
@@ -195,6 +195,8 @@ This command found the file where your grammar is, compiled it, and used
This is what a compiled Pegex grammar looks like. As soon as this module is
loaded, the grammar is ready to be used by Pegex.
=== Automatically rebuilding during development with environment variable
If you find yourself needing to compile your grammar module a lot during
development, just set this environment variable like so:
@@ -206,6 +208,20 @@ to be recompiled, and do it on the fly.
If you have more than one grammar to recompile, just list all the names
separated by commas.
=== Automatically rebuilding during development using `make`
Alternatively, if your module uses `ExtUtils::MakeMaker`, you can have `make`
automatically rebuild your `Grammar` class if your `.pgx` file is updated.
Simply add this at the bottom of your `Makefile.PL`:
sub MY::postamble {
<<EOF;
lib/MyThing/Grammar.pm : share/expr.pgx
\t\$(PERL) -Ilib -MMyThing::Grammar=compile
EOF
}
= See Also
* [Pegex::Parser]