erlfmt
erlfmt copied to clipboard
Print literal value instead of crashing on missing text annotation
This allows you to format syntax trees that have been synthesized outside erlfmt without forcing the caller to add "text" annotations for all literals in order to print them.
Would it be possible to parse the AST and transform it to include these "text" annotations, before passing it back to erlfmt?
Or include a test with an explanation comment, so that we do not simplify this code later by accident?
It is of course possible, just a bit annoying and expensive to do an extra pass rewriting the whole AST for this.
If it is too much effort to have an extra pass over the AST, consider adding a test, with a comment that explains why this is necessary, to make sure we do not regress and remove this change when thinking we are cleaning things up.
This is probably go to merge, just need a test. Do you want to add a test or maybe we can add one for you?