dlang-community / libdparse

Library for lexing and parsing D source code
https://libdparse.dlang.io
Boost Software License 1.0
114 stars 56 forks source link

Fix multi-array parsing #479

Closed etienne02 closed 1 year ago

etienne02 commented 1 year ago

Currently the parser does not follow the specs for multi-dimensional array (https://dlang.org/spec/grammar.html#ArrayLiteral) Example that should be parsed correctly:

private void failure()
{
    static struct A
    {
        int a, b, c;
    }
    A [2][2] tests = [
        [ {1, 2, 3}, {}],
        [ {1}, ]
    ];
}

See https://github.com/intellij-dlanguage/intellij-dlanguage/issues/821

WebFreak001 commented 1 year ago

seems to be parsed correctly, can't reproduce the issue

AST looks correct, DCD gives proper auto-completion