dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
240 stars 80 forks source link

Parsing broken on newest LDC #864

Closed andy-hanson closed 1 year ago

andy-hanson commented 2 years ago

When I upgrade to the newest LDC version, parsing breaks in many ways. Here's a simple example:

import core.stdc.stdio : printf;

void f() {}

void main() {
    printf("call f");
    f();
}

If I run dub run dscanner -- --styleCheck a.d I get:

a.d(0:0)[error]: Primary expression expected
a.d(0:0)[error]: Expected `}` instead of `EOF`
a.d(3:6)[warn]: Public declaration 'f' is undocumented.

(The third error is legitimate, the first two are wrong.)

My dub run dscanner -- --version is v0.12.0.

My ldc2 --version is 1.29.0. If I downgrade to 1.28.0, I correctly get just the third error.

I don't know if the issue is that the newer compiler has a bug, or if d-scanner depends on a compiler-provided library that has changed..

maxhaton commented 2 years ago

I built dscanner on an M1 MacBook Pro, I do not get this error. This indicates it's probably related to https://github.com/dlang-community/libdparse/issues/457

maxhaton commented 1 year ago

IIRC This is fixed.