Enum tokens are now sorted

This only affects the in-memory representation - sorted tokens are
easier to debug.
This commit is contained in:
Stefanos A. 2013-11-03 12:15:08 +01:00
parent 827fe0788a
commit 39b1f84fc8

View file

@ -195,15 +195,17 @@ namespace Bind
{
foreach (var e in enums.Values)
{
var processed_constants = new Dictionary<string, Constant>(e.ConstantCollection.Count);
var processed_constants = new SortedDictionary<string, Constant>();
foreach (Constant c in e.ConstantCollection.Values)
{
c.Name = TranslateConstantName(c.Name, false);
c.Value = TranslateConstantValue(c.Value);
c.Reference = TranslateEnumName(c.Reference);
if (!processed_constants.ContainsKey(c.Name))
{
processed_constants.Add(c.Name, c);
}
}
e.ConstantCollection = processed_constants;
var enum_override = nav.SelectSingleNode(GetOverridesPath(apiname, e.Name));