Giter Club home page Giter Club logo

Comments (8)

geekrelief avatar geekrelief commented on July 1, 2024

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.

geekrelief avatar geekrelief commented on July 1, 2024

I now see I have to modify ast2.nim to handle my use case.

from nimterop.

genotrance avatar genotrance commented on July 1, 2024

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.

geekrelief avatar geekrelief commented on July 1, 2024

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.

genotrance avatar genotrance commented on July 1, 2024

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.

geekrelief avatar geekrelief commented on July 1, 2024

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 #defines. 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.

genotrance avatar genotrance commented on July 1, 2024

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.

geekrelief avatar geekrelief commented on July 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.