From 7e0aa5f0028ed36df0408d0ae309cc0625eb020c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Sat, 22 Jan 2011 13:59:35 +0100 Subject: [PATCH] AutoDoc: Fixed generation of HTML for function types. --- refdoc/presentation/make_html.pike | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/refdoc/presentation/make_html.pike b/refdoc/presentation/make_html.pike index 4c5dbd79d2..5efbe1b4fe 100644 --- a/refdoc/presentation/make_html.pike +++ b/refdoc/presentation/make_html.pike @@ -761,7 +761,8 @@ string parse_type(Node n, void|string debug) { case "type": ret += "<font color='#202020'>type</font>"; - if (n->count_children() && (c = get_first_element(n))) { + if (n->count_children() && (c = get_first_element(n)) && + (c->get_any_name() != "mixed")) { ret += "(" + parse_type(c) + ")"; } break; @@ -793,15 +794,16 @@ string parse_type(Node n, void|string debug) { case "function": ret += "<font color='#202020'>function</font>"; - c = n->get_first_element("argtype"); + array(Node) args = n->get_elements("argtype"); d = n->get_first_element("returntype"); // Doing different than the XSL here. Must both // argtype and returntype be defined? - if(c || d) { + if(args || d) { ret += "("; - if(c) ret += map(c->get_children(), parse_type)*", "; + if(args) ret += map(args->get_children() * ({}), parse_type)*", "; ret += ":"; if(d) ret += parse_type( get_first_element(d) ); + else ret += "<font color='#202020'>void</font>"; ret += ")"; } break; -- GitLab