Feat: reject invalid keys

This commit is contained in:
Jonathan Kelley committed 2024-03-07 16:03:00 -08:00
1 parent 6faa51a4a9
commit ae352f8958
6 files changed
+40 -23

No files matched your search

+7 -1
View File
@@ -169,7 +169,13 @@ impl Parse for Element {
},
}));
} else if name_str == "key" {
key = Some(content.parse()?);
let _key: IfmtInput = content.parse()?;
if _key.is_static() {
invalid_key!(_key);
}
key = Some(_key);
} else {
let value = content.parse::<ElementAttrValue>()?;
attributes.push(attribute::AttributeType::Named(ElementAttrNamed {