From 2ebce3411b7399c0e9bb628353b6646f2152bdc8 Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Sun, 13 Oct 2002 22:45:34 +0000 Subject: [PATCH] Make #error also expand variables, like #expand (makes things easier to debug) git-svn-id: svn://10.0.0.236/trunk@131933 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/config/preprocessor.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mozilla/config/preprocessor.pl b/mozilla/config/preprocessor.pl index d56ad49aaae..d9c8b01a01f 100755 --- a/mozilla/config/preprocessor.pl +++ b/mozilla/config/preprocessor.pl @@ -267,6 +267,12 @@ sub filter { $self->{'filters'}->{$filter} = $value; } +sub expand { + my $self = shift; + my($line) = @_; + $line =~ s/__(\w+)__/$self->get($1)/gose; + return $line; +} ######################################################################## @@ -378,16 +384,15 @@ sub error { my $stack = shift; return if $stack->disabled; die "argument expected\n" unless @_; - local $" = ' '; - die "@_\n"; + my $line = $stack->expand(@_); + die "$line\n"; } sub expand { my $stack = shift; return if $stack->disabled; die "argument expected\n" unless @_; - my $line = shift; - $line =~ s/__(\w+)__/$stack->get($1)/gose; + my $line = $stack->expand(@_); print "$line\n"; }