DMD "preprocessed"-source output?

Denis Koroskin 2korden at gmail.com
Sun Oct 5 05:28:54 PDT 2008


On Sun, 05 Oct 2008 04:14:34 +0400, Nick Sabalausky <a at a.a> wrote:

> I don't suppose DMD has any way to output a copy of what the source files
> look like after things like mixins, CTFE and versions are applied? (Sort  
> of
> like running a C compiler with a "preprocess-only" flag). I don't see
> anything like this in the listed command-line params, but maybe I missed  
> it.
>
> I have a program (that makes heavy use of mixins and CTFE and such) that
> gives wildly different output between two different versions of DMD/Tango
> (Tango's documented "breaking changes" don't appear to be the culprit and
> nothing in DMD's changelog or the latest bugzilla entries seem to
> immediately stick out). I'm sure I can track it down, but it would help  
> to
> narrow things down if I could run the "preprocessed" results from both
> environments through a file diff.
>
>

D doesn't have a dedicated preprocessor and I believe all the mixins and  
stuff is applied and parsed of fly during AST construction, just like  
inlining is done on AST instead of codegen phase.


More information about the Digitalmars-d-learn mailing list