From: Jürg Billeter Date: Thu, 16 Sep 2010 15:39:58 +0000 (+0200) Subject: girparser: Report error on unsupported GIR version X-Git-Tag: 0.10.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fd20bd2edd5903e04085289397d02daeed556bf;p=thirdparty%2Fvala.git girparser: Report error on unsupported GIR version Fixes bug 629805. --- diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 53cb317dd..054038851 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -131,8 +131,14 @@ public class Vala.GirParser : CodeVisitor { return new SourceReference (this.current_source_file, begin.line, begin.column, end.line, end.column); } + const string GIR_VERSION = "1.2"; + void parse_repository () { start_element ("repository"); + if (reader.get_attribute ("version") != GIR_VERSION) { + Report.error (get_current_src (), "unsupported GIR version %s (supported: %s)".printf (reader.get_attribute ("version"), GIR_VERSION)); + return; + } next (); while (current_token == MarkupTokenType.START_ELEMENT) { if (reader.name == "namespace") {