Skip to content

Splice export modifications precisely when using CPP#4981

Merged
crtschin merged 4 commits into
haskell:masterfrom
crtschin:crtschin/export-2-export-cpp
Jun 20, 2026
Merged

Splice export modifications precisely when using CPP#4981
crtschin merged 4 commits into
haskell:masterfrom
crtschin:crtschin/export-2-export-cpp

Conversation

@crtschin

@crtschin crtschin commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Builds on top of #4952 and handles CPP somewhat gracefully.

If possible, we stick with ghc-exactprint. When we encounter a CPP directive in the export list, which is invisible to ghc-exactprint, we fallback to using direct text splicing. In this case we only follow the active branch in the CPP conditional.

A lot of this is tests... something about combinatorics and edgecases.

@crtschin crtschin force-pushed the crtschin/export-2-export-cpp branch 2 times, most recently from 4cdd6cf to cd84c7c Compare June 19, 2026 23:06
@crtschin crtschin changed the title WIP: Splice export modifications precisely when using CPP Splice export modifications precisely when using CPP Jun 20, 2026
@crtschin crtschin marked this pull request as ready for review June 20, 2026 00:59

@fendor fendor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I reviewed the changes outside the hls-export-plugin, the tests look sane, please merge once you are ready or ping me on specific parts you want to discuss

@crtschin crtschin force-pushed the crtschin/export-2-export-cpp branch from cd84c7c to e5e4087 Compare June 20, 2026 13:06
@crtschin

Copy link
Copy Markdown
Collaborator Author

Thanks! I think it's alright, none of this is complicated.

@crtschin crtschin enabled auto-merge (squash) June 20, 2026 13:07
@crtschin crtschin merged commit cf59dc2 into haskell:master Jun 20, 2026
42 checks passed
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