-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Code Cookbook example custom generator needed and problems #160
Comments
After writing the above I noticed that the |
Here is an update version of
Output:
|
And looking at the last output I can see that for If somehow we also manage to add the comments to the In my opinion ideally we should be able to regenerate the original Haxe code through this api, |
So now I have a clear view of what this
And the Code Cookbook should show a sample that does that. The sample should also be a test to detect any possible regression. |
Hey there! Thanks for figuring this out, it can be a nice to have an example generator in the cookbook as starting point for other people. It would be great if you create a pull request for the article. These are basically markdown pages. More about contributing articles can be found here https://github.com/HaxeFoundation/code-cookbook#creating-articles Other than that, to me it is not very clear if you have technical questions or just thinking out loud here? (which for me is fine too 😜 ) |
Trying to understand how to use
haxe.macro.Context.onGenerate(types:Array<Type>)
to create custom generators I noticed that thetypes
parameter comes with a strange order instead of the declaration order (line number) see the output bellow, this make it's usage a bit more involved than if it came ordered by file/line number, also probably in doing a working example several corner cases will surface and internal changes can be made to make life easy for Haxe users.Would be nice to have an entry in the
Code Cookbook
with a simple functional example and I suggest the one bellow as starting point (generate Haxe again for simplicity), any comments/suggestions/improvements are welcome !Output:
The text was updated successfully, but these errors were encountered: