Comments (8)
I forked the repo and added in nnkTemplateDef
to findOverrides
in cimport.nim
and added an extra case where findOverrides
is used so nnkTemplateDef
maps to nskTemplate
. And modified plugin.nim
so the nskTemplate
exists in cOverrides
. But I don't see it in my output file.
from nimterop.
I now see I have to modify ast2.nim
to handle my use case.
from nimterop.
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.
from nimterop.
I don't follow. If I just define TM_VERSION
in my generator it doesn't appear in my output, and tm_api_registory_api_version
still isn't defined in the output.
from nimterop.
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.
from nimterop.
Thanks, I switched the cOverride for TM_VERSION
to a proc, and I see it in the output now. That gets me a little closer to what I want, but I still want exprparser.nim
's processTSNode
to handle call_expression
so I can get the proper output for #define
s. I want to be able to automatically wrap
#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 call_expression
, and templates would be the only way to support the token pasting operator ##
and astToStr
for token stringification.
from nimterop.
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.
from nimterop.
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?
from nimterop.
Related Issues (20)
- nimterop/globals.nim(8, 18) Error: cannot open file: compiler/ast HOT 2
- using system tree-sitter HOT 6
- Parsing a global variable that's a pointer to an array of functions
- Structs mapped from C header need completeStruct pragma, otherwise sizeof doesn't work on those
- VM does not support 'cast' from tyFloat to tyFloat HOT 2
- [Question] Change build directory HOT 1
- Toast parsing comment as var HOT 4
- Building Failed with nimble. HOT 2
- [Question] Binding to OpenCV HOT 2
- Using nimterop in MSYS2 Bash environment on Windows HOT 3
- Header path handling on Windows HOT 3
- βuint16_t β What happened?
- Typedef function with an enum return type
- Support OpenBSD
- The nimterop good this reference documentation to convert small C project
- [Question] Nimterop, libnx and DevKitPro | sys/lock.h : No such file or directory HOT 1
- "cmd: not found" when building using mingw building a windows executable in linux
- ssing comma in the example
- Toast segfault with comment after define
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nimterop.