D-Scanner icon indicating copy to clipboard operation
D-Scanner copied to clipboard

Parsing broken on newest LDC

Open andy-hanson opened this issue 2 years ago • 1 comments

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..

andy-hanson avatar Apr 26 '22 01:04 andy-hanson

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 avatar Apr 26 '22 03:04 maxhaton

IIRC This is fixed.

maxhaton avatar Feb 27 '23 19:02 maxhaton