|
|
@ -102,20 +102,32 @@ use super::*;
|
|
|
|
let attr_inner_value = f.tokens.to_string();
|
|
|
|
let attr_inner_value = f.tokens.to_string();
|
|
|
|
if !attr_inner_value.starts_with("( default")
|
|
|
|
if !attr_inner_value.starts_with("( default")
|
|
|
|
&& !attr_inner_value.starts_with("( default =")
|
|
|
|
&& !attr_inner_value.starts_with("( default =")
|
|
|
|
|
|
|
|
&& !attr_inner_value.starts_with("(default")
|
|
|
|
|
|
|
|
&& !attr_inner_value.starts_with("(default =")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return Some(new_attr);
|
|
|
|
return Some(new_attr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if attr_inner_value.starts_with("( default =") {
|
|
|
|
if attr_inner_value.starts_with("( default =")
|
|
|
|
|
|
|
|
|| attr_inner_value.starts_with("(default =")
|
|
|
|
|
|
|
|
{
|
|
|
|
let rest = g.stream().into_iter().skip(4);
|
|
|
|
let rest = g.stream().into_iter().skip(4);
|
|
|
|
new_attr.tokens = quote! { ( #(#rest)*) };
|
|
|
|
new_attr.tokens = quote! { ( #(#rest)*) };
|
|
|
|
if new_attr.tokens.to_string().as_str() == "( )" {
|
|
|
|
match new_attr.tokens.to_string().as_str() {
|
|
|
|
return None;
|
|
|
|
"( )" | "()" => {
|
|
|
|
|
|
|
|
return None;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if attr_inner_value.starts_with("( default") {
|
|
|
|
} else if attr_inner_value.starts_with("( default")
|
|
|
|
|
|
|
|
|| attr_inner_value.starts_with("(default")
|
|
|
|
|
|
|
|
{
|
|
|
|
let rest = g.stream().into_iter().skip(2);
|
|
|
|
let rest = g.stream().into_iter().skip(2);
|
|
|
|
new_attr.tokens = quote! { ( #(#rest)*) };
|
|
|
|
new_attr.tokens = quote! { ( #(#rest)*) };
|
|
|
|
if new_attr.tokens.to_string().as_str() == "( )" {
|
|
|
|
match new_attr.tokens.to_string().as_str() {
|
|
|
|
return None;
|
|
|
|
"( )" | "()" => {
|
|
|
|
|
|
|
|
return None;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|