commure / sourcegen

🐠Like procedural macro, but generates sources! 🐡
Apache License 2.0
30 stars 4 forks source link

🔖Allow generating plain comments via the identifier trick #23

Closed idubrov closed 4 years ago

idubrov commented 4 years ago

Adding a struct that can be quote!-ed to produce a plain Rust comment. Internally, it generates a magic identifier and a string literal after it. When we render token stream, we match on this identifier and append a plain Rust comment to the output stream (and then let the rustfmt to do the formatting in the end).

Closes #3