vala r2433 - in trunk: . vala



Author: juergbi
Date: Thu Feb 12 13:37:49 2009
New Revision: 2433
URL: http://svn.gnome.org/viewvc/vala?rev=2433&view=rev

Log:
2009-02-12  JÃrg Billeter  <j bitron ch>

	* vala/valagenieparser.vala:

	Fix else if parsing, fixes bug 562632


Modified:
   trunk/ChangeLog
   trunk/vala/valagenieparser.vala

Modified: trunk/vala/valagenieparser.vala
==============================================================================
--- trunk/vala/valagenieparser.vala	(original)
+++ trunk/vala/valagenieparser.vala	Thu Feb 12 13:37:49 2009
@@ -1775,6 +1775,13 @@
 		var true_stmt = parse_embedded_statement ();
 		Block false_stmt = null;
 		if (accept (TokenType.ELSE)) {
+			// allow `else if' on the same line without `do'
+			if (!accept (TokenType.DO) && current () != TokenType.IF) {
+				expect (TokenType.EOL);
+			} else {
+				accept (TokenType.EOL);
+			}
+
 			false_stmt = parse_embedded_statement ();
 		}
 		return new IfStatement (condition, true_stmt, false_stmt, src);



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