Skip to content
New issue

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

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

Already on GitHub? # to your account

Add AST annotations #276

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add AST annotations #276

wants to merge 1 commit into from

Conversation

TravisCardwell
Copy link
Collaborator

@TravisCardwell TravisCardwell commented Nov 13, 2024

Issue: #256

This WIP implementation has one pass named Parsed and unit annotations. We probably do not want to merge without implementing realistic passes/annotations, so this PR is created as a draft.

Note that many tests currently fail because the fixtures have not been updated to include the annotations.

@edsko
Copy link
Collaborator

edsko commented Nov 14, 2024

After discussing this with @TravisCardwell , we decided to go a slightly different route, which would make the "infrastructure" (such as it is) more generally applicable to all phases in hs-bindgen:

-- | All passes in hs-bindgen (from parsing C to final generation)
data Pass = ...

-- closed!
type family Ann (p :: Pass) (a :: Star) where
  Ann Parsed a = AnnParsed a
  Ann p a = () -- All annotations of all types default to ()

type family AnnParsed a -- could be open or closed, doesn't matter
  
deriving stock instance (forall p. Show (Ann "Foo" p)) => Show (Foo p)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants