www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13384] New: Support JSON output for new package(names)

https://issues.dlang.org/show_bug.cgi?id=13384

          Issue ID: 13384
           Summary: Support JSON output for new package(names) protection
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

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, ... --
Aug 27 2014