]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error for properties using `async' or `throws'
authorJürg Billeter <j@bitron.ch>
Tue, 15 Sep 2009 08:32:55 +0000 (10:32 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 15 Sep 2009 08:33:58 +0000 (10:33 +0200)
vala/valaparser.vala

index 0ee18a301e6e84242a016071e05c5c57d8e94664..962ff4ca6a78871a90395d6701a31f148c4d294e 100644 (file)
@@ -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)) {