list out constants in declaration order

This commit is contained in:
James McKaskill 2013-09-12 14:48:11 -04:00
parent 448021e7e1
commit 9682fb2611
2 changed files with 2 additions and 27 deletions

View file

@ -68,14 +68,14 @@ static void resolve_names(struct str *b, struct node *n, capn_text name, struct
str_add(&n->name, b->str, b->len); str_add(&n->name, b->str, b->len);
str_add(b, "_", 1); str_add(b, "_", 1);
for (i = 0; i < n->n.nestedNodes.p.len; i++) { for (i = n->n.nestedNodes.p.len-1; i >= 0; i--) {
struct Node_NestedNode nest; struct Node_NestedNode nest;
get_Node_NestedNode(&nest, n->n.nestedNodes, i); get_Node_NestedNode(&nest, n->n.nestedNodes, i);
resolve_names(b, find_node(nest.id), nest.name, file); resolve_names(b, find_node(nest.id), nest.name, file);
} }
if (n->n.which == Node__struct) { if (n->n.which == Node__struct) {
for (i = 0; i < n->n._struct.fields.p.len; i++) { for (i = n->n._struct.fields.p.len-1; i >= 0; i--) {
if (n->fields[i].group) { if (n->fields[i].group) {
resolve_names(b, n->fields[i].group, n->fields[i].f.name, file); resolve_names(b, n->fields[i].group, n->fields[i].f.name, file);
} }

View file

@ -1,25 +0,0 @@
@0xbee1ff6b75d24d73;
struct Foo {
body @0 union {
voidValue @10 :Void;
boolValue @2 :Bool;
int8Value @3 :Int8;
int16Value @4 :Int16;
int32Value @5 :Int32;
int64Value @6 :Int64;
uint8Value @7 :UInt8;
uint16Value @8 :UInt16;
uint32Value @9 :UInt32;
uint64Value @1 :UInt64;
float32Value @11 :Float32;
float64Value @12 :Float64;
textValue @13 :Text;
dataValue @14 :Data;
listValue @15 :Object;
enumValue @16 :UInt16;
structValue @17 :Object;
interfaceValue @18 :Void;
objectValue @19 :Object;
}
}