Subtle bug in ddox vs. ddoc macro handling

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 16 11:40:03 PDT 2016


So, I've spent the better part of this morning tracing what seems to be 
a subtle bug in ddox' macro treatment. I defined these macros:

IGNORESECOND = [$1]
DOLLARZERO = dzbegin $0 dzend
TEST = before $(IGNORESECOND $(DOLLARZERO one, two)) after

I inserted $(TEST) in a Phobos module. When processing the module with 
ddoc, the macro expands to:

before [dzbegin one, two dzend] after

wherease with ddox it expands to:

before [dzbegin one] after

i.e. the comma "escapes" the confines of the macro DOLLARZERO.

The "right" behavior is ddoc's, for several reasons. Is there a distinct 
macro engine powering ddox generation? Who is maintaining that?


Thanks,

Andrei


More information about the Digitalmars-d mailing list