]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dova: Do not accept `unowned' or `owned' in dova profile
authorJürg Billeter <j@bitron.ch>
Sat, 13 Mar 2010 19:18:28 +0000 (20:18 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 13 Mar 2010 19:18:28 +0000 (20:18 +0100)
This also changes property get accessors to return owned values.

vala/valaparser.vala

index d0649cd66774bb1dc91d06db29412b4a60606fbf..c900b7196ed5e50df1278867c4fc1d276d42bff8 100644 (file)
@@ -400,12 +400,12 @@ public class Vala.Parser : CodeVisitor {
                bool value_owned = owned_by_default;
 
                if (owned_by_default) {
-                       if (accept (TokenType.UNOWNED)
+                       if ((context.profile != Profile.DOVA && accept (TokenType.UNOWNED))
                            || accept (TokenType.WEAK)) {
                                value_owned = false;
                        }
                } else {
-                       value_owned = accept (TokenType.OWNED);
+                       value_owned = (context.profile != Profile.DOVA && accept (TokenType.OWNED));
                }
 
                var sym = parse_symbol_name ();
@@ -458,7 +458,7 @@ public class Vala.Parser : CodeVisitor {
                }
 
                if (!owned_by_default) {
-                       if (accept (TokenType.HASH)) {
+                       if (context.profile != Profile.DOVA && accept (TokenType.HASH)) {
                                if (!context.deprecated) {
                                        Report.warning (get_last_src (), "deprecated syntax, use `owned` modifier");
                                }
@@ -2400,7 +2400,9 @@ public class Vala.Parser : CodeVisitor {
                var type = parse_type ();
 
                bool getter_owned = false;
-               if (accept (TokenType.HASH)) {
+               if (context.profile == Profile.DOVA) {
+                       getter_owned = true;
+               } else if (accept (TokenType.HASH)) {
                        if (!context.deprecated) {
                                Report.warning (get_last_src (), "deprecated syntax, use `owned` modifier before `get'");
                        }