From 2c193d1fa01e116d7cdb1b5dd0f3cd8497bf7ef6 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 24 Oct 2015 21:08:56 +0100 Subject: improve unimplemented warning to include type modifier --- src/duk-libdom-interface.c | 7 ++++--- src/webidl-ast.c | 14 +++++++++++--- src/webidl-ast.h | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c index a57c520..77a58b0 100644 --- a/src/duk-libdom-interface.c +++ b/src/duk-libdom-interface.c @@ -1316,7 +1316,8 @@ output_attribute_getter(FILE* outf, "Unimplemented: getter %s::%s(%s);", interfacee->name, atributee->name, - webidl_type_to_str(atributee->base_type)); + webidl_type_to_str(atributee->type_modifier, + atributee->base_type)); if (options->dbglog) { fprintf(outf, "\tLOG(\"Unimplemented\");\n" ); @@ -1472,8 +1473,8 @@ output_attribute_setter(FILE* outf, "Unimplemented: setter %s::%s(%s);", interfacee->name, atributee->name, - webidl_type_to_str(atributee->base_type)); - + webidl_type_to_str(atributee->type_modifier, + atributee->base_type)); if (options->dbglog) { fprintf(outf, "\tLOG(\"Unimplemented\");\n" ); } diff --git a/src/webidl-ast.c b/src/webidl-ast.c index 08a8dcc..253a3ba 100644 --- a/src/webidl-ast.c +++ b/src/webidl-ast.c @@ -685,7 +685,7 @@ int webidl_intercalate_implements(struct webidl_node *webidl_ast) } /* exported interface defined in webidl-ast.h */ -const char *webidl_type_to_str(enum webidl_type t) +const char *webidl_type_to_str(enum webidl_type_modifier m, enum webidl_type t) { switch (t) { case WEBIDL_TYPE_ANY: /**< 0 - The type is unconstrained */ @@ -710,10 +710,18 @@ const char *webidl_type_to_str(enum webidl_type t) return "double"; case WEBIDL_TYPE_SHORT: /**< 7 - The type is a signed 16bit */ - return "short"; + if (m == WEBIDL_TYPE_MODIFIER_UNSIGNED) { + return "unsigned short"; + } else { + return "short"; + } case WEBIDL_TYPE_LONG: /**< 8 - The type is a signed 32bit */ - return "long"; + if (m == WEBIDL_TYPE_MODIFIER_UNSIGNED) { + return "unsigned long"; + } else { + return "long"; + } case WEBIDL_TYPE_LONGLONG: /**< 9 - The type is a signed 64bit */ return "long long"; diff --git a/src/webidl-ast.h b/src/webidl-ast.h index 0a8079b..bd9b313 100644 --- a/src/webidl-ast.h +++ b/src/webidl-ast.h @@ -166,6 +166,6 @@ int webidl_fprintf(FILE *stream, const char *format, ...); /** * get string of argument type */ -const char *webidl_type_to_str(enum webidl_type t); +const char *webidl_type_to_str(enum webidl_type_modifier m, enum webidl_type t); #endif -- cgit v1.2.3