Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decl printing cleanup #5578

Merged
merged 3 commits into from
Feb 13, 2025
Merged

Decl printing cleanup #5578

merged 3 commits into from
Feb 13, 2025

Conversation

ChrisPenner
Copy link
Contributor

@ChrisPenner ChrisPenner commented Feb 12, 2025

Overview

Previously:

ability some.nested.Thing where theThing : Nat ->{some.nested.Thing} Int

Now:

ability some.nested.Thing where
  theThing : Nat ->{Thing} Int

Implementation notes

  • Remove the PPE modifier for printing Decls which forces the FQN for all self-references. I believe it's no longer necessary now that the parser can look up constructors/abilities by suffix.
    • If there's an ambiguity the suffixifier will kick in and disambiguate just like it does everywhere else.
  • Force a newline after where in GADTs, it looks awkward without it.

Test coverage

  • I round-tripped base.
  • Tested situations where multiple abilities had the same suffix; the pretty-printer still disambiguates as expected.

Loose ends

  • Deploy this to share

@ChrisPenner ChrisPenner marked this pull request as ready for review February 12, 2025 19:05
Copy link
Contributor

@aryairani aryairani left a comment

Choose a reason for hiding this comment

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

@mitchellwrosen Any thoughts on this?

Remove the PPE modifier for printing Decls which forces the FQN for all self-references. I believe it's no longer necessary now that the parser can look up constructors/abilities by suffix.

@aryairani aryairani merged commit 7d74227 into trunk Feb 13, 2025
32 checks passed
@aryairani aryairani deleted the cp/decl-printing branch February 13, 2025 14:44
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