]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Drop deprecated syntax support of # modifier and operator 62328aabd0b8a6d3a96fef0a7df2c50c04a6e7db
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 22 Sep 2018 20:05:14 +0000 (22:05 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 22 Sep 2018 20:05:14 +0000 (22:05 +0200)
owned modifier and (owned) cast should be used instead for a long time.

Fixes https://gitlab.gnome.org/GNOME/vala/issues/677

vala/valagenieparser.vala
vala/valaparser.vala

index 0220deafa32e56d02c0767cf5e7a4b0dc2b28b82..93374b443fdd70c4686b8fee067116933d8193fd 100644 (file)
@@ -484,7 +484,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                }
                accept (TokenType.OP_NEG);
                accept (TokenType.INTERR);
-               accept (TokenType.HASH);
        }
 
 
@@ -613,10 +612,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                        }
                }
 
-               if (!owned_by_default) {
-                       value_owned = accept (TokenType.HASH);
-               }
-
                if (type is PointerType) {
                        value_owned = false;
                }
@@ -1235,13 +1230,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                        return new UnaryExpression (operator, op, get_src (begin));
                }
                switch (current ()) {
-               case TokenType.HASH:
-                       if (!context.deprecated) {
-                               Report.warning (get_src (begin), "deprecated syntax, use `(owned)` cast");
-                       }
-                       next ();
-                       var op = parse_unary_expression ();
-                       return new ReferenceTransferExpression (op, get_src (begin));
                case TokenType.OPEN_PARENS:
                        next ();
                        switch (current ()) {
index 05b7139bf51526e97d39417b642969f32c153339..f110452b48224893c45ac704984b7f5f098f1d8d 100644 (file)
@@ -419,7 +419,6 @@ public class Vala.Parser : CodeVisitor {
                        accept (TokenType.INTERR);
                }
                accept (TokenType.OP_NEG);
-               accept (TokenType.HASH);
        }
 
        bool is_inner_array_type () {
@@ -528,15 +527,6 @@ public class Vala.Parser : CodeVisitor {
                        Report.warning (get_last_src (), "obsolete syntax, types are non-null by default");
                }
 
-               if (!owned_by_default) {
-                       if (accept (TokenType.HASH)) {
-                               if (!context.deprecated) {
-                                       Report.warning (get_last_src (), "deprecated syntax, use `owned` modifier");
-                               }
-                               value_owned = true;
-                       }
-               }
-
                if (type is PointerType) {
                        value_owned = false;
                }
@@ -1069,13 +1059,6 @@ public class Vala.Parser : CodeVisitor {
                        return new UnaryExpression (operator, op, get_src (begin));
                }
                switch (current ()) {
-               case TokenType.HASH:
-                       if (!context.deprecated) {
-                               Report.warning (get_last_src (), "deprecated syntax, use `(owned)` cast");
-                       }
-                       next ();
-                       var op = parse_unary_expression ();
-                       return new ReferenceTransferExpression (op, get_src (begin));
                case TokenType.OPEN_PARENS:
                        next ();
                        switch (current ()) {
@@ -2785,15 +2768,6 @@ public class Vala.Parser : CodeVisitor {
                var access = parse_access_modifier ();
                var flags = parse_member_declaration_modifiers ();
                var type = parse_type (true, true);
-
-               bool getter_owned = false;
-               if (accept (TokenType.HASH)) {
-                       if (!context.deprecated) {
-                               Report.warning (get_last_src (), "deprecated syntax, use `owned` modifier before `get'");
-                       }
-                       getter_owned = true;
-               }
-
                string id = parse_identifier ();
                var prop = new Property (id, type, null, null, get_src (begin), comment);
                prop.access = access;
@@ -2866,10 +2840,6 @@ public class Vala.Parser : CodeVisitor {
                                                throw new ParseError.SYNTAX ("property get accessor already defined");
                                        }
 
-                                       if (getter_owned) {
-                                               value_type.value_owned = true;
-                                       }
-
                                        Block block = null;
                                        if (!accept (TokenType.SEMICOLON)) {
                                                block = parse_block ();