]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Update to prefix handling used in GIR version 1.2
authorJürg Billeter <j@bitron.ch>
Mon, 13 Sep 2010 20:05:21 +0000 (22:05 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 15 Sep 2010 21:03:44 +0000 (23:03 +0200)
vala/valagirparser.vala

index 13c021338cfa2bedb2beedf3440037beb8463042..94934bd61b03bd9af73bbb375b4149d73e9b1c03 100644 (file)
@@ -208,7 +208,7 @@ public class Vala.GirParser : CodeVisitor {
                        }
                }
 
-               string? cprefix = reader.get_attribute ("c:prefix");
+               string? cprefix = reader.get_attribute ("c:identifier-prefixes");
                if (cprefix != null) {
                        ns.add_cprefix (cprefix);
                        ns.set_lower_case_cprefix (Symbol.camel_case_to_lower_case (cprefix) + "_");
@@ -1043,6 +1043,7 @@ public class Vala.GirParser : CodeVisitor {
                start_element ("constructor");
                string name = reader.get_attribute ("name");
                string throws_string = reader.get_attribute ("throws");
+               string cname = reader.get_attribute ("c:identifier");
                next ();
 
                string? ctype;
@@ -1059,6 +1060,9 @@ public class Vala.GirParser : CodeVisitor {
                } else if (m.name.has_prefix ("new_")) {
                        m.name = m.name.offset ("new_".length);
                }
+               if (cname != null) {
+                       m.set_cname (cname);
+               }
                if (current_token == MarkupTokenType.START_ELEMENT && reader.name == "parameters") {
                        start_element ("parameters");
                        next ();