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

New preprocessor, work in progress #719

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Conversation

ehaas
Copy link
Collaborator

@ehaas ehaas commented Jul 6, 2024

This is a rewrite of the Preprocessor, based on the algorithm described in https://www.spinellis.gr/blog/20060626/cpp.algo.pdf

Main inspiration was that the existing one doesn't work with some more esoteric cases, such as https://github.com/Hirrolot/metalang99 and was having trouble figuring out why.

Right now it's hidden behind a flag -fnew-preprocessor, and it only preprocesses; it isn't tied into the parser at all. And there is still a lot of work to do - currently I'm not handling expansion locations at all, and there are lots of missing smaller features + probably lots of memory leaks.

One big improvement is using a persistent treap for hideset management, which massively reduces the amount of copying when adding items to a set or performing union/intersection operations.

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.

1 participant