Conversation
I needed to make Ident a functor so that I could errase all annotations. This, however, had some side-effects that made refactor the AST in a breaking way. But now it is possible to derive 'functor' for all objects in the AST. The main changes are in `src/Language/C/Syntax/AST.hs`
| -- the definition of the equality allows identifiers to be equal that are | ||
| -- defined at different source text positions, and aims at speeding up the | ||
| -- equality test, by comparing the lexemes only if the two numbers are equal | ||
| -- |
There was a problem hiding this comment.
I wonder if being polymorphic over the NodeInfo it would be worth removing the weirdy Eq/Ord instance. One could always do something like (==) `on` void to regain the old behavior.
There was a problem hiding this comment.
Yes! great catch! I think it would make sense to stay with the stock implementations.
|
Thanks! I'm all for this. What's left to do before dropping the WIP flag? |
Happy you like it :). The primary reason it is WIP is because I did not know if it was in the spirit of the repository, but now that you approve with the direction I think that what is missing, considering this is a already a breaking change, is:
Further more, I think that we could improve the code a little by, but that might fit better in another pull request:
|
7157fb1 to
94c0a86
Compare
8ac47c2 to
adc8883
Compare
afeaf38 to
d38cc70
Compare
Hi all,
Thanks for all the hard work you put into this package.
I was currently working on a project that produced C files, and I want to test that the Ast I create can be read again. However with the current setup it is very hard to compare two AST's.
This is only meant for inspiration, and should not be merged as is.
What I have done: