Replies: 4 comments
-
I need |
Beta Was this translation helpful? Give feedback.
-
@procedural Why not use the Odin parser and make a meta program for such a thing? |
Beta Was this translation helpful? Give feedback.
-
package odin/parser is a good place to start. You effectively parse the files you want and then generate the data for those things. i.e. make a mini compiler |
Beta Was this translation helpful? Give feedback.
-
@procedural You can add custom attributes to declarations and ignore them in normal compilation so you can analyse them in your meta program. |
Beta Was this translation helpful? Give feedback.
-
The idea is to iterate over all structs declared anywhere in the program, look for a specific tag, and do something based on that tag at runtime.
For example:
Is this possible? If not, can it be theoretically possible at all? :)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions