vala r2139 - in trunk: . vala



Author: juergbi
Date: Sat Dec 13 11:02:21 2008
New Revision: 2139
URL: http://svn.gnome.org/viewvc/vala?rev=2139&view=rev

Log:
2008-12-13  JÃrg Billeter  <j bitron ch>

	* vala/valagenieparser.vala:
	* vala/valaparser.vala:

	Remove workarounds for old Vala versions


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

Modified: trunk/vala/valagenieparser.vala
==============================================================================
--- trunk/vala/valagenieparser.vala	(original)
+++ trunk/vala/valagenieparser.vala	Sat Dec 13 11:02:21 2008
@@ -573,11 +573,6 @@
 			break;
 		}
 
-		if (expr == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in primary expression");
-		}
-
 		// process primary expressions that start with an inner primary expression
 		bool found = true;
 		while (found) {
@@ -605,11 +600,6 @@
 				found = false;
 				break;
 			}
-
-			if (expr == null) {
-				// workaround for current limitation of exception handling
-				throw new ParseError.SYNTAX ("syntax error in primary expression");
-			}
 		}
 
 		return expr;
@@ -1430,10 +1420,6 @@
 				next ();
 				var rhs = parse_expression ();
 				expr = new Assignment (expr, rhs, operator, get_src (begin));
-				if (expr == null) {
-					// workaround for current limitation of exception handling
-					throw new ParseError.SYNTAX ("syntax error in assignment");
-				}
 			} else if (current () == TokenType.OP_GT) { // >>=
 				char* first_gt_pos = tokens[index].begin.pos;
 				next ();
@@ -1442,10 +1428,6 @@
 					next ();
 					var rhs = parse_expression ();
 					expr = new Assignment (expr, rhs, AssignmentOperator.SHIFT_RIGHT, get_src (begin));
-					if (expr == null) {
-						// workaround for current limitation of exception handling
-						throw new ParseError.SYNTAX ("syntax error in assignment");
-					}
 				} else {
 					prev ();
 					break;
@@ -1590,10 +1572,6 @@
 				}
 
 				if (!is_decl) {
-					if (stmt == null) {
-						// workaround for current limitation of exception handling
-						throw new ParseError.SYNTAX ("syntax error in statement");
-					}
 					block.add_statement (stmt);
 				}
 			} catch (ParseError e) {
@@ -1651,12 +1629,7 @@
 		comment = scanner.pop_comment ();
 
 		var block = new Block (get_src_com (get_location ()));
-		var stmt = parse_embedded_statement_without_block ();
-		if (stmt == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in embedded statement");
-		}
-		block.add_statement (stmt);
+		block.add_statement (parse_embedded_statement_without_block ());
 		return block;
 
 	}
@@ -2319,9 +2292,6 @@
 			ns.add_field (field);
 		} else if (sym is Constant) {
 			ns.add_constant ((Constant) sym);
-		} else if (sym == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in declaration");
 		} else {
 			Report.error (sym.source_reference, "unexpected declaration in namespace");
 		}
@@ -2465,9 +2435,6 @@
 			 }
 		} else if (sym is Destructor) {
 			cl.destructor = (Destructor) sym;
-		} else if (sym == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in declaration");
 		} else {
 			Report.error (sym.source_reference, "unexpected declaration in class");
 		}
@@ -2983,9 +2950,6 @@
 			st.add_field ((Field) sym);
 		} else if (sym is Constant) {
 			st.add_constant ((Constant) sym);
-		} else if (sym == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in declaration");
 		} else {
 			Report.error (sym.source_reference, "unexpected declaration in struct");
 		}
@@ -3058,9 +3022,6 @@
 			iface.add_field ((Field) sym);
 		} else if (sym is Property) {
 			iface.add_property ((Property) sym);
-		} else if (sym == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in declaration");
 		} else {
 			Report.error (sym.source_reference, "unexpected declaration in interface");
 		}
@@ -3200,7 +3161,6 @@
 				return flags;
 			}
 		}
-		return flags;
 	}
 
 	ModifierFlags parse_member_declaration_modifiers () {
@@ -3243,7 +3203,6 @@
 				return flags;
 			}
 		}
-		return flags;
 	}
 
 	FormalParameter parse_parameter () throws ParseError {

Modified: trunk/vala/valaparser.vala
==============================================================================
--- trunk/vala/valaparser.vala	(original)
+++ trunk/vala/valaparser.vala	Sat Dec 13 11:02:21 2008
@@ -476,11 +476,6 @@
 			break;
 		}
 
-		if (expr == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in primary expression");
-		}
-
 		// process primary expressions that start with an inner primary expression
 		bool found = true;
 		while (found) {
@@ -507,11 +502,6 @@
 				found = false;
 				break;
 			}
-
-			if (expr == null) {
-				// workaround for current limitation of exception handling
-				throw new ParseError.SYNTAX ("syntax error in primary expression");
-			}
 		}
 
 		return expr;
@@ -1144,10 +1134,6 @@
 				next ();
 				var rhs = parse_expression ();
 				expr = new Assignment (expr, rhs, operator, get_src (begin));
-				if (expr == null) {
-					// workaround for current limitation of exception handling
-					throw new ParseError.SYNTAX ("syntax error in assignment");
-				}
 			} else if (current () == TokenType.OP_GT) { // >>=
 				char* first_gt_pos = tokens[index].begin.pos;
 				next ();
@@ -1156,10 +1142,6 @@
 					next ();
 					var rhs = parse_expression ();
 					expr = new Assignment (expr, rhs, AssignmentOperator.SHIFT_RIGHT, get_src (begin));
-					if (expr == null) {
-						// workaround for current limitation of exception handling
-						throw new ParseError.SYNTAX ("syntax error in assignment");
-					}
 				} else {
 					prev ();
 					break;
@@ -1254,10 +1236,6 @@
 				}
 
 				if (!is_decl) {
-					if (stmt == null) {
-						// workaround for current limitation of exception handling
-						throw new ParseError.SYNTAX ("syntax error in statement");
-					}
 					block.add_statement (stmt);
 				}
 			} catch (ParseError e) {
@@ -1315,12 +1293,7 @@
 		comment = scanner.pop_comment ();
 
 		var block = new Block (get_src_com (get_location ()));
-		var stmt = parse_embedded_statement_without_block ();
-		if (stmt == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in embedded statement");
-		}
-		block.add_statement (stmt);
+		block.add_statement (parse_embedded_statement_without_block ());
 		return block;
 
 	}
@@ -1501,9 +1474,7 @@
 				is_expr = true;
 				break;
 			default:
-				// workaround for current limitation of exception handling
-				bool local_is_expr = is_expression ();
-				is_expr = local_is_expr;
+				is_expr = is_expression ();
 				break;
 			}
 
@@ -1926,9 +1897,6 @@
 			ns.add_field (field);
 		} else if (sym is Constant) {
 			ns.add_constant ((Constant) sym);
-		} else if (sym == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in declaration");
 		} else {
 			Report.error (sym.source_reference, "unexpected declaration in namespace");
 		}
@@ -2035,9 +2003,6 @@
 			}
 		} else if (sym is Destructor) {
 			cl.destructor = (Destructor) sym;
-		} else if (sym == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in declaration");
 		} else {
 			Report.error (sym.source_reference, "unexpected declaration in class");
 		}
@@ -2414,9 +2379,6 @@
 			st.add_field ((Field) sym);
 		} else if (sym is Constant) {
 			st.add_constant ((Constant) sym);
-		} else if (sym == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in declaration");
 		} else {
 			Report.error (sym.source_reference, "unexpected declaration in struct");
 		}
@@ -2484,9 +2446,6 @@
 			iface.add_field ((Field) sym);
 		} else if (sym is Property) {
 			iface.add_property ((Property) sym);
-		} else if (sym == null) {
-			// workaround for current limitation of exception handling
-			throw new ParseError.SYNTAX ("syntax error in declaration");
 		} else {
 			Report.error (sym.source_reference, "unexpected declaration in interface");
 		}
@@ -2527,9 +2486,6 @@
 				var member_sym = parse_declaration ();
 				if (member_sym is Method) {
 					en.add_method ((Method) member_sym);
-				} else if (member_sym == null) {
-					// workaround for current limitation of exception handling
-					throw new ParseError.SYNTAX ("syntax error in declaration");
 				} else {
 					Report.error (member_sym.source_reference, "unexpected declaration in enum");
 				}
@@ -2587,9 +2543,6 @@
 				var member_sym = parse_declaration ();
 				if (member_sym is Method) {
 					ed.add_method ((Method) member_sym);
-				} else if (member_sym == null) {
-					// workaround for current limitation of exception handling
-					throw new ParseError.SYNTAX ("syntax error in declaration");
 				} else {
 					Report.error (member_sym.source_reference, "unexpected declaration in errordomain");
 				}
@@ -2651,7 +2604,6 @@
 				return flags;
 			}
 		}
-		return flags;
 	}
 
 	ModifierFlags parse_member_declaration_modifiers () {
@@ -2690,7 +2642,6 @@
 				return flags;
 			}
 		}
-		return flags;
 	}
 
 	FormalParameter parse_parameter () throws ParseError {



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