Getting function's AST at compile-time

Tobias Pankrath tobias at pankrath.net
Mon Sep 16 00:19:22 PDT 2013


On Sunday, 15 September 2013 at 22:59:37 UTC, Piotr Szturmaj 
wrote:
> I'm looking for something like __traits(getAST, fn). The AST 
> should represent only run-time (instantiated) code without any 
> compile-time features.
>
> How hard it would be to implement this in the frontend?
>
> It would enable analysis of code at compile-time (without the 
> need to modify the compiler).

Someone somewhere in this newsgroup mentioned that we need to 
define the order in which compile time constructs are evaluated. 
This should be done before the addition of more compile time 
features.

Can a function depend on it's own ast? What if two functions 
mutually depend on the ast of the other?


More information about the Digitalmars-d mailing list