[vala] Improve syntax error message for missing type in foreach
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Improve syntax error message for missing type in foreach
- Date: Sun, 19 Dec 2010 16:04:48 +0000 (UTC)
commit c00fb7018eb764e59fbe66af355814b2cd7074d1
Author: Jürg Billeter <j bitron ch>
Date: Sun Dec 19 17:03:10 2010 +0100
Improve syntax error message for missing type in foreach
Fixes bug 635903.
vala/valaparser.vala | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index d37b8e8..60ba794 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -1899,6 +1899,10 @@ public class Vala.Parser : CodeVisitor {
DataType type = null;
if (!accept (TokenType.VAR)) {
type = parse_type (true, true);
+ if (accept (TokenType.IN)) {
+ Report.error (type.source_reference, "syntax error, expected var or type");
+ throw new ParseError.SYNTAX ("expected var or type");
+ }
}
string id = parse_identifier ();
expect (TokenType.IN);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]