|
|
|
|
|
by gotoeleven
526 days ago
|
|
Surely there's a way to generate code by manipulating an AST structure? Is there some reason this can't be done in Zig or is it just that no one has bothered? Doing it this way is more verbose but sidesteps all hygiene issues. |
|
Though, if you really wanted to do stupid things, you could use @embedFile to load a Zig source file, then use the Zig compiler's tokenizer/ast parser (which are in the standard library) to parse that file into an AST. Don't do that, but you could.