[vala] Report error for properties using `async' or `throws'



commit 9d99bb994932ed6b00a1900f2929badcffbb97f6
Author: Jürg Billeter <j bitron ch>
Date:   Tue Sep 15 10:32:55 2009 +0200

    Report error for properties using `async' or `throws'

 vala/valaparser.vala |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 0ee18a3..962ff4c 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)) {



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