Bug 11620 – dmd json output should output enum values

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-27T11:43:00Z
Last change time
2014-04-24T13:53:23Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
destructionator
Blocks
9285

Comments

Comment #0 by destructionator — 2013-11-27T11:43:01Z
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
Comment #1 by github-bugzilla — 2014-04-24T13:53:23Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6fb1c2b7635824d49eebd910fe03bc7bb863492f Fix Issue 11620 - Emit enum member values to json output. https://github.com/D-Programming-Language/dmd/commit/6642adcf5840576ed10069cf4269fab6175fb8d2 Merge pull request #3472 from AndrejMitrovic/Fix11620 Issue 11620 - Emit enum member values to json output.