-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
getCustomPragma is split up in more usable chunks #11526
Conversation
4dd8121
to
4debbb9
Compare
This needs a |
4debbb9
to
aab67f8
Compare
Here is the stack trace I get when using this code in my serializer: https://gist.github.com/dom96/af8e3e919d2bb7ed503a4356913faea9 |
aab67f8
to
460e1f1
Compare
I don't get it. When I run all tests locally, there is one test failing in IC. But when I run category IC only, then there is nothing failing. output of all tests: http://ix.io/1RkI (fail in category IC) Also the CI integration here on the servers tells a very different story. |
Awesome, finally someone made it a compile time proc instead of a macro. @krux02 <3 |
@B3liever yes that was the intention. |
@Araq, this PR should have been merged long ago. |
No RFC process, no explanation what it does. It should have had an explanation a long time ago. |
@Araq: This PR enables to read custom pragma annotations from the Nim macro system. |
I'm taking over |
@Clyybber IIUC this duplicates the logic in the compiler, which is guaranteed to be fragile; instead why not simply add a magic to avoid duplicating logic and guaranteeing results match what the compiler does? |
@Clyybber, if you are interested in getting this to work, you might try applying it here: I've found You can consider |
@timotheecour @zah After 5cde03e it works fine (testsuite of nim-json-serialization passes); I replaced the code snippet you mentioned with
|
@Clyybber, nice! Looking forward to start using this in the next release |
Is this going in soon? |
Celebrating first anniversary of unmerged but finished PR. Test failure unrelated. |
8690cf9
to
bc73646
Compare
of nnkSym: | ||
result = getCustomPragmaNode(typeSym, name) | ||
of nnkProcTy: | ||
# It is a bad idea to support this. The annotation can't be part |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then can we not support it?
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* getCustomPragma is split up in more usable chunks * changelog entry * fix for style checks * shitty typedesc special casing * Add since annotation and remove typedesc comments * Fix typo * Revert since annotation because it breaks bootstrapping * Export getCustomPragmaNode conditionally * Reduce code duplication * Update since * Update lib/core/macros.nim * Apply suggestions from code review Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
rewrote the customPragma macros for more mudular use.