From: Jürg Billeter Date: Sat, 13 Mar 2010 19:18:28 +0000 (+0100) Subject: dova: Do not accept `unowned' or `owned' in dova profile X-Git-Tag: 0.8.0~198 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f447271453998806fe88cd4a9c912c532d2ef1ab;p=thirdparty%2Fvala.git dova: Do not accept `unowned' or `owned' in dova profile This also changes property get accessors to return owned values. --- diff --git a/vala/valaparser.vala b/vala/valaparser.vala index d0649cd66..c900b7196 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'"); }