[vala] dova: Do not accept `unowned' or `owned' in dova profile



commit f447271453998806fe88cd4a9c912c532d2ef1ab
Author: Jürg Billeter <j bitron ch>
Date:   Sat Mar 13 20:18:28 2010 +0100

    dova: Do not accept `unowned' or `owned' in dova profile
    
    This also changes property get accessors to return owned values.

 vala/valaparser.vala |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index d0649cd..c900b71 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -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'");
 			}



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