4 ms·
https://github.com/facebook/pfff https://github.com/facebook/pfff is a tool which support pretty printing a bunch of different languages (currently c, c++, java
by amenghra 10y ago
https://github.com/facebook/pfff https://github.com/facebook/pfff is a tool which support pretty printing a bunch of different languages (currently c, c++, java, js, php, python, rust, and a bunch more).
The idea is to have a common AST (with parsers for each language) which keeps track of whitespace/comments/etc and then share a ton of logic by writing writing code at the AST layer.
You can use pfff to pretty print according to your style needs. Also supports a bunch of other neat things such as search/replace.
- bastih 10y agoI've looked at pfff and couldn't really figure out what's supposed to work and what isn't. Would love to pretty print python with it. (I've been looking at the many different pretty printers in the python world and haven't found anything that I feel works well enough). Did you use it for pretty printing python?