syn-powered parser for JSX-like TokenStreams
syn-powered parser for JSX-like TokenStreams, aka RSX. The parsed result is a nested Node structure, similar to the browser DOM, where node name and value are syn expressions to support building proc macros.
…You might want to check out the html-to-string-macro example as well.
Not opinionated
Every tag or attribute name is valid
Text nodes
Support for unquoted text is planned.
Node names separated by dash, colon or double colon
Node names with reserved keywords
Doctypes, Comments and Fragments
<>Braced blocks are parsed as arbitrary Rust code
| |__________________^Customization
A ParserConfig to customize parsing behavior is available, so if you have
slightly different requirements for parsing and it's not yet customizable
feel free to open an issue or pull request to extend the configuration.
One highlight with regards to customization is the transform_block
configuration, which takes a closure that receives raw block content as
ParseStream and lets you optionally convert it to a TokenStream. That makes it
possible to have custom syntax in blocks. More details in #9
No open issues yet, or sync has not completed.