Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/Pegex/API.swim
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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]
Expand Down