]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error on unexpected closing brace at end of file
authorJürg Billeter <j@bitron.ch>
Thu, 1 Oct 2009 17:58:43 +0000 (19:58 +0200)
committerJürg Billeter <j@bitron.ch>
Thu, 1 Oct 2009 17:58:43 +0000 (19:58 +0200)
vala/valaparser.vala

index e9add951ecb6557e206c2cb0b6ef5192a84dbb30..4c2d39734b176d3b5990d8b1fba5ea4a569ec1c5 100644 (file)
@@ -312,6 +312,12 @@ public class Vala.Parser : CodeVisitor {
                try {
                        parse_using_directives (context.root);
                        parse_declarations (context.root, true);
+                       if (accept (TokenType.CLOSE_BRACE)) {
+                               // only report error if it's not a secondary error
+                               if (context.report.get_errors () == 0) {
+                                       Report.error (get_last_src (), "unexpected `}'");
+                               }
+                       }
                } catch (ParseError e) {
                        // already reported
                }