]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Remove support for deprecated syntax for construct parameters
authorJürg Billeter <j@bitron.ch>
Fri, 19 Dec 2008 12:44:28 +0000 (12:44 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 19 Dec 2008 12:44:28 +0000 (12:44 +0000)
2008-12-19  Jürg Billeter  <j@bitron.ch>

* vala/valaformalparameter.vala:
* vala/valagenieparser.vala:
* vala/valaparser.vala:

Remove support for deprecated syntax for construct parameters

* tests/arrays.test:
* tests/objects/test-029.test:

Update syntax used in test cases

svn path=/trunk/; revision=2218

ChangeLog
tests/arrays.test
tests/objects/test-029.test
vala/valaformalparameter.vala
vala/valagenieparser.vala
vala/valaparser.vala

index e424949ed4fc8e96921a9c1201ed3e76f086e066..5d7662524a8873ad62f8e8ed56e17ed99b7c7e14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-12-19  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valaformalparameter.vala:
+       * vala/valagenieparser.vala:
+       * vala/valaparser.vala:
+
+       Remove support for deprecated syntax for construct parameters
+
+       * tests/arrays.test:
+       * tests/objects/test-029.test:
+
+       Update syntax used in test cases
+
 2008-12-19  Jürg Billeter  <j@bitron.ch>
 
        * vala/valacodewriter.vala:
index 3e05b5e4a2ff95208e9382b067b82c542737a771..87bedf4f66e97014135930bf045fa916688d7cd2 100644 (file)
@@ -4,7 +4,8 @@ Program: test
 using GLib;
 
 class Maman.Foo : Object {
-       public Foo (construct string bar) {
+       public Foo (string bar) {
+               this.bar = bar;
        }
 
        public string bar { get; set; }
index bb13e267386185bc1c285719024bf9cfed22281d..ff36beda6bc97b5fdf41fce93afd8a16441522c8 100644 (file)
@@ -7,8 +7,9 @@ class Maman.Foo : Object {
        public int p1 { get; set; }
        public int p2 { get; set; }
        
-       public Foo (int i, construct int p2) {
+       public Foo (int i, int p2) {
                p1 = 2 * i;
+               this.p2 = p2;
        }
        
        public static int main (string[] args) {
index cba860f72dbf6289253b1fccf550207573051ffd..1905b0cdc796c6bf5f4f2a0d784e57ee9be46648 100644 (file)
@@ -64,12 +64,6 @@ public class Vala.FormalParameter : Symbol {
         * if the parameter type is an array.
         */
        public bool no_array_length { get; set; }
-       
-       /**
-        * Specifies whether this parameter holds a value to be assigned to a
-        * construct property. This is only allowed in CreationMethod headers.
-        */
-       public bool construct_parameter { get; set; }
 
        /**
         * Specifies the position of the parameter in the C function.
@@ -234,20 +228,6 @@ public class Vala.FormalParameter : Symbol {
                        }
                }
 
-               /* special treatment for construct formal parameters used in creation methods */
-               if (construct_parameter) {
-                       if (!(parent_symbol is CreationMethod)) {
-                               error = true;
-                               Report.error (source_reference, "construct parameters are only allowed in type creation methods");
-                       }
-
-                       var method_body = ((CreationMethod) parent_symbol).body;
-                       var left = new MemberAccess (new MemberAccess.simple ("this"), name);
-                       var right = new MemberAccess.simple (name);
-
-                       method_body.add_statement (new ExpressionStatement (new Assignment (left, right), source_reference));
-               }
-
                analyzer.current_source_file = old_source_file;
                analyzer.current_symbol = old_symbol;
 
index 9dc35e76b0ae616816314d24620b6769b2735ad5..4dc94164eff4bf86413c5570fc8261fccf943632 100644 (file)
@@ -3234,7 +3234,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                var param = new FormalParameter (id, type, get_src (begin));
                set_attributes (param, attrs);
                param.direction = direction;
-               param.construct_parameter = false;
                if (accept (TokenType.ASSIGN)) {
                        param.default_expression = parse_expression ();
                }
index 3d7259c413e1400dd4afb390f50765feef4713cf..44286a5dcbac68616d8e9d68287b403b8d1cd8a0 100644 (file)
@@ -2679,11 +2679,6 @@ public class Vala.Parser : CodeVisitor {
                        return new FormalParameter.with_ellipsis (get_src (begin));
                }
                bool params_array = accept (TokenType.PARAMS);
-               bool construct_param = false;
-               if (accept (TokenType.CONSTRUCT)) {
-                       Report.warning (get_last_src (), "deprecated syntax, use assignments in the method body");
-                       construct_param = true;
-               }
                var direction = ParameterDirection.IN;
                if (accept (TokenType.OUT)) {
                        direction = ParameterDirection.OUT;
@@ -2704,7 +2699,6 @@ public class Vala.Parser : CodeVisitor {
                set_attributes (param, attrs);
                param.direction = direction;
                param.params_array = params_array;
-               param.construct_parameter = construct_param;
                if (accept (TokenType.ASSIGN)) {
                        param.default_expression = parse_expression ();
                }