From: Jürg Billeter Date: Thu, 1 Oct 2009 17:58:43 +0000 (+0200) Subject: Report error on unexpected closing brace at end of file X-Git-Tag: 0.7.8~82 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a125fbe7fb27a7293a3a60bdc8355ab76b3b5f2;p=thirdparty%2Fvala.git Report error on unexpected closing brace at end of file --- diff --git a/vala/valaparser.vala b/vala/valaparser.vala index e9add951e..4c2d39734 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -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 }