✨ (macros): Evita duplicar splices de attr en html!
This commit is contained in:
parent
ed30b2ae17
commit
05187c9343
1 changed files with 11 additions and 0 deletions
|
|
@ -206,6 +206,7 @@ impl DiagnosticParse for Element {
|
||||||
},
|
},
|
||||||
attrs: {
|
attrs: {
|
||||||
let mut id_pushed = false;
|
let mut id_pushed = false;
|
||||||
|
let mut splice_pushed = false;
|
||||||
let mut attrs = Vec::new();
|
let mut attrs = Vec::new();
|
||||||
|
|
||||||
while input.peek(Ident::peek_any)
|
while input.peek(Ident::peek_any)
|
||||||
|
|
@ -226,6 +227,16 @@ impl DiagnosticParse for Element {
|
||||||
id_pushed = true;
|
id_pushed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Attribute::Splice { .. } = attr {
|
||||||
|
if splice_pushed {
|
||||||
|
return Err(Error::new_spanned(
|
||||||
|
attr,
|
||||||
|
"only one spliced attribute value is allowed per element",
|
||||||
|
));
|
||||||
|
}
|
||||||
|
splice_pushed = true;
|
||||||
|
}
|
||||||
|
|
||||||
attrs.push(attr);
|
attrs.push(attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue