summaryrefslogtreecommitdiff
path: root/src/webidl-parser.y
diff options
context:
space:
mode:
authorVincent Sanders <vincent.sanders@collabora.co.uk>2012-09-14 19:57:09 +0100
committerVincent Sanders <vincent.sanders@collabora.co.uk>2012-09-14 19:57:09 +0100
commitcdd39954a238ec07224c3c9cff66a4f8f101d71c (patch)
treedb822cce0b40536d0c5a9fbd0354264cfb6f1f09 /src/webidl-parser.y
parent6ccbb7e3fe88c9a6ddb232c43f71b9c8cb80a884 (diff)
downloadnsgenbind-cdd39954a238ec07224c3c9cff66a4f8f101d71c.tar.gz
nsgenbind-cdd39954a238ec07224c3c9cff66a4f8f101d71c.tar.bz2
add preamble output
add operation nodes to webidl ast
Diffstat (limited to 'src/webidl-parser.y')
-rw-r--r--src/webidl-parser.y11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
index c4cfa56..f0f1830 100644
--- a/src/webidl-parser.y
+++ b/src/webidl-parser.y
@@ -134,8 +134,10 @@ webidl_error(YYLTYPE *locp, struct webidl_node **winbind_ast, const char *str)
%type <node> AttributeOrOperation
%type <node> StringifierAttributeOrOperation
%type <node> Const
+
%type <node> Operation
%type <node> OperationRest
+%type <node> OptionalIdentifier
%%
@@ -501,13 +503,20 @@ Special:
OperationRest:
ReturnType OptionalIdentifier '(' ArgumentList ')' ';'
{
- $$=NULL;
+ struct webidl_node *ident = NULL;
+ if ($2 != NULL) {
+ ident = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, $2);
+ }
+ $$ = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, NULL, ident);
}
;
/* [40] */
OptionalIdentifier:
/* empty */
+ {
+ $$=NULL;
+ }
|
TOK_IDENTIFIER
;