Allow unknown field attributes in record.dbd files

They will be noisy, but are retained in regenerated output and
won't stop the build from proceeding.
This commit is contained in:
Andrew Johnson
2014-08-28 14:12:28 -07:00
parent f40c25723d
commit 267ed50dc7

View File

@@ -76,11 +76,15 @@ sub add_attribute {
my ($this, $attr, $value) = @_;
unquote $value;
my $match = $field_attrs{$attr};
dieContext("Unknown field attribute '$1', valid attributes are:",
sort keys %field_attrs)
unless defined $match;
dieContext("Bad value '$value' for field '$attr' attribute")
unless $value =~ m/$match/;
if (defined $match) {
dieContext("Bad value '$value' for field attribute '$attr'")
unless $value =~ m/$match/;
}
else {
warnContext("Unknown field attribute '$attr' with value '$value'; " .
"known attributes are:",
join(", ", sort keys %field_attrs));
}
$this->{ATTR_INDEX}->{$attr} = $value;
}