Skip to content

Conversation

@timsueberkrueb
Copy link
Contributor

@timsueberkrueb timsueberkrueb commented Dec 1, 2025

In #1181 we made the core pretty printer a lot more verbose in order to enable re-parsing. However, the additional verbosity hinders human inspection and debugging. This PR aims to mitigate this by splitting the core pretty printer in two instances:

  • ReparsablePrettyPrinter is fully verbose and can be re-parsed with core.Parser
  • HumanReadablePrettyPrinter is less verbose (and thus more readable) but cannot be re-parsed

// For many purposes, we would like to include the user-annotated name in the fresh id,
// so that printed terms are more readable.
// However, we do not want to include it when checking for alpha-equivalence in tests.
val userPart = if preserveUserAnnotatedPrefix then userName else ""
Copy link
Contributor Author

@timsueberkrueb timsueberkrueb Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably get rid of this by moving the userName logic to idFor. We need to be careful with this, though, as idFor is also used by core.Parser.

@timsueberkrueb timsueberkrueb changed the title WIP: Make pretty-printed core more readable Make pretty-printed core more readable Dec 1, 2025
@timsueberkrueb timsueberkrueb marked this pull request as ready for review December 1, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants