]> git.draconx.ca Git - gob-dx.git/blobdiff - src/parse.y
Release 0.90.5
[gob-dx.git] / src / parse.y
index 7648232b808c5eeea23a653c3aea2b7825840677..7d01a5df5b0bd07ed5c1089f30086dab4c45aa7c 100644 (file)
@@ -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;
@@ -528,12 +542,7 @@ funcargs:  VOID                    { vararg = FALSE; has_self = FALSE; }
        |       TOKEN                   {
                        vararg = FALSE;
                        has_self = TRUE;
-                       if(strcmp($<id>1,"this")==0) {
-                               push_self($<id>1);
-                               print_error(TRUE,_("Use of 'this' is "
-                                                  "depreciated, use 'self' "
-                                                  "instead"),line_no);
-                       } else if(strcmp($<id>1,"self")==0)
+                       if(strcmp($<id>1,"self")==0)
                                push_self($<id>1);
                        else {
                                g_free($<id>1);
@@ -543,12 +552,7 @@ funcargs:  VOID                    { vararg = FALSE; has_self = FALSE; }
                                                }
        |       TOKEN ',' arglist       {
                        has_self = TRUE;
-                       if(strcmp($<id>1,"this")==0) {
-                               push_self($<id>1);
-                               print_error(TRUE,_("Use of 'this' is "
-                                                  "depreciated, use 'self' "
-                                                  "instead"),line_no);
-                       } else if(strcmp($<id>1,"self")==0)
+                       if(strcmp($<id>1,"self")==0)
                                push_self($<id>1);
                        else {
                                g_free($<id>1);