From cf89528fc6668e6d07b6e99db0069c9fe1f6e05d Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 2 Aug 2015 18:30:18 +0100 Subject: Update the webidl parser to cope with specials and overloaded methods --- src/webidl-ast.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/webidl-ast.c') diff --git a/src/webidl-ast.c b/src/webidl-ast.c index 75f969b..0e90767 100644 --- a/src/webidl-ast.c +++ b/src/webidl-ast.c @@ -285,6 +285,7 @@ webidl_node_getint(struct webidl_node *node) case WEBIDL_NODE_TYPE_MODIFIER: case WEBIDL_NODE_TYPE_TYPE_BASE: case WEBIDL_NODE_TYPE_LITERAL_INT: + case WEBIDL_NODE_TYPE_SPECIAL: return &node->r.number; default: @@ -386,6 +387,9 @@ static const char *webidl_node_type_to_str(enum webidl_node_type type) case WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE: return "Extended Attribute"; + case WEBIDL_NODE_TYPE_SPECIAL: + return "Special"; + default: return "Unknown"; } @@ -414,10 +418,13 @@ static int webidl_ast_dump(FILE *dumpf, struct webidl_node *node, int indent) fprintf(dumpf, "\n"); webidl_ast_dump(dumpf, next, indent + 2); } else { - /* not txt or node has to be an int */ + /* not txt or node try an int */ value = webidl_node_getint(node); if (value != NULL) { fprintf(dumpf, ": %d\n", *value); + } else { + /* no value */ + fprintf(dumpf, "\n"); } } } else { -- cgit v1.2.3