Skip to content
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

Any way to output raw nim? #37

Open
fullofcaffeine opened this issue May 5, 2019 · 3 comments
Open

Any way to output raw nim? #37

fullofcaffeine opened this issue May 5, 2019 · 3 comments

Comments

@fullofcaffeine
Copy link

fullofcaffeine commented May 5, 2019

Hey!

Wondering if there's a way to output raw nim, akin to what untyped __js__ allows for the JS target. Considering this is not a real target, maybe you'd need to create a custom macro method for this?

@fullofcaffeine fullofcaffeine changed the title Any ways to output raw nim? Any way to output raw nim? May 5, 2019
@Grabli66
Copy link
Collaborator

Grabli66 commented May 6, 2019

I think it's possible. Need to investigate that.
I'll add it to my roadmap.

@fullofcaffeine
Copy link
Author

fullofcaffeine commented May 6, 2019

I'm not very well-versed in macros, but I guess you could support the following syntax:

untyped __nim__()

I think __nim__ is valid Haxe syntax, you could then interpret it in the macro any way you want. Not sure if untyped is really needed either, but I added it here because it seems to be the convention before magic funcs.

@Grabli66
Copy link
Collaborator

Grabli66 commented May 7, 2019

https://github.com/RapidFingers/CraxeExamples/tree/master/RawNimCode

Syntax:
Nim.code("Raw nim code");

It just works. Nothing more. Macro does not parse anything. Just gets input string and paste it in output code. Any suggestions are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants