From: Jean Privat Date: Mon, 31 Aug 2009 21:32:02 +0000 (-0400) Subject: nitdoc: show closure in signatures X-Git-Tag: v0.4~132 X-Git-Url: http://nitlanguage.org?hp=4c98ba11a22ba82908aa5879e8c1aad535e634f4 nitdoc: show closure in signatures Signed-off-by: Jean Privat --- diff --git a/src/nitdoc.nit b/src/nitdoc.nit index dfd5ec8..a0cf48c 100644 --- a/src/nitdoc.nit +++ b/src/nitdoc.nit @@ -453,7 +453,7 @@ special MMEntity redef fun prototype_body(dctx) do var res = new Buffer - res.append(signature.to_html(dctx)) + res.append(signature.to_html(dctx, true)) var s = self if s isa MMMethod then if s.is_abstract then @@ -1102,7 +1102,7 @@ end redef class MMSignature # Htlm transcription of the signature (with nested links) - fun to_html(dctx: DocContext): String + fun to_html(dctx: DocContext, with_closure: Bool): String do var res = new Buffer if arity > 0 then @@ -1118,6 +1118,16 @@ redef class MMSignature res.append(": ") res.append(return_type.html_link(dctx)) end + if with_closure then + for c in closures do + res.append(" ") + if c.is_optional then res.append("[") + if c.is_break then res.append("break ") + res.append("!{c.name}") + res.append(c.signature.to_html(dctx, false)) + if c.is_optional then res.append("]") + end + end return res.to_s end end