From 40cd6a199d8a5f92f71c5638f4da021a779e7a5c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 17 Aug 2015 17:41:18 +0200 Subject: Add WebIDL parsing of dictionaries This adds correct parsing of dictionaries into the AST. These entries in the AST are not yet used but do not affect generation of interfaces. --- src/webidl-ast.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/webidl-ast.c') diff --git a/src/webidl-ast.c b/src/webidl-ast.c index 87e3485..dc78e1f 100644 --- a/src/webidl-ast.c +++ b/src/webidl-ast.c @@ -96,6 +96,7 @@ webidl_node_add(struct webidl_node *node, struct webidl_node *list) switch (node->type) { case WEBIDL_NODE_TYPE_ROOT: case WEBIDL_NODE_TYPE_INTERFACE: + case WEBIDL_NODE_TYPE_DICTIONARY: case WEBIDL_NODE_TYPE_LIST: case WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE: case WEBIDL_NODE_TYPE_ATTRIBUTE: @@ -265,7 +266,7 @@ char *webidl_node_gettext(struct webidl_node *node) switch(node->type) { case WEBIDL_NODE_TYPE_IDENT: - case WEBIDL_NODE_TYPE_INTERFACE_INHERITANCE: + case WEBIDL_NODE_TYPE_INHERITANCE: case WEBIDL_NODE_TYPE_INTERFACE_IMPLEMENTS: case WEBIDL_NODE_TYPE_LITERAL_STRING: return node->r.text; @@ -311,6 +312,7 @@ struct webidl_node *webidl_node_getnode(struct webidl_node *node) switch (node->type) { case WEBIDL_NODE_TYPE_ROOT: case WEBIDL_NODE_TYPE_INTERFACE: + case WEBIDL_NODE_TYPE_DICTIONARY: case WEBIDL_NODE_TYPE_LIST: case WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE: case WEBIDL_NODE_TYPE_ATTRIBUTE: @@ -338,7 +340,7 @@ static const char *webidl_node_type_to_str(enum webidl_node_type type) case WEBIDL_NODE_TYPE_IDENT: return "Ident"; - case WEBIDL_NODE_TYPE_INTERFACE_INHERITANCE: + case WEBIDL_NODE_TYPE_INHERITANCE: return "Inherit"; case WEBIDL_NODE_TYPE_INTERFACE_IMPLEMENTS: @@ -347,6 +349,9 @@ static const char *webidl_node_type_to_str(enum webidl_node_type type) case WEBIDL_NODE_TYPE_INTERFACE: return "Interface"; + case WEBIDL_NODE_TYPE_DICTIONARY: + return "Dictionary"; + case WEBIDL_NODE_TYPE_LIST: return "List"; @@ -600,7 +605,7 @@ static int implements_copy_nodes(struct webidl_node *src_node, while (src != NULL) { if (src->type == WEBIDL_NODE_TYPE_LIST) { - /** @todo technicaly this should copy WEBIDL_NODE_TYPE_INTERFACE_INHERITANCE */ + /** @todo technicaly this should copy WEBIDL_NODE_TYPE_INHERITANCE */ dst = webidl_node_new(src->type, dst, src->r.text); } src = src->l; -- cgit v1.2.3