-
Notifications
You must be signed in to change notification settings - Fork 40
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
Inject code to process #define
?
#281
Comments
I forked the repo and added in |
I now see I have to modify |
You don't need to cOverride - can just define it in your nim file per usual. nimterpo will skip it anyway since it is unsupported and won't conflict with your definition. |
I don't follow. If I just define |
cOverride only supports const, type and proc declarations which is why the template info is not propagated. Maybe if you make it a proc, it will work. |
Thanks, I switched the cOverride for #define tm_api_registry_api_version TM_VERSION(0, 3, 0) And I'll probably have to work on a modification to allow templates in cOverride because The Machinery has lots of macros for example: #define tm_get_api(reg, TYPE) \
(struct TYPE *)reg->get(#TYPE, TYPE##_version nimterop ignores these because of the |
Although I'm not maintaining nimterop anymore, I'm totally open to PRs. However, the CI is not longer functional so if you are willing to take this on, hopefully you can help with the CI as well. |
I'm not sure I can take that on. I'm not familiar with the CI at all. I mean I only started looking at nimble because of nimterop. :) I was trying to upgrade treesitter to v0.20.0, but it wasn't as simple as swapping the branch. Where would I even begin with CI? |
I'm trying to wrap The Machinery which has versioned headers and uses a lot of defines for generating code.
An example is this:
Where:
The generated nim file has:
# const 'tm_api_registry_api_version' has unsupported value 'TM_VERSION(0, 3, 0)
Ideally I'd like to pass in my own template
TM_VERSION
sotm_api_registry_api_version
can be declared in my output file correctly like:I tried adding this to my generator:
But I get an
invalid indentation
error coming from the nimcache, cPlugin, nimterop nim file whereonSymbolOverride
is empty.Is there a way to do this or can I modify nimterop to allow for this?
The text was updated successfully, but these errors were encountered: