gccrs
gccrs copied to clipboard
expand: eager evaluate macros inside builtin macros
- expand: eagerly evaluate the macros inside some of the builtin macros
The current code is a total mess, I know.
The issue was I discovered some issues in the parser that sometimes parse the expressions incorrectly mid-implementation. So some duck-tape code was thrown in to avoid crashing the parser and ensure no apparent regression was detected by the test suite.
I still opened a PR anyways because I want to collect feedback regarding how to drag the declarative macro expander into the built-in macro expansion. My current approach is to save the expander
to MacroInvocData
so that it can be picked up in the built-in expander along with the invocation data.
Refactored macro expansion and extraction code
I think overall this is a very cool PR! Thank you so much for working on this :) Would it be possible to add test-cases or is that not yet possible?
It's possible, but I want to get the code to pass the review first, and then I will see how brutal the test cases should be :smile:
LGTM! @liushuyu I think this is in a good state to merge now code-wise - I would just like some tests to make sure everything works well and that I can hack on it without fear of breaking anything :DD As soon as there's some we'll merge it :)
I can add some test cases. But it's very late in my timezone at the moment, so probably tomorrow.
LGTM! @liushuyu I think this is in a good state to merge now code-wise - I would just like some tests to make sure everything works well and that I can hack on it without fear of breaking anything :DD As soon as there's some we'll merge it :)
I can add some test cases. But it's very late in my timezone at the moment, so probably tomorrow.
Sounds good! Sorry again for the delay, was a crazy two weeks. Thanks for working on this I really appreciate it.
Rebased against the latest master
branch and add a testcase.