diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-07-29 00:08:08 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-07-29 00:08:08 +0100 |
commit | cb23f1f911523752db095781d0d5fa3e334f1aa5 (patch) | |
tree | 4c9044542443243067f9e57d4710573b49122f74 /src/webidl-ast.c | |
parent | 3f0d06f529fb5efaeb4edd89e61b3421951b8bf2 (diff) | |
download | nsgenbind-cb23f1f911523752db095781d0d5fa3e334f1aa5.tar.gz nsgenbind-cb23f1f911523752db095781d0d5fa3e334f1aa5.tar.bz2 |
Add property generation and add it to prototype construction
Diffstat (limited to 'src/webidl-ast.c')
-rw-r--r-- | src/webidl-ast.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/webidl-ast.c b/src/webidl-ast.c index 6c24c41..75f969b 100644 --- a/src/webidl-ast.c +++ b/src/webidl-ast.c @@ -277,7 +277,7 @@ char *webidl_node_gettext(struct webidl_node *node) } /* exported interface defined in webidl-ast.h */ -int +int * webidl_node_getint(struct webidl_node *node) { if (node != NULL) { @@ -285,14 +285,13 @@ webidl_node_getint(struct webidl_node *node) case WEBIDL_NODE_TYPE_MODIFIER: case WEBIDL_NODE_TYPE_TYPE_BASE: case WEBIDL_NODE_TYPE_LITERAL_INT: - return node->r.number; + return &node->r.number; default: break; } } - return -1; - + return NULL; } /* exported interface defined in webidl-ast.h */ @@ -400,6 +399,7 @@ static int webidl_ast_dump(FILE *dumpf, struct webidl_node *node, int indent) { const char *SPACES=" "; char *txt; + int *value; while (node != NULL) { fprintf(dumpf, "%.*s%s", indent, SPACES, webidl_node_type_to_str(node->type)); @@ -415,8 +415,10 @@ static int webidl_ast_dump(FILE *dumpf, struct webidl_node *node, int indent) webidl_ast_dump(dumpf, next, indent + 2); } else { /* not txt or node has to be an int */ - fprintf(dumpf, ": %d\n", - webidl_node_getint(node)); + value = webidl_node_getint(node); + if (value != NULL) { + fprintf(dumpf, ": %d\n", *value); + } } } else { fprintf(dumpf, ": \"%s\"\n", txt); |