www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11620] New: dmd json output should output enum values

https://d.puremagic.com/issues/show_bug.cgi?id=11620

           Summary: dmd json output should output enum values
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: destructionator gmail.com


--- Comment #0 from Adam D. Ruppe <destructionator gmail.com> 2013-11-27
11:43:01 PST ---
Given:
enum Numbers {
        zero = 0,
        one = 1,
        two = 2,
        FILE_NOT_FOUND = 101
}

dmd -X gives:

   {
    "name" : "Numbers",
    "kind" : "enum",
    "line" : 20,
    "baseDeco" : "i",
    "members" : [
     {
      "name" : "zero",
      "kind" : "enum member",
      "line" : 21
     },
     {
      "name" : "one",
      "kind" : "enum member",
      "line" : 22
     },
     {
      "name" : "two",
      "kind" : "enum member",
      "line" : 23
     },
     {
      "name" : "FILE_NOT_FOUND",
      "kind" : "enum member",
      "line" : 24
     }
    ]
   },



Good, but not great: it doesn't include the value given, so there's no way when
reading this to know that FILE_NOT_FOUND is not equal to three.

It should include the value, if at all possible

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 27 2013