LukasKalbertodt / bunt

Simple macros to write colored and formatted text to a terminal. Based on `termcolor`, thus also cross-platform.
Apache License 2.0
224 stars 7 forks source link

Research how to get rid of `syn` with `full` feature dependency #4

Closed LukasKalbertodt closed 4 years ago

LukasKalbertodt commented 4 years ago

This adds quote a bit of compile time. I don't even need Rust AST types or anything. The only reason for syn is to parse an expression delimited by a comma. I.e. $foo:expr , in declarative macro syntax. But I don't really inspect the expression and just treat it as token stream. It's not trivial to parse that yourself, however. Take write!(foo(a, b), ".."): you can't stop after the first comma.