I am building a small HTML parser in Rust using syn
and proc_macro2
.
I have made it so far that i can parse regular HTML tags and it's attributes
So for example
html!(
<div>
<image></image>
</div>
)
Works
But i would like to parse some JSX
style code aswell, so something like this
html!(
<div>
{
(0..3).map(|| html!(<text value="new"></text>))
}
</div>
)
Here is my problem, i can't figure out how to parse the code between the brackets inside my macro_code, i would like to get Vector
with just <text></text>
elements.
Here is a playground example
html!(..)
instead ofhtml! { .. }
with proc macros? Don't proc macros always have to be wrapped in braces and not in parens? – balanceglove2