From: Jürg Billeter Date: Tue, 15 Sep 2009 08:32:55 +0000 (+0200) Subject: Report error for properties using `async' or `throws' X-Git-Tag: 0.7.6~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d99bb994932ed6b00a1900f2929badcffbb97f6;p=thirdparty%2Fvala.git Report error for properties using `async' or `throws' --- diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 0ee18a301..962ff4ca6 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -1841,6 +1841,7 @@ public class Vala.Parser : CodeVisitor { default: return parse_field_declaration (attrs); } case TokenType.OPEN_BRACE: + case TokenType.THROWS: rollback (begin); return parse_property_declaration (attrs); default: @@ -2328,9 +2329,18 @@ public class Vala.Parser : CodeVisitor { if (ModifierFlags.NEW in flags) { prop.hides = true; } + if (ModifierFlags.ASYNC in flags) { + Report.error (prop.source_reference, "async properties are not supported yet"); + } if (ModifierFlags.EXTERN in flags || scanner.source_file.external_package) { prop.external = true; } + if (accept (TokenType.THROWS)) { + do { + prop.add_error_type (parse_type ()); + } while (accept (TokenType.COMMA)); + Report.error (prop.source_reference, "properties throwing errors are not supported yet"); + } expect (TokenType.OPEN_BRACE); while (current () != TokenType.CLOSE_BRACE) { if (accept (TokenType.DEFAULT)) {