redef meth prototype_head(dctx)
do
- var res = ""
+ var res = new Buffer
var intro_class = known_intro_class(dctx)
var is_redef = local_class != intro_class
res.append(" {intro_class.module.html_link(dctx)}::")
end
end
- return res
+ return res.to_s
end
redef meth prototype_body(dctx)
do
- var res = signature.to_html(dctx)
+ var res = new Buffer
+ res.append(signature.to_html(dctx))
var s = self
if s.node != null then
if s.node isa ADeferredMethPropdef then
res.append(" is intern")
end
end
- return res
+ return res.to_s
end
redef meth need_doc(dctx)
redef meth doc
do
var n = node
- if not node isa PPropdef then
+ if n == null or not node isa PPropdef then
return null
end
assert n isa PPropdef
end
else
for m in owned_modules do
- var mc = m[c.global]
- if mc != null and mc.need_doc(dctx) then
- new_classes.add(c)
- break
+ if m.global_classes.has(c.global) then
+ var mc = m[c.global]
+ if mc.need_doc(dctx) then
+ new_classes.add(c)
+ break
+ end
end
end
end
# Html transcription of the doc
meth to_html: String
do
- var res = new String
+ var res = new Buffer
for c in n_comment do
res.append(c.text.substring_from(1))
end
- return res
+ return res.to_s
end
# Oneliner transcription of the doc
redef meth need_doc(dctx) do
if module == dctx.module then
for m in dctx.owned_modules do
- var c = m[global]
- if c != null and c.need_doc(dctx) then return true
+ if m.global_classes.has(global) then
+ var c = m[global]
+ if c.need_doc(dctx) then return true
+ end
end
end
return false
redef meth prototype_head(dctx)
do
- var res = ""
+ var res = new Buffer
var ki = known_intro(dctx)
var is_redef = ki != self
if is_redef then res.append("redef ")
if global.visibility_level == 3 then res.append("private ")
res.append("class ")
if is_redef then res.append("{ki.module.html_link(dctx)}::")
- return res
+ return res.to_s
end
redef meth prototype_body(dctx)
do
- var res = ""
+ var res = new Buffer
if arity > 0 then
res.append("[")
for i in [0..arity[ do
end
res.append("]")
end
- return res
+ return res.to_s
end
# Extract the doc of a class
if p.local_class != self or not p.need_doc(dctx) then
var cla = new Array[MMLocalClass]
for m in dctx.owned_modules do
+ if not m.global_classes.has(global) then continue
var c = m[global]
- if c == null or not c isa MMConcreteClass then continue
+ if not c isa MMConcreteClass then continue
+ if not c.has_global_property(g) then continue
var p2 = c[g]
- if p2 == null or p2.local_class != c or not p2.need_doc(dctx) then continue
+ if p2.local_class != c or not p2.need_doc(dctx) then continue
cla.add(c)
end
if cla.is_empty then continue
# Htlm transcription of the signature (with nested links)
meth to_html(dctx: DocContext): String
do
- var res = new String
+ var res = new Buffer
if arity > 0 then
res.append("(")
res.append(self[0].html_link(dctx))
res.append(": ")
res.append(return_type.html_link(dctx))
end
- return res
+ return res.to_s
end
end
redef class MMTypeGeneric
redef meth html_link(dctx)
do
- var res = local_class.html_link(dctx)
+ var res = new Buffer
+ res.append(local_class.html_link(dctx))
res.append("[")
res.append(params[0].html_link(dctx))
for i in [1..params.length[ do
res.append(params[i].html_link(dctx))
end
res.append("]")
- return res
+ return res.to_s
end
end