Is it acceptable to not parse unittest blocks when unittests are disabled ?
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Fri Mar 31 17:49:48 PDT 2017
On 3/29/2017 4:16 AM, 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 ?
One of my longer term goals for DMD is to make it as lazy as possible - only
parse and do semantic analysis if the result is actually needed. Not doing the
parse for unused unittest blocks is a step in that direction.
The code is still required to be correct, but the compiler isn't required to
diagnose it.
More information about the Digitalmars-d
mailing list