tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
395 stars 111 forks source link

Pretty-printer refactored #1018

Closed verytactical closed 1 week ago

verytactical commented 2 weeks ago

Issue

This was a demo for makeVisitor, but then it unfortunately worked a bit better than expected, and several bugs were found.

If new AST node types and operators are added, but printer is not updated, there will be an error message now.

Architecture was ruggedized to enforce correct handling of indents and precedences whenever code changes (Precedence, ExprPrinter, Printer). Further details are in code comments.

Closes #1037 Closes #1038 Closes #1042 Closes #1043

Checklist