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

rikki cattermole via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 29 04:22:59 PDT 2017


On 29/03/2017 12:16 PM, 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.
>
> Obviously, this means that no error will be found in unittests blocks.
> That can contain pretty much anything that lex, so it's even more lax
> than what's allowed inside a static if.
>
> Is that an acceptable tradeof ?

I see no reason to not to treat it as:

version(unittest) {
	void func_xxxx() {
		...
	}
}

Which is basically what you said.


More information about the Digitalmars-d mailing list