enumvalueex attribute now set during the type pass

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5923 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-05-24 20:14:58 +00:00
commit ead1d3ac6a

View file

@ -782,6 +782,16 @@ class TypePass : private Dispatcher {
Setattr(n,"value",new_value);
Delete(new_value);
}
// Make up an enumvalue if one was not specified in the parsed code
if (Getattr(n,"_last") && !Getattr(n,"enumvalue")) { // Only the first enum item has _last set
Setattr(n,"enumvalueex", "0");
}
Node *next = nextSibling(n);
if (next && !Getattr(next,"enumvalue")) {
Setattr(next,"enumvalueex", NewStringf("%s + 1", Getattr(n,"sym:name")));
}
return SWIG_OK;
}