|
@@ -63,12 +63,8 @@ impl Parse for Element {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- // todo: add a message saying you need to include commas between fields
|
|
|
if content.parse::<Token![,]>().is_err() {
|
|
|
- proc_macro_error::emit_error!(
|
|
|
- ident,
|
|
|
- "this attribute is missing a trailing comma"
|
|
|
- )
|
|
|
+ missing_trailing_comma!(ident);
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
@@ -126,10 +122,7 @@ impl Parse for Element {
|
|
|
|
|
|
// todo: add a message saying you need to include commas between fields
|
|
|
if content.parse::<Token![,]>().is_err() {
|
|
|
- proc_macro_error::emit_error!(
|
|
|
- ident,
|
|
|
- "this attribute is missing a trailing comma"
|
|
|
- )
|
|
|
+ missing_trailing_comma!(ident);
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
@@ -139,33 +132,11 @@ impl Parse for Element {
|
|
|
|
|
|
while !content.is_empty() {
|
|
|
if (content.peek(LitStr) && content.peek2(Token![:])) && !content.peek3(Token![:]) {
|
|
|
- let ident = content.parse::<LitStr>().unwrap();
|
|
|
- let name = ident.value();
|
|
|
- proc_macro_error::emit_error!(
|
|
|
- ident, "this attribute `{}` is in the wrong place", name;
|
|
|
- help =
|
|
|
-"all attribute fields must be placed above children elements
|
|
|
-
|
|
|
- div {
|
|
|
- attr: \"...\", <---- attribute is above children
|
|
|
- div { } <---- children are below attributes
|
|
|
- }";
|
|
|
- )
|
|
|
+ attr_after_element!(content.span());
|
|
|
}
|
|
|
|
|
|
if (content.peek(Ident) && content.peek2(Token![:])) && !content.peek3(Token![:]) {
|
|
|
- let ident = content.parse::<Ident>().unwrap();
|
|
|
- let name = ident.to_string();
|
|
|
- proc_macro_error::emit_error!(
|
|
|
- ident, "this attribute `{}` is in the wrong place", name;
|
|
|
- help =
|
|
|
-"all attribute fields must be placed above children elements
|
|
|
-
|
|
|
- div {
|
|
|
- attr: \"...\", <---- attribute is above children
|
|
|
- div { } <---- children are below attributes
|
|
|
- }";
|
|
|
- )
|
|
|
+ attr_after_element!(content.span());
|
|
|
}
|
|
|
|
|
|
children.push(content.parse::<BodyNode>()?);
|