Is it acceptable to not parse unittest blocks when unittests are disabled ?

Claude via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 30 03:30:25 PDT 2017


On Wednesday, 29 March 2017 at 19:43:52 UTC, Vladimir Panteleev 
wrote:
> On Wednesday, 29 March 2017 at 19:32:50 UTC, Vladimir Panteleev 
> wrote:
>> On Wednesday, 29 March 2017 at 11:16:28 UTC, deadalnix wrote:
>>> I was wondering. When uniitests aren't going to run, it may 
>>> be desirable to skip parsing altogether, just lexing and 
>>> counting braces until the matching closing brace is found.
>>
>> Sorry, is this not already the case?
>
> https://github.com/dlang/dmd/pull/4704

To quote Walter Bright from that PR, unittest can contain invalid 
code ONLY if you never compile with -unittest (obviously), -D or 
-H.

It looks consistent to me: just don't parse it in release mode.


More information about the Digitalmars-d mailing list