support weak keyword in local variable declarations improve GError support
authorJürg Billeter <j@bitron.ch>
Fri, 16 Mar 2007 22:42:57 +0000 (22:42 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 16 Mar 2007 22:42:57 +0000 (22:42 +0000)
2007-03-16  Jürg Billeter  <j@bitron.ch>

* vala/parser.y: support weak keyword in local variable declarations
* vapi/glib-2.0.vala: improve GError support

svn path=/trunk/; revision=238

vala/ChangeLog
vala/vala/parser.y
vala/vapi/glib-2.0.vala

index daff2b5..fff79bc 100644 (file)
@@ -1,5 +1,10 @@
 2007-03-16  Jürg Billeter  <j@bitron.ch>
 
+       * vala/parser.y: support weak keyword in local variable declarations
+       * vapi/glib-2.0.vala: improve GError support
+
+2007-03-16  Jürg Billeter  <j@bitron.ch>
+
        * vala/valacodegenerator.vala: support disconnecting signals, based on
          patch by Alexandre Moreira
        * tests/test-018.vala, tests/test-018.out: test disconnecting signals
index 9954605..785c49c 100644 (file)
@@ -1434,6 +1434,16 @@ local_variable_type
                        vala_type_reference_set_non_null ($$, TRUE);
                }
          }
+       | WEAK primary_expression opt_op_neg
+         {
+               ValaSourceReference *src = src(@2);
+               $$ = vala_type_reference_new_from_expression ($2);
+               g_object_unref ($2);
+               g_object_unref (src);
+               if ($3) {
+                       vala_type_reference_set_non_null ($$, TRUE);
+               }
+         }
        ;
 
 opt_op_neg
index f8a0131..832f0a5 100644 (file)
@@ -625,8 +625,9 @@ namespace GLib {
        
        /* Error Reporting */
 
-       [ReferenceType ()]
+       [ReferenceType (dup_function = "g_error_copy", free_function = "g_error_free")]
        public struct Error {
+               public Error (Quark domain, int code, string! format, ...);
                public int code;
                public string message;
        }