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
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user