Commit 4e1d4bca authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

improve error handling, fixes bug 528431

2008-04-16  Juerg Billeter  <j@bitron.ch>

	* vala/valaparser.vala: improve error handling, fixes bug 528431

svn path=/trunk/; revision=1246
parent 5e24e1ea
2008-04-16 Jürg Billeter <j@bitron.ch>
* vala/valaparser.vala: improve error handling, fixes bug 528431
2008-04-16 Jürg Billeter <j@bitron.ch>
* gobject/valaccodegeneratorinvocationexpression.vala:
......
......@@ -468,6 +468,11 @@ public class Vala.Parser : CodeVisitor {
found = false;
break;
}
if (expr == null) {
// workaround for current limitation of exception handling
throw new ParseError.SYNTAX ("syntax error in primary expression");
}
}
return expr;
......@@ -1074,6 +1079,10 @@ public class Vala.Parser : CodeVisitor {
next ();
var rhs = parse_expression ();
expr = context.create_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 ();
......@@ -1082,6 +1091,10 @@ public class Vala.Parser : CodeVisitor {
next ();
var rhs = parse_expression ();
expr = context.create_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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment