From c9f6b7e3df34995279231dd5a02d1cd44ec8f869 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 9 Oct 2015 14:05:49 +0100 Subject: show the property type on unimplemented setter warning --- src/duk-libdom-interface.c | 6 ++++-- src/webidl-ast.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++ src/webidl-ast.h | 4 ++++ 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c index 34a0db0..ba3fcc4 100644 --- a/src/duk-libdom-interface.c +++ b/src/duk-libdom-interface.c @@ -1444,8 +1444,10 @@ output_attribute_setter(FILE* outf, /* implementation not generated from any other source */ if (res < 0) { WARN(WARNING_UNIMPLEMENTED, - "Unimplemented: setter %s::%s();", - interfacee->name, atributee->name); + "Unimplemented: setter %s::%s(%s);", + interfacee->name, + atributee->name, + webidl_type_to_str(atributee->base_type)); if (options->dbglog) { fprintf(outf, "\tLOG(\"Unimplemented\");\n" ); diff --git a/src/webidl-ast.c b/src/webidl-ast.c index e9dda2d..08a8dcc 100644 --- a/src/webidl-ast.c +++ b/src/webidl-ast.c @@ -683,3 +683,55 @@ int webidl_intercalate_implements(struct webidl_node *webidl_ast) intercalate_implements, webidl_ast); } + +/* exported interface defined in webidl-ast.h */ +const char *webidl_type_to_str(enum webidl_type t) +{ + switch (t) { + case WEBIDL_TYPE_ANY: /**< 0 - The type is unconstrained */ + return "any"; + + case WEBIDL_TYPE_USER: /**< 1 - The type is a dictionary or interface */ + return "user"; + + case WEBIDL_TYPE_BOOL: /**< 2 - The type is boolean */ + return "boolean"; + + case WEBIDL_TYPE_BYTE: /**< 3 - The type is a byte */ + return "byte"; + + case WEBIDL_TYPE_OCTET: /**< 4 - The type is a octet */ + return "octet"; + + case WEBIDL_TYPE_FLOAT: /**< 5 - The type is a float point number */ + return "float"; + + case WEBIDL_TYPE_DOUBLE: /**< 6 - The type is a double */ + return "double"; + + case WEBIDL_TYPE_SHORT: /**< 7 - The type is a signed 16bit */ + return "short"; + + case WEBIDL_TYPE_LONG: /**< 8 - The type is a signed 32bit */ + return "long"; + + case WEBIDL_TYPE_LONGLONG: /**< 9 - The type is a signed 64bit */ + return "long long"; + + case WEBIDL_TYPE_STRING: /**< 10 - The type is a string */ + return "string"; + + case WEBIDL_TYPE_SEQUENCE: /**< 11 - The type is a sequence */ + return "sequence"; + + case WEBIDL_TYPE_OBJECT: /**< 12 - The type is a object */ + return "object"; + + case WEBIDL_TYPE_DATE: /**< 13 - The type is a date */ + return "date"; + + case WEBIDL_TYPE_VOID: /**< 14 - The type is void */ + return "void"; + } + return "Unknown"; +} diff --git a/src/webidl-ast.h b/src/webidl-ast.h index 59dfcac..0a8079b 100644 --- a/src/webidl-ast.h +++ b/src/webidl-ast.h @@ -163,5 +163,9 @@ int webidl_intercalate_implements(struct webidl_node *node); */ int webidl_fprintf(FILE *stream, const char *format, ...); +/** + * get string of argument type + */ +const char *webidl_type_to_str(enum webidl_type t); #endif -- cgit v1.2.3