Gitweb links:
...log
http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/4b043613d1a20980b...
...commit
http://git.netsurf-browser.org/nsgenjsbind.git/commit/4b043613d1a20980b13...
...tree
http://git.netsurf-browser.org/nsgenjsbind.git/tree/4b043613d1a20980b13a6...
The branch, master has been updated
via 4b043613d1a20980b13a6e9b0c8a7ff91c035b2f (commit)
from b5c59d1138c704afd09c4716faabe79f04a80616 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/4b043613d1a2098...
commit 4b043613d1a20980b13a6e9b0c8a7ff91c035b2f
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
add interface function return type
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
index 53ba7e6..91da839 100644
--- a/src/webidl-ast.c
+++ b/src/webidl-ast.c
@@ -25,8 +25,9 @@ struct webidl_node {
struct webidl_node *l;
union {
void *value;
- struct webidl_node *node;
- char *text;
+ struct webidl_node *node; /* node has a list of nodes */
+ char *text; /* node data is text */
+ int number; /* node data is an integer */
} r;
};
diff --git a/src/webidl-ast.h b/src/webidl-ast.h
index 7c32d82..c41149d 100644
--- a/src/webidl-ast.h
+++ b/src/webidl-ast.h
@@ -39,6 +39,7 @@ enum webidl_type {
WEBIDL_TYPE_OBJECT,
WEBIDL_TYPE_DATE,
WEBIDL_TYPE_USER,
+ WEBIDL_TYPE_VOID,
};
enum webidl_type_modifier {
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
index c3bb609..69fbef5 100644
--- a/src/webidl-parser.y
+++ b/src/webidl-parser.y
@@ -151,6 +151,7 @@ webidl_error(YYLTYPE *locp, struct webidl_node **winbind_ast, const
char *str)
%type <node> Ellipsis
%type <node> Type
+%type <node> ReturnType
%type <node> SingleType
%type <node> UnionType
%type <node> NonAnyType
@@ -581,6 +582,8 @@ OperationRest:
{
struct webidl_node *operation = $4; /* argument list */
+ operation = webidl_node_prepend(operation, $1); /* return type */
+
operation = webidl_node_prepend(operation, $2); /* identifier */
$$ = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, NULL, operation);
@@ -1119,6 +1122,12 @@ ReturnType:
Type
|
TOK_VOID
+ {
+ struct webidl_node *type;
+ type = webidl_node_new(WEBIDL_NODE_TYPE_TYPE_BASE, NULL, (void
*)WEBIDL_TYPE_VOID);
+ $$ = webidl_node_new(WEBIDL_NODE_TYPE_TYPE, NULL, type);
+ }
+
;
%%
-----------------------------------------------------------------------
Summary of changes:
src/webidl-ast.c | 5 +++--
src/webidl-ast.h | 1 +
src/webidl-parser.y | 9 +++++++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
index 53ba7e6..91da839 100644
--- a/src/webidl-ast.c
+++ b/src/webidl-ast.c
@@ -25,8 +25,9 @@ struct webidl_node {
struct webidl_node *l;
union {
void *value;
- struct webidl_node *node;
- char *text;
+ struct webidl_node *node; /* node has a list of nodes */
+ char *text; /* node data is text */
+ int number; /* node data is an integer */
} r;
};
diff --git a/src/webidl-ast.h b/src/webidl-ast.h
index 7c32d82..c41149d 100644
--- a/src/webidl-ast.h
+++ b/src/webidl-ast.h
@@ -39,6 +39,7 @@ enum webidl_type {
WEBIDL_TYPE_OBJECT,
WEBIDL_TYPE_DATE,
WEBIDL_TYPE_USER,
+ WEBIDL_TYPE_VOID,
};
enum webidl_type_modifier {
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
index c3bb609..69fbef5 100644
--- a/src/webidl-parser.y
+++ b/src/webidl-parser.y
@@ -151,6 +151,7 @@ webidl_error(YYLTYPE *locp, struct webidl_node **winbind_ast, const
char *str)
%type <node> Ellipsis
%type <node> Type
+%type <node> ReturnType
%type <node> SingleType
%type <node> UnionType
%type <node> NonAnyType
@@ -581,6 +582,8 @@ OperationRest:
{
struct webidl_node *operation = $4; /* argument list */
+ operation = webidl_node_prepend(operation, $1); /* return type */
+
operation = webidl_node_prepend(operation, $2); /* identifier */
$$ = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, NULL, operation);
@@ -1119,6 +1122,12 @@ ReturnType:
Type
|
TOK_VOID
+ {
+ struct webidl_node *type;
+ type = webidl_node_new(WEBIDL_NODE_TYPE_TYPE_BASE, NULL, (void
*)WEBIDL_TYPE_VOID);
+ $$ = webidl_node_new(WEBIDL_NODE_TYPE_TYPE, NULL, type);
+ }
+
;
%%
--
NetSurf Generator for JavaScript bindings