Bugfix: In old style subst, undefed macros were taken from previous line.

Feature: Errors show both locations, in template and in subst file
This commit is contained in:
zimoch
2009-07-16 10:11:23 +00:00
parent dd6bba07ea
commit eb25ca0200

View File

@@ -97,6 +97,7 @@ sub parseTemplate {
} else {
while (parseRecord) {};
}
return 1;
}
sub parseSubst {
@@ -113,6 +114,7 @@ sub parseSubst {
if ($_ eq "{") {
# old style substitution
do {
local %subst;
while (1) {
my $macro;
do {
@@ -122,7 +124,7 @@ sub parseSubst {
expect "=", "$STRING|$SUBST value for $macro";
$subst{$macro} = $_;
}
parseTemplate $filename;
eval {parseTemplate $filename} or die "$@called from $ARGV line $.\n";
expect "{|} '{' or '}'";
} while $_ eq "{";
} else {
@@ -147,7 +149,7 @@ sub parseSubst {
$subst{$macro} = $_;
}
expect "}";
parseTemplate $filename;
eval {parseTemplate $filename} or die "$@called from $ARGV line $.\n";
};
}
return 1;