From cdd39954a238ec07224c3c9cff66a4f8f101d71c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 14 Sep 2012 19:57:09 +0100 Subject: add preamble output add operation nodes to webidl ast --- src/webidl-parser.y | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/webidl-parser.y') 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 AttributeOrOperation %type StringifierAttributeOrOperation %type Const + %type Operation %type OperationRest +%type 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 ; -- cgit v1.2.3