diff options
author | Vincent Sanders <vince@kyllikki.org> | 2012-10-21 14:44:06 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2012-10-21 14:44:06 +0100 |
commit | 8d9fcaaa445b95ba4c934dbdb40b98ae81bf8785 (patch) | |
tree | b9d90b1806a8535457b46e03220cb15d4c0bc7b2 /src/jsapi-libdom.c | |
parent | faf4aabdbbaacf69f4a8fe4cf4d0084ee0b6744e (diff) | |
download | nsgenbind-8d9fcaaa445b95ba4c934dbdb40b98ae81bf8785.tar.gz nsgenbind-8d9fcaaa445b95ba4c934dbdb40b98ae81bf8785.tar.bz2 |
split type and identifier in private entries
Diffstat (limited to 'src/jsapi-libdom.c')
-rw-r--r-- | src/jsapi-libdom.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/src/jsapi-libdom.c b/src/jsapi-libdom.c index adb0b5e..aa6d2bb 100644 --- a/src/jsapi-libdom.c +++ b/src/jsapi-libdom.c @@ -306,21 +306,31 @@ static int webidl_property_body_cb(struct webidl_node *node, void *ctx) } -static int webidl_privatestr_cb(struct genbind_node *node, void *ctx) + +static int webidl_private_cb(struct genbind_node *node, void *ctx) { struct binding *binding = ctx; + struct genbind_node *ident_node; + struct genbind_node *type_node; - fprintf(binding->outfile, " %s;\n", genbind_node_gettext(node)); - return 0; -} + ident_node = genbind_node_find_type(genbind_node_getnode(node), + NULL, + GENBIND_NODE_TYPE_IDENT); + if (ident_node == NULL) + return -1; /* bad AST */ + + type_node = genbind_node_find_type(genbind_node_getnode(node), + NULL, + GENBIND_NODE_TYPE_STRING); + if (type_node == NULL) + return -1; /* bad AST */ + + fprintf(binding->outfile, + " %s%s;\n", + genbind_node_gettext(type_node), + genbind_node_gettext(ident_node)); -static int webidl_private_cb(struct genbind_node *node, void *ctx) -{ - genbind_node_for_each_type(genbind_node_getnode(node), - GENBIND_NODE_TYPE_STRING, - webidl_privatestr_cb, - ctx); return 0; } @@ -512,26 +522,23 @@ binding_new(char *outfilename, struct genbind_node *genbind_ast) struct webidl_node *webidl_ast = NULL; int res; - binding_node = genbind_node_find(genbind_ast, + binding_node = genbind_node_find_type(genbind_ast, NULL, - genbind_cmp_node_type, - (void *)GENBIND_NODE_TYPE_BINDING); + GENBIND_NODE_TYPE_BINDING); if (binding_node == NULL) { return NULL; } - ident_node = genbind_node_find(genbind_node_getnode(binding_node), - NULL, - genbind_cmp_node_type, - (void *)GENBIND_NODE_TYPE_IDENT); + ident_node = genbind_node_find_type(genbind_node_getnode(binding_node), + NULL, + GENBIND_NODE_TYPE_IDENT); if (ident_node == NULL) { return NULL; } - interface_node = genbind_node_find(genbind_node_getnode(binding_node), + interface_node = genbind_node_find_type(genbind_node_getnode(binding_node), NULL, - genbind_cmp_node_type, - (void *)GENBIND_NODE_TYPE_BINDING_INTERFACE); + GENBIND_NODE_TYPE_BINDING_INTERFACE); if (interface_node == NULL) { return NULL; } |