From the github discussion: https://github.com/D-Programming-Language/dmd/pull/3906
This code:
// test.d
module a.b.c;
package(a.b) void foo() {}
With the command line:
dmd -o- -X test.d
Outputs test.json:
[
{
"name" : "a.b.c",
"kind" : "module",
"file" : "test.d",
"members" : [
{
"name" : "foo",
"kind" : "function",
"protection" : "package",
"line" : 2,
"char" : 19,
"deco" : "FZv",
"endline" : 2,
"endchar" : 26
}
]
}
]
It does not contain information about the extra part of the package protection '(a.b)'.
For backward compatibility, it would be better to keep the "protection" property as-is. For the extra part, I'd propose to add a new JSON property "protectionPackage". For example:
...
"name" : "foo",
"kind" : "function",
"protection" : "package",
"protectionPackage" : "a.b", // New!
"line" : 2,
...
Comment #1 by robert.schadek — 2024-12-13T18:25:04Z