Proposal: __traits(getComment, symbol)

Jacob Carlborg doob at me.com
Thu Aug 29 12:25:40 UTC 2019


On 2019-08-29 00:18, Max Haughton wrote:

> Speaking of which, has anyone tried/discussed giving access to a frozen 
> version of the AST through (say) __traits(getAST, symbol)? I'd try it 
> myself but I haven't spent the time learning how dmd works.

Yes, it's been discussed. Also AST macros which are related has been 
discussed quite a lot. I've worked a bit on the compiler to implement 
AST macros [1]. `__traits(getAST)` would be half of what's required for 
AST macros.

It's pretty easy to do, just a bit tedious.

[1] https://github.com/jacob-carlborg/dmd/tree/macro

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list