Conditional compilation and DDoc

Derek Parnell derek at nomail.afraid.org
Thu Aug 17 01:14:54 PDT 2006


I'm having trouble producing conditional documentation.

Here's what I'm doing ...

 version(XYZZY)
 {
    /**
    * macros:
    *   Extra = If you access this when the value is not set,
    *           an exception is thrown.
    */
 }
 module foo_m;
 /**
 *   Defines the capabilities and attributes of a Foo.
 *
 *   $(Extra)
 */
 class Foo
 {
    . . .
 }

This doesn't work because the 'module' statement must be the first
statement and the earlier version statement messes that up.

If I move the module to above the version statement, the macro doesn't get
defined.

Anyone got any ideas about how to produce conditional DDoc documentation
without duplicating a lot of source code?

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
17/08/2006 6:10:04 PM



More information about the Digitalmars-d-learn mailing list