fix: parsing of attributes without trailing commas

This commit is contained in:
Jonathan Kelley committed 2022-12-12 11:18:36 -08:00
1 parent 6fd5ac38bb
commit d160f38bc2
2 files changed
+7 -2

No files matched your search

+1 -2
View File
@@ -45,7 +45,7 @@ impl Parse for Element {
content.parse::<Token![:]>()?;
if content.peek(LitStr) && content.peek2(Token![,]) {
if content.peek(LitStr) {
let value = content.parse()?;
attributes.push(ElementAttrNamed {
el_name: el_name.clone(),
@@ -53,7 +53,6 @@ impl Parse for Element {
});
} else {
let value = content.parse::<Expr>()?;
attributes.push(ElementAttrNamed {
el_name: el_name.clone(),
attr: ElementAttr::CustomAttrExpression { name, value },