diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-12-07 22:17:26 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-12-07 22:17:26 +0200 |
commit | 80da2c28a644a0640b8d167e31f28b43fc56a682 (patch) | |
tree | c1c7545065d3a81c93613b51483b50641fd84aaf /lib/Apache/Config/Preproc/macro.pm | |
parent | 31a64151b3f675322eb8eadb8bae9887e0f82941 (diff) | |
download | acpp-80da2c28a644a0640b8d167e31f28b43fc56a682.tar.gz acpp-80da2c28a644a0640b8d167e31f28b43fc56a682.tar.bz2 |
Provide a way to pass arguments to the phase constructors
* Makefile.PL: Lower the required Perl version. Update prerequisites
* lib/Apache/Config/Preproc.pm (new): Get rid of -server_root.
Don't save filename along with options.
(server_root): Remove.
(_preproc): Handle optional arguments in the module list.
(_preproc_section): Don't pass $self to expand. It should have
been saved by new, if the need be.
* lib/Apache/Config/Preproc/compact.pm (new): Update.
* lib/Apache/Config/Preproc/ifmodule.pm (new): Update.
New arguments: preloaded => [ list of loaded modules ], and
probe => $val.
* lib/Apache/Config/Preproc/include.pm (new): Optional argument
server_root.
(expand): Change signature.
* lib/Apache/Config/Preproc/macro.pm (new, expand): Change signature.
Diffstat (limited to 'lib/Apache/Config/Preproc/macro.pm')
-rw-r--r-- | lib/Apache/Config/Preproc/macro.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Apache/Config/Preproc/macro.pm b/lib/Apache/Config/Preproc/macro.pm index 34bdd2b..ab97b62 100644 --- a/lib/Apache/Config/Preproc/macro.pm +++ b/lib/Apache/Config/Preproc/macro.pm @@ -2,8 +2,10 @@ package Apache::Config::Preproc::macro; use strict; use warnings; use Text::ParseWords; +use Carp; sub new { + croak "too many arguments" unless @_ == 2; bless {}, shift } @@ -18,7 +20,7 @@ sub install_macro { } sub expand { - my ($self, $tree, $d, $repl) = @_; + my ($self, $d, $repl) = @_; if ($d->type eq 'section' && lc($d->name) eq 'macro') { $self->install_macro(Apache::Config::Preproc::macro::defn->new($d)); return 1; |