Skip to content

Implement pretty-printer #29

@LPTK

Description

@LPTK

The legacy IRs implemented pretty-printing by converting the code into a Scala AST and then using the Scala pretty-printer!
Not ideal because it's slow, and because Scala's pretty-printer can be glitchy.
The new pretty-printer should:

  • break lines only if necessary (can take inspiration from this);
  • print variables as original name + '_' + counter starting from 0 (to avoid clashes);
  • ideally, have a notion of precedence and associativity to avoid some parentheses;
  • ideally, be reusable (implemented as a Base), but with hooks to help print virtualized constructs such as if then else correctly (instead of as squid.lib.IfThenElse).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions