From: Jürg Billeter Date: Mon, 13 Sep 2010 20:05:21 +0000 (+0200) Subject: girparser: Update to prefix handling used in GIR version 1.2 X-Git-Tag: 0.10.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2a1fee47b33dec610ddb1ebf926de128a536f76;p=thirdparty%2Fvala.git girparser: Update to prefix handling used in GIR version 1.2 --- diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index f213b4da4..5bb2d73c2 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -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) + "_"); @@ -1044,6 +1044,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; @@ -1060,6 +1061,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 ();