don't report secondary syntax errors, fixes bug 511896
authorJuerg Billeter <j@bitron.ch>
Fri, 18 Apr 2008 21:40:37 +0000 (21:40 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 18 Apr 2008 21:40:37 +0000 (21:40 +0000)
2008-04-18  Juerg Billeter  <j@bitron.ch>

* vala/valaparser.vala: don't report secondary syntax errors,
  fixes bug 511896

svn path=/trunk/; revision=1256

ChangeLog
vala/valaparser.vala

index 42b2492..ec3f6fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-04-18  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valaparser.vala: don't report secondary syntax errors,
+         fixes bug 511896
+
+2008-04-18  Jürg Billeter  <j@bitron.ch>
+
        * vala/valaclass.vala, gobject/valaccodegeneratorclass.vala: make
          sure that ref_function and unref_function of classes deriving
          from GTypeInstance are always initialized
index d5f7157..f2e591c 100644 (file)
@@ -1283,7 +1283,10 @@ public class Vala.Parser : CodeVisitor {
                var block = context.create_block (get_src_com (begin));
                parse_statements (block);
                if (!accept (TokenType.CLOSE_BRACE)) {
-                       Report.error (get_current_src (), "expected `}'");
+                       // only report error if it's not a secondary error
+                       if (Report.get_errors () == 0) {
+                               Report.error (get_current_src (), "expected `}'");
+                       }
                }
 
                return block;
@@ -1724,7 +1727,10 @@ public class Vala.Parser : CodeVisitor {
                }
                if (!root) {
                        if (!accept (TokenType.CLOSE_BRACE)) {
-                               Report.error (get_current_src (), "expected `}'");
+                               // only report error if it's not a secondary error
+                               if (Report.get_errors () == 0) {
+                                       Report.error (get_current_src (), "expected `}'");
+                               }
                        }
                }
        }