[vala] POSIX: Do not accept `construct' in parser



commit eac962eff09b93e1b2f13d80333b93f17f9a08b8
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jun 16 10:59:09 2009 +0200

    POSIX: Do not accept `construct' in parser

 vala/valaparser.vala |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 085e927..5afcd4e 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -1754,8 +1754,11 @@ public class Vala.Parser : CodeVisitor {
 	
 		switch (current ()) {	
 		case TokenType.CONSTRUCT:
-			rollback (begin);
-			return parse_constructor_declaration (attrs);
+			if (context.profile == Profile.GOBJECT) {
+				rollback (begin);
+				return parse_constructor_declaration (attrs);
+			}
+			break;
 		case TokenType.TILDE:
 			rollback (begin);
 			return parse_destructor_declaration (attrs);
@@ -2315,8 +2318,8 @@ public class Vala.Parser : CodeVisitor {
 					bool writable, _construct;
 					if (accept (TokenType.SET)) {
 						writable = true;
-						_construct = accept (TokenType.CONSTRUCT);
-					} else if (accept (TokenType.CONSTRUCT)) {
+						_construct = (context.profile == Profile.GOBJECT) && accept (TokenType.CONSTRUCT);
+					} else if (context.profile == Profile.GOBJECT && accept (TokenType.CONSTRUCT)) {
 						_construct = true;
 						writable = accept (TokenType.SET);
 					} else {



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