From: Florian Brosch Date: Tue, 26 Aug 2014 01:46:09 +0000 (+0200) Subject: gir-importer: docbook: process all iter = gir_comment.parameter_iterator (); - for (bool has_next = iter.next (); has_next; has_next = iter.next ()) { - Taglets.Param? taglet = this.parse_block_taglet (iter.get_value (), "param") as Taglets.Param; - if (taglet == null) { - return null; - } - taglet.parameter_name = iter.get_key (); + // version: + if (gir_comment.version_comment != null) { + Note? note = _parse_note (gir_comment.version_comment); + add_note (ref cmnt, note); + } + + // stability: + if (gir_comment.stability_comment != null) { + Note? note = _parse_note (gir_comment.stability_comment); + add_note (ref cmnt, note); + } - if (taglet.parameter_name == gir_comment.instance_param_name) { - taglet.parameter_name = "this"; - taglet.is_c_self_param = true; - } - comment.taglets.add (taglet); + // return: + if (gir_comment.return_comment != null) { + Taglet? taglet = parse_block_taglet (gir_comment.return_comment, "return"); + add_taglet (ref cmnt, taglet); + } + + + // parameters: + MapIterator iter = gir_comment.parameter_iterator (); + for (bool has_next = iter.next (); has_next; has_next = iter.next ()) { + Taglets.Param? taglet = parse_block_taglet (iter.get_value (), "param") as Taglets.Param; + string param_name = iter.get_key (); + + taglet.is_c_self_param = (param_name == gir_comment.instance_param_name); + taglet.parameter_name = param_name; + add_taglet (ref cmnt, taglet); } + bool first = true; foreach (LinkedList note in this.footnotes) { if (first == true && note.size > 0) { Paragraph p = note.first () as Paragraph; if (p == null) { p = factory.create_paragraph (); - comment.content.add (p); + cmnt.content.add (p); } p.content.insert (0, factory.create_text ("\n")); } - comment.content.add_all (note); + cmnt.content.add_all (note); first = false; } - return comment; + return cmnt; } private Taglet? parse_block_taglet (Api.SourceComment gir_comment, string taglet_name) { @@ -192,7 +247,7 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { return taglet as Taglet; } - private Comment? parse_main_content (Api.GirSourceComment gir_comment) { + private Comment? parse_root_content (Api.SourceComment gir_comment) { this.reset (gir_comment); current = null; @@ -391,7 +446,9 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { } string id = current.attributes.get ("id"); - id_registrar.register_symbol (id, element); + if (id != null) { + id_registrar.register_symbol (id, element); + } next (); if (!check_xml_close_tag ("anchor")) { @@ -844,7 +901,9 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { } string id = current.attributes.get ("id"); - id_registrar.register_symbol (id, element); + if (id != null) { + id_registrar.register_symbol (id, element); + } next (); parse_docbook_spaces (); @@ -1117,7 +1176,9 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { } string id = current.attributes.get ("id"); - id_registrar.register_symbol (id, element); + if (id != null) { + id_registrar.register_symbol (id, element); + } next (); LinkedList content = parse_mixed_content ();