From: Florian Brosch Date: Sun, 29 Jan 2012 19:32:00 +0000 (+0100) Subject: gtkdoc-importer: Add support for sections X-Git-Tag: 0.37.1~3^2~219 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=5ab247e291e7cf872be19b8141b7fe85af866d48;p=thirdparty%2Fvala.git gtkdoc-importer: Add support for sections --- diff --git a/src/libvaladoc/documentation/gtkdoccommentparser.vala b/src/libvaladoc/documentation/gtkdoccommentparser.vala index a437a663b..a91e1f508 100644 --- a/src/libvaladoc/documentation/gtkdoccommentparser.vala +++ b/src/libvaladoc/documentation/gtkdoccommentparser.vala @@ -882,12 +882,6 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { LinkedList content = new LinkedList (); - if (current.type == TokenType.XML_OPEN && current.content == "title") { - append_block_content_not_null (content, parse_docbook_title ()); - parse_docbook_spaces (); - } - - content.add_all (parse_mixed_content ()); /* @@ -932,11 +926,6 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { LinkedList content = new LinkedList (); - if (current.type == TokenType.XML_OPEN && current.content == "title") { - append_block_content_not_null (content, parse_docbook_title ()); - parse_docbook_spaces (); - } - this.append_block_content_not_null_all (content, parse_mixed_content ()); if (!check_xml_close_tag ("refsect2")) { @@ -1196,6 +1185,23 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { return table; } + private LinkedList parse_docbook_section () { + if (!check_xml_open_tag ("section")) { + } + string id = current.attributes.get ("id"); + next (); + + LinkedList content = parse_mixed_content (); + + if (!check_xml_close_tag ("section")) { + this.report_unexpected_token (current, ""); + return content; + } + + next (); + return content; + } + private LinkedList parse_block_content () { LinkedList content = new LinkedList (); @@ -1226,6 +1232,10 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { this.append_block_content_not_null_all (content, parse_docbook_refsect2 ()); } else if (current.type == TokenType.XML_OPEN && current.content == "figure") { this.append_block_content_not_null_all (content, parse_docbook_figure ()); + } else if (current.type == TokenType.XML_OPEN && current.content == "title") { + this.append_block_content_not_null (content, parse_docbook_title ()); + } else if (current.type == TokenType.XML_OPEN && current.content == "section") { + this.append_block_content_not_null_all (content, parse_docbook_section ()); } else if (current.type == TokenType.GTKDOC_PARAGRAPH) { this.append_block_content_not_null (content, parse_gtkdoc_paragraph ()); } else if (current.type == TokenType.GTKDOC_SOURCE_OPEN) {