Error When parsing an enum containing other enum value
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyclibrary |
New
|
Undecided
|
Unassigned |
Bug Description
Hello !
Thanks for this simple parser, that help me to create quickly documentation on enums used as errcode and parameter id. I do believe that I'll be able to make a simple multiplatform tool.
Whith the following header content to parse :
//-----
typedef enum
{
one,
two,
lastFromType1
} type1 ;
typedef enum
{
three = lastFromType1,
four,
five
} type1 ;
//-----
I've got a KeyError on 'lastFromType1', four and five is not parsed.
Analysis : in function "def processEnum(self, s, l, t)"
...
if v.valueName != '':
...
The problem is that the search is done within the current enum values only.
Solution : catch the KeyError exception to search in file global values.
Implementation suggestion :
I added "def getValueDef(
Modify the processEnum line with :
I'll try to send a patch soonely.
Thanks.
OK I bzr made quickly the patch for me.