diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-08-09 11:07:11 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-08-09 11:07:11 +0100 |
commit | a9e5295d8735ff4ffe10e63f48728380edf6d7a0 (patch) | |
tree | 2ab8872a172bc11ac1a4c2b62b13170d9363bb58 /src/webidl-parser.y | |
parent | e78ea8b28064181d9081e7ff0143830c4ec37d7f (diff) | |
download | nsgenbind-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-parser.y')
-rw-r--r-- | src/webidl-parser.y | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/webidl-parser.y b/src/webidl-parser.y index 953388e..9cfd84e 100644 --- a/src/webidl-parser.y +++ b/src/webidl-parser.y @@ -170,6 +170,8 @@ webidl_error(YYLTYPE *locp, struct webidl_node **winbind_ast, const char *str) %type <node> Ellipsis %type <node> Iterable %type <node> OptionalType +%type <node> Default +%type <node> DefaultValue %type <node> Type %type <node> ReturnType @@ -450,8 +452,14 @@ PartialDictionary: /* [15] */ Default: /* empty */ + { + $$ = NULL; + } | '=' DefaultValue + { + $$ = $2; + } ; @@ -460,6 +468,9 @@ DefaultValue: ConstValue | TOK_STRING_LITERAL + { + $$ = webidl_node_new(WEBIDL_NODE_TYPE_LITERAL_STRING, NULL, $1); + } ; /* [17] */ @@ -874,8 +885,9 @@ OptionalOrRequiredArgument: { struct webidl_node *argument; argument = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, $3); + argument = webidl_node_new(WEBIDL_NODE_TYPE_OPTIONAL, argument, $4); argument = webidl_node_prepend(argument, $2); /* add type node */ - $$ = webidl_node_new(WEBIDL_NODE_TYPE_OPTIONAL_ARGUMENT, NULL, argument); + $$ = webidl_node_new(WEBIDL_NODE_TYPE_ARGUMENT, NULL, argument); } | Type Ellipsis ArgumentName |