dtolnay / cxx

Safe interop between Rust and C++
https://cxx.rs
Apache License 2.0
5.8k stars 325 forks source link

Consider implementing a basic C++ syntax tree #123

Open dtolnay opened 4 years ago

dtolnay commented 4 years ago

Currently https://github.com/dtolnay/cxx/blob/0.2.9/gen/write.rs is implemented by directly writing out fragments of C++ as text using write!.

It may be easier in the long run if we have this code generator build up an output syntax tree instead, then have a separate pass to pretty-print the syntax tree out as text.

dtolnay commented 4 years ago

Tagging help wanted for someone to help prototype what this might look like; not necessarily to convert the entire code generator up front but just enough to be able to assess how much of an improvement this might be.