DDoc and mixins

Gregor Richards Richards at codu.org
Sun May 6 19:46:31 PDT 2007


Gerald Stocker wrote:
> Hello,
> 
> Is there any way to attach a documentation comment to declarations that 
> are generated by mixins? Neither of the following work:
> 
> /// Documentation for foo.
> mixin("int foo;");
> 
> mixin("int foo; /// Documentation for foo.");
> 
> I am working on a 6502 emulator in D which relies heavily on CTFE + 
> mixins to generate methods for each of the 6502's opcodes. The code is 
> heavily commented with details of 6502 behavior, and I'd like to be able 
> to include those comments in the generated ddoc documentation.
> 
> --Gerald

I can't offer you a reason, but I can offer you an explanation: mixins 
are expanded far later in parsing than ddoc comments are parsed.

  - Gregor Richards



More information about the Digitalmars-d mailing list