]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Report error on unsupported GIR version
authorJürg Billeter <j@bitron.ch>
Thu, 16 Sep 2010 15:39:58 +0000 (17:39 +0200)
committerJürg Billeter <j@bitron.ch>
Thu, 16 Sep 2010 15:40:47 +0000 (17:40 +0200)
Fixes bug 629805.

vala/valagirparser.vala

index 53cb317dddd42aa8ac7246ed87c3596726533da5..0540388510b603d9c3b9d28f307652d47a2128d8 100644 (file)
@@ -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") {