I am writing a little JSX-like parser with syn
and proc_macro2
.
Parsing the Nodes and Attributes is working fine, but i don't understand how to implement the inline functions.
For example, i compile the array between brackets and can forward the quote!
tokens into my parser.
parse_node(
quote!(<element>
{
(0..3).map(|| quote!(<text value="new"></text>))
}
</element>
)
)
Currently i get the map function as tokens too, but is it possible to convert it into rust code immediately without parsing?
https://github.com/tonis2/html_lexer/blob/master/src/parser.rs#L116