summaryrefslogtreecommitdiff
path: root/src/webidl-ast.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-08-09 11:07:11 +0100
committerVincent Sanders <vince@kyllikki.org>2015-08-09 11:07:11 +0100
commita9e5295d8735ff4ffe10e63f48728380edf6d7a0 (patch)
tree2ab8872a172bc11ac1a4c2b62b13170d9363bb58 /src/webidl-ast.c
parente78ea8b28064181d9081e7ff0143830c4ec37d7f (diff)
downloadnsgenbind-a9e5295d8735ff4ffe10e63f48728380edf6d7a0.tar.gz
nsgenbind-a9e5295d8735ff4ffe10e63f48728380edf6d7a0.tar.bz2
Update the interface map to contain all operation arguments
This extends the interface map (the intermediate representation) to have information on every operations arguments including overloading and optional arguments. This is important to allow automated checking of passed parameters numbers and types in future.
Diffstat (limited to 'src/webidl-ast.c')
-rw-r--r--src/webidl-ast.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
index 0e90767..87e3485 100644
--- a/src/webidl-ast.c
+++ b/src/webidl-ast.c
@@ -100,7 +100,7 @@ webidl_node_add(struct webidl_node *node, struct webidl_node *list)
case WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE:
case WEBIDL_NODE_TYPE_ATTRIBUTE:
case WEBIDL_NODE_TYPE_OPERATION:
- case WEBIDL_NODE_TYPE_OPTIONAL_ARGUMENT:
+ case WEBIDL_NODE_TYPE_OPTIONAL:
case WEBIDL_NODE_TYPE_ARGUMENT:
case WEBIDL_NODE_TYPE_TYPE:
case WEBIDL_NODE_TYPE_CONST:
@@ -267,6 +267,7 @@ char *webidl_node_gettext(struct webidl_node *node)
case WEBIDL_NODE_TYPE_IDENT:
case WEBIDL_NODE_TYPE_INTERFACE_INHERITANCE:
case WEBIDL_NODE_TYPE_INTERFACE_IMPLEMENTS:
+ case WEBIDL_NODE_TYPE_LITERAL_STRING:
return node->r.text;
default:
@@ -286,6 +287,7 @@ webidl_node_getint(struct webidl_node *node)
case WEBIDL_NODE_TYPE_TYPE_BASE:
case WEBIDL_NODE_TYPE_LITERAL_INT:
case WEBIDL_NODE_TYPE_SPECIAL:
+ case WEBIDL_NODE_TYPE_LITERAL_BOOL:
return &node->r.number;
default:
@@ -313,7 +315,7 @@ struct webidl_node *webidl_node_getnode(struct webidl_node *node)
case WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE:
case WEBIDL_NODE_TYPE_ATTRIBUTE:
case WEBIDL_NODE_TYPE_OPERATION:
- case WEBIDL_NODE_TYPE_OPTIONAL_ARGUMENT:
+ case WEBIDL_NODE_TYPE_OPTIONAL:
case WEBIDL_NODE_TYPE_ARGUMENT:
case WEBIDL_NODE_TYPE_TYPE:
case WEBIDL_NODE_TYPE_CONST:
@@ -354,8 +356,8 @@ static const char *webidl_node_type_to_str(enum webidl_node_type type)
case WEBIDL_NODE_TYPE_OPERATION:
return "Operation";
- case WEBIDL_NODE_TYPE_OPTIONAL_ARGUMENT:
- return "Argument(opt)";
+ case WEBIDL_NODE_TYPE_OPTIONAL:
+ return "Optional";
case WEBIDL_NODE_TYPE_ARGUMENT:
return "Argument";
@@ -381,9 +383,21 @@ static const char *webidl_node_type_to_str(enum webidl_node_type type)
case WEBIDL_NODE_TYPE_CONST:
return "Const";
+ case WEBIDL_NODE_TYPE_LITERAL_NULL:
+ return "Literal (null)";
+
case WEBIDL_NODE_TYPE_LITERAL_INT:
return "Literal (int)";
+ case WEBIDL_NODE_TYPE_LITERAL_BOOL:
+ return "Literal (bool)";
+
+ case WEBIDL_NODE_TYPE_LITERAL_FLOAT:
+ return "Literal (string)";
+
+ case WEBIDL_NODE_TYPE_LITERAL_STRING:
+ return "Literal (string)";
+
case WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE:
return "Extended Attribute";