- res.append ")"
- end
- var ret = return_mtype
- if ret != null then
- res.append ": "
- res.add ret.linkto(v)
- end
- return res
- end
-end
-
-redef class CallSite
- redef fun infobox(v)
- do
- var res = new HInfoBox(v, "call {mpropdef}")
- res.href = v.hrefto(mpropdef)
- res.new_field("call").add(mpropdef.linkto(v)).add(msignature.linkto(v))
- if mpropdef.is_intro then
- else
- res.new_field("intro").add mproperty.intro.linkto_text(v, "in {mproperty.intro.mclassdef}")
- end
- var mdoc = mpropdef.mdoc
- if mdoc == null then mdoc = mproperty.intro.mdoc
- if mdoc != null then mdoc.fill_infobox(res)
-
- return res
- end
- redef fun linkto(v)
- do
- return mpropdef.linkto(v)
- end
-end
-
-redef class Variable
- super HInfoBoxable
- redef fun infobox(v)
- do
- var declared_type = self.declared_type
- if declared_type == null then
- var res = new HInfoBox(v, "{name}")
- res.new_field("local var").append("{name}")
- return res
- end
- var res = new HInfoBox(v, "{name}: {declared_type}")
- res.new_field("local var").append("{name}:").add(declared_type.linkto(v))
- return res
- end
-end
-
-
-##
-
-redef class ANode
- # Optionally creates a tag that encapsulate the AST element on HTML rendering
- protected fun make_tag(v: HighlightVisitor): nullable HTMLTag do return null
-
- # Add aditionnal information on a child-token and return an additionnal HInfoBox on it
- protected fun decorate_tag(v: HighlightVisitor, res: HTMLTag, token: Token): nullable HInfoBox
- do
- #debug("no decoration for {token.inspect}")
- #res.add_class("nc_error")
- return null
- end
-
- # Return a optional infobox
- fun infobox(v: HighlightVisitor): nullable HInfoBox do return null
-end
-
-redef class AQclassid
- redef fun decorate_tag(v, res, token)
- do
- if token != n_id then return null
- return parent.decorate_tag(v, res, token)
- end
-end
-
-redef class AQid
- redef fun decorate_tag(v, res, token)
- do
- if token != n_id then return null
- return parent.decorate_tag(v, res, token)
- end
-end
-
-redef class AStdClassdef
- redef fun make_tag(v)
- do
- var res = new HTMLTag("span")
- res.add_class("nc_cdef")
- var md = mclassdef
- if md != null then res.attr("id", md.to_s)
- return res
- end
- redef fun decorate_tag(v, res, token)
- do
- if not token isa TClassid then return null
- res.add_class("nc_def")
-
- var md = mclassdef
- if md == null then return null
- return md.infobox(v)
- end
-end
-redef class APropdef
- redef fun make_tag(v)
- do
- var res = new HTMLTag("span")
- res.add_class("nc_pdef")
- var mpd
- mpd = mpropdef
- if mpd != null then
- #res.add(tag(mpd))
- res.attr("id", mpd.to_s)