From 5dd6eee8aaeb6d499808173cb7e3afe8e2a182a0 Mon Sep 17 00:00:00 2001 From: mohawk2 Date: Sat, 27 May 2017 02:48:55 +0100 Subject: [PATCH] Add Makefile.PL way to rebuild `Grammar` class --- doc/Pegex/API.swim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/Pegex/API.swim b/doc/Pegex/API.swim index bc532a3..a2c0025 100644 --- a/doc/Pegex/API.swim +++ b/doc/Pegex/API.swim @@ -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 { + <