[valadoc] gtkdoc-parser: Allow <title> in ordered and itemized lists



commit 5e56988bd8fbc352fccd0429a85a0dcdb8104994
Author: Florian Brosch <flo brosch gmail com>
Date:   Mon Jan 30 02:56:14 2012 +0100

    gtkdoc-parser: Allow <title> in ordered and itemized lists

 .../documentation/gtkdoccommentparser.vala         |   27 ++++++++++---------
 1 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/src/libvaladoc/documentation/gtkdoccommentparser.vala b/src/libvaladoc/documentation/gtkdoccommentparser.vala
index 36544c0..e044bd4 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") {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]