Compiling DMD parser?
Markus Koskimies
markus at reaaliaika.net
Tue Jul 15 07:37:56 PDT 2008
On Tue, 15 Jul 2008 10:29:01 -0300, Leandro Lucarella wrote:
>> I'll put the full sources available somewhere (to my home pages, at
>> least), and continue developing walking & warning thing.
>
> That would be very useful.
I'm currently hacking more scanners:
- Scanning/warning, if function return value is discarded, i.e.
int f() { ... }
f(); // Warn
cast(void)f(); // Don't warn
- Warning for suspicious looking infinite loops, i.e.
for(;3.1415926535894;) { ... } // Warn
for(;;) { } // Don't warn
There are some problems to make them correct, since DParser does not
always store all necessary information, e.g. "for(;true;)" = "for(;;)"
I probably include scanning of constant if/switch values with the loop
scanning... That general purpose walking class makes implementation of
these kinds of checkings relatively easy.
There will surely missing / wrongly working pieces in the code, but those
can be corrected later :)
More information about the Digitalmars-d
mailing list