X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/2310330e7d4d724bf6641339836be8523f95c916..a611f21fab136f64bbf979bd62b2fc6ecb62933c:/src/parse.y diff --git a/src/parse.y b/src/parse.y index 46fdf6e..7d01a5d 100644 --- a/src/parse.y +++ b/src/parse.y @@ -104,6 +104,20 @@ push_function(int scope, char *oid, char *id, char *onerror, type = (Type *)new_type(0,g_strdup("void")); } + /* a complicated and ugly test to figure out if we have + the wrong number of types for a signal */ + if((scope == SIGNAL_FIRST_METHOD || + scope == SIGNAL_LAST_METHOD || + scope == PRIVATE_SIGNAL_FIRST_METHOD || + scope == PRIVATE_SIGNAL_LAST_METHOD) && + g_list_length(gtktypes) != g_list_length(funcargs) && + !(g_list_length(funcargs) == 1 && + g_list_length(gtktypes) == 2 && + strcmp(gtktypes->next->data,"NONE")==0)) { + print_error(TRUE, _("The number of GTK arguments and " + "function arguments for a signal " + "don't seem to match"),line_no); + } node = new_method(scope,type,oid,gtktypes,id,funcargs, onerror,cbuf,line_no,ccode_line,vararg); gtktypes = NULL;