This commit is contained in:
Xavier Guimard 2017-02-05 12:30:57 +00:00
parent 9e12c94234
commit 6cc7190df5

View File

@ -28,10 +28,10 @@ sub parse {
unless ( $rest =~ s/^\s*\bthen\b\s*// ) {
die('Bad combination: missing "then"');
}
unless( $rest =~ /(.*?)\s*\belse\b\s*(.*)$/ ) {
unless ( $rest =~ /(.*?)\s*\belse\b\s*(.*)$/ ) {
die('Bad combination: missing "else"');
}
($then,$else)=($1,$2);
( $then, $else ) = ( $1, $2 );
unless ($then) {
die('Bad combination: missing "then" content');
}
@ -46,7 +46,7 @@ sub parse {
die('Bad combination: bad then or else');
}
return sub {
my ( $req ) = @_;
my ($req) = @_;
return ( $cond->($req) ? $then : $else->($req) );
};
}
@ -103,7 +103,10 @@ sub parseBlock {
die "Bad expression: $expr";
}
my @res = ( $1, $2 || $1 );
@res = ($self->parseMod( $moduleList, 0, $res[0]),$self->parseMod( $moduleList, 1, $res[1]));
@res = (
$self->parseMod( $moduleList, 0, $res[0] ),
$self->parseMod( $moduleList, 1, $res[1] )
);
return \@res;
}