From: Florian Brosch Date: Mon, 30 Jan 2012 01:56:14 +0000 (+0100) Subject: gtkdoc-parser: Allow in ordered and itemized lists X-Git-Tag: 0.37.1~3^2~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e56988bd8fbc352fccd0429a85a0dcdb8104994;p=thirdparty%2Fvala.git gtkdoc-parser: Allow <title> in ordered and itemized lists --- diff --git a/src/libvaladoc/documentation/gtkdoccommentparser.vala b/src/libvaladoc/documentation/gtkdoccommentparser.vala index 36544c08c..e044bd463 100644 --- a/src/libvaladoc/documentation/gtkdoccommentparser.vala +++ b/src/libvaladoc/documentation/gtkdoccommentparser.vala @@ -607,28 +607,29 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { return (Warning?) parse_docbook_information_box_template ("warning", factory.create_warning ()); } - private inline Content.List? parse_docbook_orderedlist () { + private inline LinkedList<Block>? parse_docbook_orderedlist () { return parse_docbook_itemizedlist ("orderedlist", Content.List.Bullet.ORDERED); } - private Content.List? parse_docbook_itemizedlist (string tag_name = "itemizedlist", Content.List.Bullet bullet_type = Content.List.Bullet.UNORDERED) { + private LinkedList<Block>? parse_docbook_itemizedlist (string tag_name = "itemizedlist", Content.List.Bullet bullet_type = Content.List.Bullet.UNORDERED) { if (!check_xml_open_tag (tag_name)) { this.report_unexpected_token (current, "<%s>".printf (tag_name)); return null; } - next (); + + LinkedList<Block> content = new LinkedList<Block> (); parse_docbook_spaces (); + if (current.type == TokenType.XML_OPEN && current.content == "title") { + append_block_content_not_null (content, parse_docbook_title ()); + parse_docbook_spaces (); + } + Content.List list = factory.create_list (); list.bullet = bullet_type; - -// if (current.type == TokenType.XML_OPEN && current.content == "title") { - // TODO -// parse_docbook_title (); -// parse_docbook_spaces (); -// } + content.add (list); while (current.type == TokenType.XML_OPEN) { if (current.content == "listitem") { @@ -642,11 +643,11 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { if (!check_xml_close_tag (tag_name)) { this.report_unexpected_token (current, "</%s>".printf (tag_name)); - return list; + return content; } next (); - return list; + return content; } private Paragraph? parse_gtkdoc_paragraph () { @@ -1380,9 +1381,9 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { parse_docbook_spaces (false); if (current.type == TokenType.XML_OPEN && current.content == "itemizedlist") { - this.append_block_content_not_null (content, parse_docbook_itemizedlist ()); + this.append_block_content_not_null_all (content, parse_docbook_itemizedlist ()); } else if (current.type == TokenType.XML_OPEN && current.content == "orderedlist") { - this.append_block_content_not_null (content, parse_docbook_orderedlist ()); + this.append_block_content_not_null_all (content, parse_docbook_orderedlist ()); } else if (current.type == TokenType.XML_OPEN && current.content == "variablelist") { this.append_block_content_not_null_all (content, parse_docbook_variablelist ()); } else if (current.type == TokenType.XML_OPEN && current.content == "simplelist") {