[vala/staging] Drop deprecated syntax support of # modifier and operator



commit 62328aabd0b8a6d3a96fef0a7df2c50c04a6e7db
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Sep 22 22:05:14 2018 +0200

    Drop deprecated syntax support of # modifier and operator
    
    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 | 12 ------------
 vala/valaparser.vala      | 30 ------------------------------
 2 files changed, 42 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 0220deafa..93374b443 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -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 ()) {
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 05b7139bf..f110452b4 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -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 ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]