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

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 29 12:38:04 PDT 2017


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?
>
> $ dmd test.d
> $ cat test.d
> void main()
> {
> 	import std.stdio;
> 	writeln("Hello, world!");
> }
>
>
> unittest
> {
> 	foo bar {} baz more-syntax!errors)blah
> }
> $ dmd test.d
> $ ./test
> Hello, world!

Surprise!


More information about the Digitalmars-d mailing list