Open atgreen opened 1 year ago
Added a commit to export load-templates
.
Inserting additional newlines is probably beyond the capabilities of this library. It doesn't actually parse the code, so it would probably have a hard time deciding how to structure a lisp form.
For that you would need to parse the code and pretty print it. The stock pretty printer won't be able to print comments since those are not retained by the reader. To do that you'd need an extension to the pretty printer that could skip/print items that were read into an AST. I have done this as a "proof of concept" using Eclector and my in-progress pretty printer Inravina (which I am writing for SICL and maybe Clasp). It can be loaded extrinsically so eventually you could do something like this outside of the Lisp implementation's pretty printer.
Thank you for this great library! I'm using it in a transpiler project where I'm creating CL code and don't want to worry about formatting during codegen.
A couple of feature requests:
It would be nice if there was a way to set the max line width, and have indenter introduce new lines when appropriate.
It would be nice if load-templates was exported, as I want to feed it new templates , but not from a file. This is a minor thing, as I can always use (indentify::load-templates +my-templates+).