… and clean `RopeBuffer` a little bit.
Pull-Request: #965
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
# Set a 'value' for 'key'
# var img = new HTMLTag("img")
# img.attr("src", "./image.png").attr("alt", "image")
- # assert img.write_to_string == """<img src="./image.png" alt="image"/>"""
+ # assert img.write_to_string == """<img src="./image.png" alt="image"/>"""
fun attr(key: String, value: String): HTMLTag do
attrs[key] = value
return self
return buf.to_s
end
- # Escape the four characters `<`, `>`, `&`, and `"` with their html counterpart
+ # Escape the characters `<`, `>`, `&`, `"`, `'` and `/` as HTML/XML entity references.
#
- # assert "a&b->\"x\"".html_escape == "a&b->"x""
+ # assert "a&b-<>\"x\"/'".html_escape == "a&b-<>"x"/'"
+ #
+ # SEE: <https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content>
fun html_escape: SELFTYPE
do
var buf = new FlatBuffer
else if c == '>' then
buf.append ">"
else if c == '"' then
- buf.append """
+ buf.append """
+ else if c == '\'' then
+ buf.append "'"
+ else if c == '/' then
+ buf.append "/"
else buf.add c
end
var cds = mtype.collect_mclassdefs(self.mainmodule).to_a
self.mainmodule.linearize_mclassdefs(cds)
for cd in cds do
- if not self.modelbuilder.mclassdef2nclassdef.has_key(cd) then continue
- var n = self.modelbuilder.mclassdef2nclassdef[cd]
- for npropdef in n.n_propdefs do
- if npropdef isa AAttrPropdef then
- npropdef.init_expr(v, recv)
- end
+ for npropdef in modelbuilder.collect_attr_propdef(cd) do
+ npropdef.init_expr(v, recv)
end
end
end
var cds = mtype.collect_mclassdefs(self.mainmodule).to_a
self.mainmodule.linearize_mclassdefs(cds)
for cd in cds do
- if not self.modelbuilder.mclassdef2nclassdef.has_key(cd) then continue
- var n = self.modelbuilder.mclassdef2nclassdef[cd]
- for npropdef in n.n_propdefs do
- if npropdef isa AAttrPropdef then
- npropdef.check_expr(v, recv)
- end
+ for npropdef in modelbuilder.collect_attr_propdef(cd) do
+ npropdef.check_expr(v, recv)
end
end
end
do
if is_abstract then return true
var modelbuilder = v.compiler.modelbuilder
- if modelbuilder.mpropdef2npropdef.has_key(self) then
- var npropdef = modelbuilder.mpropdef2npropdef[self]
- return npropdef.can_inline
- else if self.mproperty.is_root_init then
+ var node = modelbuilder.mpropdef2node(self)
+ if node isa APropdef then
+ return node.can_inline
+ else if node isa AClassdef then
# Automatic free init is always inlined since it is empty or contains only attribtes assigments
return true
else
do
var modelbuilder = v.compiler.modelbuilder
var val = constant_value
- if modelbuilder.mpropdef2npropdef.has_key(self) then
- var npropdef = modelbuilder.mpropdef2npropdef[self]
+ var node = modelbuilder.mpropdef2node(self)
+ if node isa APropdef then
var oldnode = v.current_node
- v.current_node = npropdef
+ v.current_node = node
self.compile_parameter_check(v, arguments)
- npropdef.compile_to_c(v, self, arguments)
+ node.compile_to_c(v, self, arguments)
v.current_node = oldnode
- else if self.mproperty.is_root_init then
- var nclassdef = modelbuilder.mclassdef2nclassdef[self.mclassdef]
+ else if node isa AClassdef then
var oldnode = v.current_node
- v.current_node = nclassdef
+ v.current_node = node
self.compile_parameter_check(v, arguments)
- nclassdef.compile_to_c(v, self, arguments)
+ node.compile_to_c(v, self, arguments)
v.current_node = oldnode
else if val != null then
v.ret(v.value_instance(val))
module doc_templates
import template
+import json::static
# A documentation page
class TplPage
# Render the html header
private fun render_head do
+ var css = (self.shareurl / "css").html_escape
+ var vendors = (self.shareurl / "vendors").html_escape
+
add "<!DOCTYPE html>"
add "<head>"
add " <meta charset='utf-8'/>"
- add " <!--link rel='stylesheet' href='{shareurl}/css/Nitdoc.UI.css' type='text/css'/-->"
- add " <link rel='stylesheet' href='{shareurl}/vendors/bootstrap/css/bootstrap.min.css'/>"
- add " <link rel='stylesheet' href='{shareurl}/css/nitdoc.bootstrap.css'/>"
- add " <link rel='stylesheet' href='{shareurl}/css/nitdoc.css'/>"
- add " <link rel='stylesheet' href='{shareurl}/css/Nitdoc.QuickSearch.css'/>"
- add " <link rel='stylesheet' href='{shareurl}/css/Nitdoc.ModalBox.css'/>"
- add " <link rel='stylesheet' href='{shareurl}/css/Nitdoc.GitHub.css'/>"
+ add " <!--link rel='stylesheet' href='{css}/Nitdoc.UI.css' type='text/css'/-->"
+ add " <link rel='stylesheet' href='{vendors}/bootstrap/css/bootstrap.min.css'/>"
+ add " <link rel='stylesheet' href='{css}/nitdoc.bootstrap.css'/>"
+ add " <link rel='stylesheet' href='{css}/nitdoc.css'/>"
+ add " <link rel='stylesheet' href='{css}/Nitdoc.QuickSearch.css'/>"
+ add " <link rel='stylesheet' href='{css}/Nitdoc.ModalBox.css'/>"
+ add " <link rel='stylesheet' href='{css}/Nitdoc.GitHub.css'/>"
add " <title>{title}</title>"
add "</head>"
add "<body"
# Render JS scripts
private fun render_footer do
- add "<script src='{shareurl}/vendors/jquery/jquery-1.11.1.min.js'></script>"
- add "<script src='{shareurl}/vendors/jquery/jquery-ui-1.10.4.custom.min.js'></script>"
- add "<script src='{shareurl}/vendors/bootstrap/js/bootstrap.min.js'></script>"
- add "<script data-main='{shareurl}/js/nitdoc' src='{shareurl}/js/lib/require.js'></script>"
+ var vendors = (self.shareurl / "vendors").html_escape
+ var js = (self.shareurl / "js").html_escape
+
+ add "<script src='{vendors}/jquery/jquery-1.11.1.min.js'></script>"
+ add "<script src='{vendors}/jquery/jquery-ui-1.10.4.custom.min.js'></script>"
+ add "<script src='{vendors}/bootstrap/js/bootstrap.min.js'></script>"
+ add "<script data-main='{js}/nitdoc' src='{js}/lib/require.js'></script>"
for script in scripts do add script
add """<script>
$(function () {
private fun render_list(name: String, elts: Array[TplListElt]) do
if elts.is_empty then return
- add "<h5>{name}</h5>"
+ add "<h5>{name.html_escape}</h5>"
add "<ul class='list-unstyled list-definition'>"
for elt in elts do add elt
add "</ul>"
redef fun rendering do
var title = self.title
- if title != null then add "<h1>{title}</h1>"
+ if title != null then add "<h1>{title.to_s.html_escape}</h1>"
add "<div class='container-fluid'>"
add " <div class='row'>"
if not modules.is_empty then
# A HTML tag attribute
# `<tag attr="value">`
+#
+# ~~~nit
+# var attr: TagAttribute
+#
+# attr = new TagAttribute("foo", null)
+# assert attr.write_to_string == " foo=\"\""
+#
+# attr = new TagAttribute("foo", "bar<>")
+# assert attr.write_to_string == " foo=\"bar<>\""
+# ~~~
class TagAttribute
super Template
redef fun rendering do
var value = self.value
if value == null then
- add(" {name}")
+ # SEE: http://www.w3.org/TR/html5/infrastructure.html#boolean-attributes
+ add " {name.html_escape}=\"\""
else
- add(" {name}=\"{value}\"")
+ add " {name.html_escape}=\"{value.html_escape}\""
end
end
end
var site_id: String
redef fun render_content do
+ var site_id = self.site_id.to_json
+ var tracker_url = self.tracker_url.trim
+ if tracker_url.chars.last != '/' then tracker_url += "/"
+ tracker_url = "://{tracker_url}".to_json
+
add "<!-- Piwik -->"
add "var _paq = _paq || [];"
add " _paq.push([\"trackPageView\"]);"
add " _paq.push([\"enableLinkTracking\"]);"
add "(function() \{"
- add " var u=((\"https:\" == document.location.protocol) ? \"https\" : \"http\") + \"://{tracker_url}\";"
+ add " var u=((\"https:\" == document.location.protocol) ? \"https\" : \"http\") + {tracker_url};"
add " _paq.push([\"setTrackerUrl\", u+\"piwik.php\"]);"
- add " _paq.push([\"setSiteId\", \"{site_id}\"]);"
+ add " _paq.push([\"setSiteId\", {site_id}]);"
add " var d=document, g=d.createElement(\"script\"), s=d.getElementsByTagName(\"script\")[0]; g.type=\"text/javascript\";"
add " g.defer=true; g.async=true; g.src=u+\"piwik.js\"; s.parentNode.insertBefore(g,s);"
add "\})();"
end
var ftype = code_block.language.get_ftype(code_block, nclassdef)
- nclassdef.ftype_cache = ftype
- nclassdef.ftype_computed = true
+ nclassdef.mclassdef.ftype_cache = ftype
+ nclassdef.mclassdef.ftype_computed = true
end
end
-redef class AClassdef
+redef class MClassDef
private var ftype_cache: nullable ForeignType = null
private var ftype_computed = false
return ftype_cache
end
- var intro_nclassdef = v.toolcontext.modelbuilder.mclassdef2nclassdef[intro]
- var ftype = intro_nclassdef.ftype
+ var ftype = intro.ftype
if ftype == null then
var ftype_b: nullable ForeignType = null # FIXME hack to circumvent bug where ftype is typed null
assert args.length == mpropdef.msignature.arity + 1 else debug("Invalid arity for {mpropdef}. {args.length} arguments given.")
# Look for the AST node that implements the property
- var mproperty = mpropdef.mproperty
- if self.modelbuilder.mpropdef2npropdef.has_key(mpropdef) then
- var npropdef = self.modelbuilder.mpropdef2npropdef[mpropdef]
- self.parameter_check(npropdef, mpropdef, args)
- if npropdef isa AMethPropdef then
- return npropdef.rt_call(self, mpropdef, args)
- else
- print "Error, invalid propdef to call at runtime !"
- return null
- end
- else if mproperty.is_root_init then
- var nclassdef = self.modelbuilder.mclassdef2nclassdef[mpropdef.mclassdef]
- self.parameter_check(nclassdef, mpropdef, args)
- return nclassdef.call(self, mpropdef, args)
+ var node = modelbuilder.mpropdef2node(mpropdef)
+ if node isa AMethPropdef then
+ self.parameter_check(node, mpropdef, args)
+ return node.rt_call(self, mpropdef, args)
+ else if node isa AClassdef then
+ self.parameter_check(node, mpropdef, args)
+ return node.call(self, mpropdef, args)
else
fatal("Fatal Error: method {mpropdef} not found in the AST")
abort
assert args.length == mpropdef.msignature.arity + 1 else debug("Invalid arity for {mpropdef}. {args.length} arguments given.")
# Look for the AST node that implements the property
- var mproperty = mpropdef.mproperty
var val = mpropdef.constant_value
- if self.modelbuilder.mpropdef2npropdef.has_key(mpropdef) then
- var npropdef = self.modelbuilder.mpropdef2npropdef[mpropdef]
- self.parameter_check(npropdef, mpropdef, args)
- return npropdef.call(self, mpropdef, args)
- else if mproperty.is_root_init then
- var nclassdef = self.modelbuilder.mclassdef2nclassdef[mpropdef.mclassdef]
- self.parameter_check(nclassdef, mpropdef, args)
- return nclassdef.call(self, mpropdef, args)
+
+ var node = modelbuilder.mpropdef2node(mpropdef)
+ if node isa APropdef then
+ self.parameter_check(node, mpropdef, args)
+ return node.call(self, mpropdef, args)
+ else if node isa AClassdef then
+ self.parameter_check(node, mpropdef, args)
+ return node.call(self, mpropdef, args)
+ else if node != null then
+ fatal("Fatal Error: method {mpropdef} associated to unexpected AST node {node.location}")
+ abort
else if val != null then
return value_instance(val)
else
var cds = mtype.collect_mclassdefs(self.mainmodule).to_a
self.mainmodule.linearize_mclassdefs(cds)
for cd in cds do
- if not self.modelbuilder.mclassdef2nclassdef.has_key(cd) then continue
- var n = self.modelbuilder.mclassdef2nclassdef[cd]
- for npropdef in n.n_propdefs do
- if npropdef isa AAttrPropdef then
- res.add(npropdef)
- end
- end
+ res.add_all(modelbuilder.collect_attr_propdef(cd))
end
cache[mtype] = res
do
var sub = self
if sub == sup then return true
+
+ #print "1.is {sub} a {sup}? ===="
+
if anchor == null then
assert not sub.need_anchor
assert not sup.need_anchor
else
+ # First, resolve the formal types to the simplest equivalent forms in the receiver
assert sub.can_resolve_for(anchor, null, mmodule)
+ sub = sub.lookup_fixed(mmodule, anchor)
assert sup.can_resolve_for(anchor, null, mmodule)
- end
-
- # First, resolve the formal types to a common version in the receiver
- # The trick here is that fixed formal type will be associated to the bound
- # And unfixed formal types will be associated to a canonical formal type.
- if sub isa MParameterType or sub isa MVirtualType then
- assert anchor != null
- sub = sub.resolve_for(anchor.mclass.mclass_type, anchor, mmodule, false)
- end
- if sup isa MParameterType or sup isa MVirtualType then
- assert anchor != null
- sup = sup.resolve_for(anchor.mclass.mclass_type, anchor, mmodule, false)
+ sup = sup.lookup_fixed(mmodule, anchor)
end
# Does `sup` accept null or not?
end
# Now the case of direct null and nullable is over.
- # A unfixed formal type can only accept itself
- if sup isa MParameterType or sup isa MVirtualType then
- return sub == sup
- end
-
# If `sub` is a formal type, then it is accepted if its bound is accepted
- if sub isa MParameterType or sub isa MVirtualType then
+ while sub isa MParameterType or sub isa MVirtualType do
+ #print "3.is {sub} a {sup}?"
+
+ # A unfixed formal type can only accept itself
+ if sub == sup then return true
+
assert anchor != null
- sub = sub.anchor_to(mmodule, anchor)
+ sub = sub.lookup_bound(mmodule, anchor)
+
+ #print "3.is {sub} a {sup}?"
# Manage the second layer of null/nullable
if sub isa MNullableType then
return sup_accept_null
end
end
+ #print "4.is {sub} a {sup}? <- no more resolution"
assert sub isa MClassType # It is the only remaining type
+ # A unfixed formal type can only accept itself
+ if sup isa MParameterType or sup isa MVirtualType then
+ return false
+ end
+
if sup isa MNullType then
# `sup` accepts only null
return false
# ENSURE: `not self.need_anchor implies result == self`
fun resolve_for(mtype: MType, anchor: nullable MClassType, mmodule: MModule, cleanup_virtual: Bool): MType is abstract
+ # Resolve formal type to its verbatim bound.
+ # If the type is not formal, just return self
+ #
+ # The result is returned exactly as declared in the "type" property (verbatim).
+ # So it could be another formal type.
+ #
+ # In case of conflict, the method aborts.
+ fun lookup_bound(mmodule: MModule, resolved_receiver: MType): MType do return self
+
+ # Resolve the formal type to its simplest equivalent form.
+ #
+ # Formal types are either free or fixed.
+ # When it is fixed, it means that it is equivalent with a simpler type.
+ # When a formal type is free, it means that it is only equivalent with itself.
+ # This method return the most simple equivalent type of `self`.
+ #
+ # This method is mainly used for subtype test in order to sanely compare fixed.
+ #
+ # By default, return self.
+ # See the redefinitions for specific behavior in each kind of type.
+ fun lookup_fixed(mmodule: MModule, resolved_receiver: MType): MType do return self
+
# Can the type be resolved?
#
# In order to resolve open types, the formal types must make sence.
# The property associated with the type.
# Its the definitions of this property that determine the bound or the virtual type.
- var mproperty: MProperty
+ var mproperty: MVirtualTypeProp
redef fun model do return self.mproperty.intro_mclassdef.mmodule.model
- # Lookup the bound for a given resolved_receiver
- # The result may be a other virtual type (or a parameter type)
- #
- # The result is returned exactly as declared in the "type" property (verbatim).
- #
- # In case of conflict, the method aborts.
- fun lookup_bound(mmodule: MModule, resolved_receiver: MType): MType
+ redef fun lookup_bound(mmodule: MModule, resolved_receiver: MType): MType
+ do
+ return lookup_single_definition(mmodule, resolved_receiver).bound.as(not null)
+ end
+
+ private fun lookup_single_definition(mmodule: MModule, resolved_receiver: MType): MVirtualTypeDef
do
assert not resolved_receiver.need_anchor
var props = self.mproperty.lookup_definitions(mmodule, resolved_receiver)
if props.is_empty then
abort
else if props.length == 1 then
- return props.first.as(MVirtualTypeDef).bound.as(not null)
+ return props.first
end
var types = new ArraySet[MType]
+ var res = props.first
for p in props do
- types.add(p.as(MVirtualTypeDef).bound.as(not null))
+ types.add(p.bound.as(not null))
+ if not res.is_fixed then res = p
end
if types.length == 1 then
- return types.first
+ return res
end
abort
end
- # Is the virtual type fixed for a given resolved_receiver?
- fun is_fixed(mmodule: MModule, resolved_receiver: MType): Bool
+ # A VT is fixed when:
+ # * the VT is (re-)defined with the annotation `is fixed`
+ # * the VT is (indirectly) bound to an enum class (see `enum_kind`) since there is no subtype possible
+ # * the receiver is an enum class since there is no subtype possible
+ redef fun lookup_fixed(mmodule: MModule, resolved_receiver: MType): MType
do
assert not resolved_receiver.need_anchor
- var props = self.mproperty.lookup_definitions(mmodule, resolved_receiver)
- if props.is_empty then
- abort
- end
- for p in props do
- if p.as(MVirtualTypeDef).is_fixed then return true
- end
- return false
+ resolved_receiver = resolved_receiver.as_notnullable
+ assert resolved_receiver isa MClassType # It is the only remaining type
+
+ var prop = lookup_single_definition(mmodule, resolved_receiver)
+ var res = prop.bound.as(not null)
+
+ # Recursively lookup the fixed result
+ res = res.lookup_fixed(mmodule, resolved_receiver)
+
+ # 1. For a fixed VT, return the resolved bound
+ if prop.is_fixed then return res
+
+ # 2. For a enum boud, return the bound
+ if res isa MClassType and res.mclass.kind == enum_kind then return res
+
+ # 3. for a enum receiver return the bound
+ if resolved_receiver.mclass.kind == enum_kind then return res
+
+ return self
end
redef fun resolve_for(mtype, anchor, mmodule, cleanup_virtual)
do
+ if not cleanup_virtual then return self
assert can_resolve_for(mtype, anchor, mmodule)
# self is a virtual type declared (or inherited) in mtype
# The point of the function it to get the bound of the virtual type that make sense for mtype
# But because mtype is maybe a virtual/formal type, we need to get a real receiver first
#print "{class_name}: {self}/{mtype}/{anchor}?"
- var resolved_reciever
+ var resolved_receiver
if mtype.need_anchor then
assert anchor != null
- resolved_reciever = mtype.resolve_for(anchor, null, mmodule, true)
+ resolved_receiver = mtype.resolve_for(anchor, null, mmodule, true)
else
- resolved_reciever = mtype
+ resolved_receiver = mtype
end
# Now, we can get the bound
- var verbatim_bound = lookup_bound(mmodule, resolved_reciever)
+ var verbatim_bound = lookup_bound(mmodule, resolved_receiver)
# The bound is exactly as declared in the "type" property, so we must resolve it again
var res = verbatim_bound.resolve_for(mtype, anchor, mmodule, cleanup_virtual)
- #print "{class_name}: {self}/{mtype}/{anchor} -> {self}/{resolved_receiver}/{anchor} -> {verbatim_bound}/{mtype}/{anchor} -> {res}"
-
- # What to return here? There is a bunch a special cases:
- # If 'cleanup_virtual' we must return the resolved type, since we cannot return self
- if cleanup_virtual then return res
- # If the receiver is a intern class, then the virtual type cannot be redefined since there is no possible subclass. self is just fixed. so simply return the resolution
- if resolved_reciever isa MNullableType then resolved_reciever = resolved_reciever.mtype
- if resolved_reciever.as(MClassType).mclass.kind == enum_kind then return res
- # If the resolved type isa MVirtualType, it means that self was bound to it, and cannot be unbound. self is just fixed. so return the resolution.
- if res isa MVirtualType then return res
- # If we are final, just return the resolution
- if is_fixed(mmodule, resolved_reciever) then return res
- # If the resolved type isa intern class, then there is no possible valid redefinition in any potential subclass. self is just fixed. so simply return the resolution
- if res isa MClassType and res.mclass.kind == enum_kind then return res
- # TODO: What if bound to a MParameterType?
- # Note that Nullable types can always be redefined by the non nullable version, so there is no specific case on it.
- # If anything apply, then `self' cannot be resolved, so return self
- return self
+ return res
end
redef fun can_resolve_for(mtype, anchor, mmodule)
redef fun to_s do return name
- # Resolve the bound for a given resolved_receiver
- # The result may be a other virtual type (or a parameter type)
- fun lookup_bound(mmodule: MModule, resolved_receiver: MType): MType
+ redef fun lookup_bound(mmodule: MModule, resolved_receiver: MType): MType
do
assert not resolved_receiver.need_anchor
+ resolved_receiver = resolved_receiver.as_notnullable
+ assert resolved_receiver isa MClassType # It is the only remaining type
var goalclass = self.mclass
+ if resolved_receiver.mclass == goalclass then
+ return resolved_receiver.arguments[self.rank]
+ end
var supertypes = resolved_receiver.collect_mtypes(mmodule)
for t in supertypes do
if t.mclass == goalclass then
abort
end
+ # A PT is fixed when:
+ # * Its bound is a enum class (see `enum_kind`).
+ # The PT is just useless, but it is still a case.
+ # * More usually, the `resolved_receiver` is a subclass of `self.mclass`,
+ # so it is necessarily fixed in a `super` clause, either with a normal type
+ # or with another PT.
+ # See `resolve_for` for examples about related issues.
+ redef fun lookup_fixed(mmodule: MModule, resolved_receiver: MType): MType
+ do
+ assert not resolved_receiver.need_anchor
+ resolved_receiver = resolved_receiver.as_notnullable
+ assert resolved_receiver isa MClassType # It is the only remaining type
+ var res = self.resolve_for(resolved_receiver.mclass.mclass_type, resolved_receiver, mmodule, false)
+ return res
+ end
+
redef fun resolve_for(mtype, anchor, mmodule, cleanup_virtual)
do
assert can_resolve_for(mtype, anchor, mmodule)
resolved_receiver = anchor.arguments[resolved_receiver.rank]
if resolved_receiver isa MNullableType then resolved_receiver = resolved_receiver.mtype
end
- assert resolved_receiver isa MClassType
+ assert resolved_receiver isa MClassType # It is the only remaining type
# Eh! The parameter is in the current class.
# So we return the corresponding argument, no mater what!
return self.mtype.can_resolve_for(mtype, anchor, mmodule)
end
+ # Efficiently returns `mtype.lookup_fixed(mmodule, resolved_receiver).as_nullable`
+ redef fun lookup_fixed(mmodule, resolved_receiver)
+ do
+ var t = mtype.lookup_fixed(mmodule, resolved_receiver)
+ if t == mtype then return self
+ return t.as_nullable
+ end
+
redef fun depth do return self.mtype.depth
redef fun length do return self.mtype.length
end
end
- # Register the nclassdef associated to each mclassdef
- # FIXME: why not refine the `MClassDef` class with a nullable attribute?
- var mclassdef2nclassdef = new HashMap[MClassDef, AClassdef]
+ # Registration of the nclassdef associated to each mclassdef
+ private var mclassdef2nclassdef = new HashMap[MClassDef, AClassdef]
# Return the static type associated to the node `ntype`.
# `mmodule` and `mclassdef` is the context where the call is made (used to understand formal types)
# Analysis and verification of property definitions to instantiate model element
module modelize_property
-import modelize_class
+intrude import modelize_class
private import annotation
redef class ToolContext
end
redef class ModelBuilder
- # Register the npropdef associated to each mpropdef
- # FIXME: why not refine the `MPropDef` class with a nullable attribute?
- var mpropdef2npropdef = new HashMap[MPropDef, APropdef]
+ # Registration of the npropdef associated to each mpropdef.
+ #
+ # Public clients need to use `mpropdef2node` to access stuff.
+ private var mpropdef2npropdef = new HashMap[MPropDef, APropdef]
+
+ # Retrieve the associated AST node of a mpropertydef.
+ # This method is used to associate model entity with syntactic entities.
+ #
+ # If the property definition is not associated with a node, returns node.
+ fun mpropdef2node(mpropdef: MPropDef): nullable ANode
+ do
+ var res: nullable ANode = mpropdef2npropdef.get_or_null(mpropdef)
+ if res != null then return res
+ if mpropdef isa MMethodDef and mpropdef.mproperty.is_root_init then
+ res = mclassdef2nclassdef.get_or_null(mpropdef.mclassdef)
+ if res != null then return res
+ end
+ return null
+ end
+
+ # Retrieve all the attributes nodes localy definied
+ # FIXME think more about this method and how the separations separate/global and ast/model should be done.
+ fun collect_attr_propdef(mclassdef: MClassDef): Array[AAttrPropdef]
+ do
+ var res = new Array[AAttrPropdef]
+ var n = mclassdef2nclassdef.get_or_null(mclassdef)
+ if n == null then return res
+ for npropdef in n.n_propdefs do
+ if npropdef isa AAttrPropdef then
+ res.add(npropdef)
+ end
+ end
+ return res
+ end
# Build the properties of `nclassdef`.
# REQUIRE: all superclasses are built.
var mpropdef = new MVirtualTypeDef(mclassdef, mprop, self.location)
self.mpropdef = mpropdef
modelbuilder.mpropdef2npropdef[mpropdef] = self
+ if mpropdef.is_intro then
+ modelbuilder.toolcontext.info("{mpropdef} introduces new type {mprop.full_name}", 4)
+ else
+ modelbuilder.toolcontext.info("{mpropdef} redefines type {mprop.full_name}", 4)
+ end
set_doc(mpropdef, modelbuilder)
var atfixed = get_single_annotation("fixed", modelbuilder)
var vararg_rank = mmethoddef.msignature.vararg_rank
if vararg_rank > -1 then
- var node = self.modelbuilder.mpropdef2npropdef[mmethoddef]
+ var node = self.modelbuilder.mpropdef2node(mmethoddef)
var elttype = mmethoddef.msignature.mparameters[vararg_rank].mtype
#elttype = elttype.anchor_to(self.mainmodule, v.receiver)
var vararg = self.mainmodule.get_primitive_class("Array").get_mtype([elttype])
add_cast(paramtype)
end
- if not modelbuilder.mpropdef2npropdef.has_key(mmethoddef) then
- # It is an init for a class?
- if mmeth.is_root_init then
- var nclassdef = self.modelbuilder.mclassdef2nclassdef[mmethoddef.mclassdef]
- assert mmethoddef == nclassdef.mfree_init
+ var npropdef = modelbuilder.mpropdef2node(mmethoddef)
- if mmethoddef.mproperty.is_root_init and not mmethoddef.is_intro then
- self.add_super_send(v.receiver, mmethoddef)
- end
- else if mmethoddef.constant_value != null then
- # Make the return type live
- v.add_type(mmethoddef.msignature.return_mtype.as(MClassType))
- else
- abort
+ if npropdef isa AClassdef then
+ # It is an init for a class
+ assert mmethoddef == npropdef.mfree_init
+
+ if mmethoddef.mproperty.is_root_init and not mmethoddef.is_intro then
+ self.add_super_send(v.receiver, mmethoddef)
end
continue
+ else if mmethoddef.constant_value != null then
+ # Make the return type live
+ v.add_type(mmethoddef.msignature.return_mtype.as(MClassType))
+ continue
+ else if npropdef == null then
+ abort
end
- var npropdef = modelbuilder.mpropdef2npropdef[mmethoddef]
-
- if npropdef isa AMethPropdef then
+ if npropdef isa AMethPropdef then
var auto_super_inits = npropdef.auto_super_inits
if auto_super_inits != null then
for auto_super_init in auto_super_inits do
var bound_mtype = mtype.anchor_to(mainmodule, recv)
for cd in bound_mtype.collect_mclassdefs(mainmodule)
do
- if not self.modelbuilder.mclassdef2nclassdef.has_key(cd) then continue
- var nclassdef = self.modelbuilder.mclassdef2nclassdef[cd]
- for npropdef in nclassdef.n_propdefs do
- if not npropdef isa AAttrPropdef then continue
+ for npropdef in modelbuilder.collect_attr_propdef(cd) do
if not npropdef.has_value then continue
var mpropdef = npropdef.mpropdef.as(not null)
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import end
+
+interface Object end
+
+enum Bool end
+
+class A[E: Object]
+ var o: Object
+
+ var e: E
+
+ type VE: E
+ var ve: VE
+
+ type VVE: VE
+ var vve: VVE
+
+ type VGE: G[E]
+ var vge: VGE
+
+ type VVGE: VGE
+ var vvge: VVGE
+
+ type VGVE: G[VE]
+ var vgve: VGVE
+
+ type VGVVE: G[VVE]
+ var vgvve: VGVVE
+
+ fun foo
+ do
+ # In order to check type relations, this test looks for the warnings about useless cast
+ # The following should produce a warning
+ assert o isa Object
+
+ assert e isa E
+ assert e isa Object
+
+ assert ve isa VE
+ assert ve isa E
+ assert ve isa Object
+
+ assert vve isa VVE
+ assert vve isa VE
+ assert vve isa E
+ assert vve isa Object
+
+ assert vge isa VGE
+ assert vge isa G[E]
+ assert vge isa G[Object]
+ assert vge isa Object
+
+ assert vvge isa VVGE
+ assert vvge isa VGE
+ assert vvge isa G[E]
+ assert vvge isa G[Object]
+ assert vvge isa Object
+
+ assert vgve isa VGVE
+ assert vgve isa G[VE]
+ assert vgve isa G[E]
+ assert vgve isa G[Object]
+ assert vgve isa Object
+
+ assert vgvve isa VGVVE
+ assert vgvve isa G[VVE]
+ assert vgvve isa G[VE]
+ assert vgvve isa G[E]
+ assert vgvve isa G[Object]
+ assert vgvve isa Object
+
+ # The following should not
+ assert o isa VGVVE
+ assert o isa G[VVE]
+ assert o isa VVGE
+ assert o isa VGVE
+ assert o isa G[VE]
+ assert o isa VGE
+ assert o isa G[E]
+ assert o isa G[Object]
+ assert o isa VVE
+ assert o isa VE
+ assert o isa E
+
+ assert e isa VGVVE
+ assert e isa G[VVE]
+ assert e isa VVGE
+ assert e isa VGVE
+ assert e isa G[VE]
+ assert e isa VGE
+ assert e isa G[E]
+ assert e isa G[Object]
+ assert e isa VVE
+ assert e isa VE
+
+ assert ve isa VGVVE
+ assert ve isa G[VVE]
+ assert ve isa VVGE
+ assert ve isa VGVE
+ assert ve isa G[VE]
+ assert ve isa VGE
+ assert ve isa G[E]
+ assert ve isa G[Object]
+ assert ve isa VVE
+
+ assert vve isa VGVVE
+ assert vve isa G[VVE]
+ assert vve isa VVGE
+ assert vve isa VGVE
+ assert vve isa G[VE]
+ assert vve isa VGE
+ assert vve isa G[E]
+ assert vve isa G[Object]
+
+ assert vge isa VGVVE
+ assert vge isa G[VVE]
+ assert vge isa VVGE
+ assert vge isa VGVE
+ assert vge isa G[VE]
+ assert vge isa VVE
+ assert vge isa VE
+ assert vge isa E
+
+ assert vvge isa VGVVE
+ assert vvge isa G[VVE]
+ assert vvge isa VGVE
+ assert vvge isa G[VE]
+ assert vvge isa VVE
+ assert vvge isa VE
+ assert vvge isa E
+
+ assert vgve isa VGVVE
+ assert vgve isa G[VVE]
+ assert vgve isa VGE
+ assert vgve isa VVGE
+ assert vgve isa VVE
+ assert vgve isa VE
+ assert vgve isa E
+
+ assert vgvve isa VGE
+ assert vgvve isa VVGE
+ assert vgvve isa VGVE
+ assert vgvve isa VVE
+ assert vgvve isa VE
+ assert vgvve isa E
+ end
+end
+
+class G[E]
+end
nitg
nitdoc
+nitlight
neo_doxygen_dump
neo_doxygen_file_compound
neo_doxygen_graph_empty_project
--- /dev/null
+base_formal_subtype.nit:48,10--21: Warning: Expression is already a Object.
+base_formal_subtype.nit:50,10--16: Warning: Expression is already a E.
+base_formal_subtype.nit:51,10--21: Warning: Expression is already a Object since it is a E.
+base_formal_subtype.nit:53,10--18: Warning: Expression is already a VE.
+base_formal_subtype.nit:54,10--17: Warning: Expression is already a E since it is a VE.
+base_formal_subtype.nit:55,10--22: Warning: Expression is already a Object since it is a VE.
+base_formal_subtype.nit:57,10--20: Warning: Expression is already a VVE.
+base_formal_subtype.nit:58,10--19: Warning: Expression is already a VE since it is a VVE.
+base_formal_subtype.nit:59,10--18: Warning: Expression is already a E since it is a VVE.
+base_formal_subtype.nit:60,10--23: Warning: Expression is already a Object since it is a VVE.
+base_formal_subtype.nit:62,10--20: Warning: Expression is already a VGE.
+base_formal_subtype.nit:63,10--20: Warning: Expression is already a G[E] since it is a VGE.
+base_formal_subtype.nit:64,10--25: Warning: Expression is already a G[Object] since it is a VGE.
+base_formal_subtype.nit:65,10--23: Warning: Expression is already a Object since it is a VGE.
+base_formal_subtype.nit:67,10--22: Warning: Expression is already a VVGE.
+base_formal_subtype.nit:68,10--21: Warning: Expression is already a VGE since it is a VVGE.
+base_formal_subtype.nit:69,10--21: Warning: Expression is already a G[E] since it is a VVGE.
+base_formal_subtype.nit:70,10--26: Warning: Expression is already a G[Object] since it is a VVGE.
+base_formal_subtype.nit:71,10--24: Warning: Expression is already a Object since it is a VVGE.
+base_formal_subtype.nit:73,10--22: Warning: Expression is already a VGVE.
+base_formal_subtype.nit:74,10--22: Warning: Expression is already a G[VE] since it is a VGVE.
+base_formal_subtype.nit:75,10--21: Warning: Expression is already a G[E] since it is a VGVE.
+base_formal_subtype.nit:76,10--26: Warning: Expression is already a G[Object] since it is a VGVE.
+base_formal_subtype.nit:77,10--24: Warning: Expression is already a Object since it is a VGVE.
+base_formal_subtype.nit:79,10--24: Warning: Expression is already a VGVVE.
+base_formal_subtype.nit:80,10--24: Warning: Expression is already a G[VVE] since it is a VGVVE.
+base_formal_subtype.nit:81,10--23: Warning: Expression is already a G[VE] since it is a VGVVE.
+base_formal_subtype.nit:82,10--22: Warning: Expression is already a G[E] since it is a VGVVE.
+base_formal_subtype.nit:83,10--27: Warning: Expression is already a G[Object] since it is a VGVVE.
+base_formal_subtype.nit:84,10--25: Warning: Expression is already a Object since it is a VGVVE.
-<!DOCTYPE html><html><head><meta charset="utf-8"/><title>Nit</title><link rel="icon" href="http://nitlanguage.org/favicon.ico" type="image/x-icon"/><link rel="stylesheet" href="http://nitlanguage.org/style.css" type="text/css"/><link rel="stylesheet" href="http://nitlanguage.org/local.css" type="text/css"/></head><body><article class="page"><section class="pageheader"><a id='toptitle_first' class='toptitle'>the</a><a id='toptitle_second' class='toptitle' href=''>Nit</a><a id='toptitle_third' class='toptitle' href=''>Programming Language</a><header class="header"><div class="topsubtitle"><p>A Fun Language for Serious Programming</p></div></header></section><div id="pagebody"><section id="content"><h1># What is Nit?</h1><p>Nit is an object-oriented programming language. The goal of Nit is to propose a robust statically typed programming language where structure is not a pain.</p><p>So, what does the famous hello world program look like, in Nit?</p><pre><tt><span class='normal'>print </span><span class='string'>'Hello, World!'</span></tt></pre><h1># Feature Highlights</h1><h2>Usability</h2><p>Nit's goal is to be usable by real programmers for real projects</p><ul><li><a href="http://en.wikipedia.org/wiki/KISS_principle">KISS principle</a></li><li>Script-like language without verbosity nor cryptic statements</li><li>Painless static types: static typing should help programmers</li><li>Efficient development, efficient execution, efficient evolution.</li></ul><h2>Robustness</h2><p>Nit will help you to write bug-free programs</p><ul><li>Strong static typing</li><li>No more NullPointerException</li></ul><h2>Object-Oriented</h2><p>Nit's guideline is to follow the most powerful OO principles</p><ul><li><a href="./everything_is_an_object/">Everything is an object</a></li><li><a href="./multiple_inheritance/">Multiple inheritance</a></li><li><a href="./refinement/">Open classes</a></li><li><a href="./virtual_types/">Virtual types</a></li></ul><h1># Getting Started</h1><p>Get Nit from its Git repository:</p><pre><code>$ git clone http://nitlanguage.org/nit.git</code></pre><p>Build the compiler (may be long):</p><pre><code>$ cd nit
+<!DOCTYPE html><html><head><meta charset="utf-8"/><title>Nit</title><link rel="icon" href="http://nitlanguage.org/favicon.ico" type="image/x-icon"/><link rel="stylesheet" href="http://nitlanguage.org/style.css" type="text/css"/><link rel="stylesheet" href="http://nitlanguage.org/local.css" type="text/css"/></head><body><article class="page"><section class="pageheader"><a id='toptitle_first' class='toptitle'>the</a><a id='toptitle_second' class='toptitle' href=''>Nit</a><a id='toptitle_third' class='toptitle' href=''>Programming Language</a><header class="header"><div class="topsubtitle"><p>A Fun Language for Serious Programming</p></div></header></section><div id="pagebody"><section id="content"><h1># What is Nit?</h1><p>Nit is an object-oriented programming language. The goal of Nit is to propose a robust statically typed programming language where structure is not a pain.</p><p>So, what does the famous hello world program look like, in Nit?</p><pre><tt><span class='normal'>print </span><span class='string'>'Hello, World!'</span></tt></pre><h1># Feature Highlights</h1><h2>Usability</h2><p>Nit's goal is to be usable by real programmers for real projects</p><ul><li><a href="http://en.wikipedia.org/wiki/KISS_principle">KISS principle</a></li><li>Script-like language without verbosity nor cryptic statements</li><li>Painless static types: static typing should help programmers</li><li>Efficient development, efficient execution, efficient evolution.</li></ul><h2>Robustness</h2><p>Nit will help you to write bug-free programs</p><ul><li>Strong static typing</li><li>No more NullPointerException</li></ul><h2>Object-Oriented</h2><p>Nit's guideline is to follow the most powerful OO principles</p><ul><li><a href="./everything_is_an_object/">Everything is an object</a></li><li><a href="./multiple_inheritance/">Multiple inheritance</a></li><li><a href="./refinement/">Open classes</a></li><li><a href="./virtual_types/">Virtual types</a></li></ul><h1># Getting Started</h1><p>Get Nit from its Git repository:</p><pre><code>$ git clone http://nitlanguage.org/nit.git</code></pre><p>Build the compiler (may be long):</p><pre><code>$ cd nit
$ make</code></pre><p>Compile a program:</p><pre><code>$ bin/nitc examples/hello_world.nit</code></pre><p>Execute the program:</p><pre><code>$ ./hello_world</code></pre></section></div></article></body></html>
\ No newline at end of file
-<span class="nitcode"><span class="line" id="L1"><span class="nc_c"># This file is part of NIT ( http://www.nitlanguage.org ).
+<span class="nitcode"><span class="line" id="L1"><span class="nc_c"># This file is part of NIT ( http://www.nitlanguage.org ).
</span></span><span class="line" id="L2"><span class="nc_c">#
</span></span><span class="line" id="L3"><span class="nc_c"># Copyright 2006-2008 Jean Privat <jean@pryen.org>
</span></span><span class="line" id="L4"><span class="nc_c">#
-</span></span><span class="line" id="L5"><span class="nc_c"># Licensed under the Apache License, Version 2.0 (the "License");
+</span></span><span class="line" id="L5"><span class="nc_c"># Licensed under the Apache License, Version 2.0 (the "License");
</span></span><span class="line" id="L6"><span class="nc_c"># you may not use this file except in compliance with the License.
</span></span><span class="line" id="L7"><span class="nc_c"># You may obtain a copy of the License at
</span></span><span class="line" id="L8"><span class="nc_c">#
-</span></span><span class="line" id="L9"><span class="nc_c"># http://www.apache.org/licenses/LICENSE-2.0
+</span></span><span class="line" id="L9"><span class="nc_c"># http://www.apache.org/licenses/LICENSE-2.0
</span></span><span class="line" id="L10"><span class="nc_c">#
</span></span><span class="line" id="L11"><span class="nc_c"># Unless required by applicable law or agreed to in writing, software
-</span></span><span class="line" id="L12"><span class="nc_c"># distributed under the License is distributed on an "AS IS" BASIS,
+</span></span><span class="line" id="L12"><span class="nc_c"># distributed under the License is distributed on an "AS IS" BASIS,
</span></span><span class="line" id="L13"><span class="nc_c"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
</span></span><span class="line" id="L14"><span class="nc_c"># See the License for the specific language governing permissions and
</span></span><span class="line" id="L15"><span class="nc_c"># limitations under the License.
</span></span><span class="line" id="L16">
</span><span class="line" id="L17"><span class="nc_k">import</span> <span class="nc_k">end</span>
</span><span class="line" id="L18">
-</span><span class="nc_cdef foldable" id="base_simple3#Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_def nc_t popupable" title="class Object" data-title="<a href="base_simple3.html#base_simple3#Object">class Object</a>" data-content="<div><b>class</b> <span>Object</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> sub-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Bool">Bool</a></li><li><a href="base_simple3.html#base_simple3#Int">Int</a></li><li><a href="base_simple3.html#base_simple3#A">A</a></li><li><a href="base_simple3.html#base_simple3#B">B</a></li><li><a href="base_simple3.html#base_simple3#C">C</a></li><li><a href="base_simple3.html#base_simple3#Sys">Sys</a></li></ul></div></div>" data-toggle="popover">Object</span>
+</span><span class="nc_cdef foldable" id="base_simple3#Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_def nc_t popupable" title="class Object" data-title="<a href="base_simple3.html#base_simple3#Object">class Object</a>" data-content="<div><b>class</b> <span>Object</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> sub-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Bool">Bool</a></li><li><a href="base_simple3.html#base_simple3#Int">Int</a></li><li><a href="base_simple3.html#base_simple3#A">A</a></li><li><a href="base_simple3.html#base_simple3#B">B</a></li><li><a href="base_simple3.html#base_simple3#C">C</a></li><li><a href="base_simple3.html#base_simple3#Sys">Sys</a></li></ul></div></div>" data-toggle="popover">Object</span>
</span><span class="line" id="L20"><span class="nc_k">end</span>
</span></span><span class="line" id="L21">
-</span><span class="nc_cdef foldable" id="base_simple3#Bool"><span class="line" id="L22"><span class="nc_k">enum</span> <span class="nc_def nc_t popupable" title="class Bool" data-title="<a href="base_simple3.html#base_simple3#Bool">class Bool</a>" data-content="<div><b>class</b> <span>Bool</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">Bool</span>
+</span><span class="nc_cdef foldable" id="base_simple3#Bool"><span class="line" id="L22"><span class="nc_k">enum</span> <span class="nc_def nc_t popupable" title="class Bool" data-title="<a href="base_simple3.html#base_simple3#Bool">class Bool</a>" data-content="<div><b>class</b> <span>Bool</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">Bool</span>
</span><span class="line" id="L23"><span class="nc_k">end</span>
</span></span><span class="line" id="L24">
-</span><span class="nc_cdef foldable" id="base_simple3#Int"><span class="line" id="L25"><span class="nc_k">enum</span> <span class="nc_def nc_t popupable" title="class Int" data-title="<a href="base_simple3.html#base_simple3#Int">class Int</a>" data-content="<div><b>class</b> <span>Int</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">Int</span>
-</span><span class="nc_pdef foldable" id="base_simple3#Int#output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">base_simple3#Int#output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span>
+</span><span class="nc_cdef foldable" id="base_simple3#Int"><span class="line" id="L25"><span class="nc_k">enum</span> <span class="nc_def nc_t popupable" title="class Int" data-title="<a href="base_simple3.html#base_simple3#Int">class Int</a>" data-content="<div><b>class</b> <span>Int</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">Int</span>
+</span><span class="nc_pdef foldable" id="base_simple3#Int#output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">base_simple3#Int#output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span>
</span></span><span class="line" id="L27"><span class="nc_k">end</span>
</span></span><span class="line" id="L28">
-</span><span class="nc_cdef foldable" id="base_simple3#A"><span class="line" id="L29"><span class="nc_k">class</span> <span class="nc_def nc_t popupable" title="class A" data-title="<a href="base_simple3.html#base_simple3#A">class A</a>" data-content="<div><b>class</b> <span>A</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">A</span>
-</span><span class="nc_pdef foldable" id="base_simple3#A#init"><span class="line" id="L30"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">5</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3#A#run"><span class="line" id="L31"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#A#run" data-title="<a href="base_simple3.html#base_simple3#A#run">base_simple3#A#run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">6</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="nc_cdef foldable" id="base_simple3#A"><span class="line" id="L29"><span class="nc_k">class</span> <span class="nc_def nc_t popupable" title="class A" data-title="<a href="base_simple3.html#base_simple3#A">class A</a>" data-content="<div><b>class</b> <span>A</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">A</span>
+</span><span class="nc_pdef foldable" id="base_simple3#A#init"><span class="line" id="L30"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">5</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3#A#run"><span class="line" id="L31"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#A#run" data-title="<a href="base_simple3.html#base_simple3#A#run">base_simple3#A#run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">6</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span><span class="line" id="L32"><span class="nc_k">end</span>
</span></span><span class="line" id="L33">
-</span><span class="nc_cdef foldable" id="base_simple3#B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_def nc_t popupable" title="class B" data-title="<a href="base_simple3.html#base_simple3#B">class B</a>" data-content="<div><b>class</b> <span>B</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">B</span>
-</span><span class="nc_pdef foldable" id="base_simple3#B#_val"><a id="base_simple3#B#val"></a><a id="base_simple3#B#val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_def nc_i popupable" title="base_simple3#B#val" data-title="<a href="base_simple3.html#base_simple3#B#val">base_simple3#B#val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3#B#init"><span class="line" id="L36"> <span class="nc_k">init</span><span>(</span><span class="nc_v nc_i popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
+</span><span class="nc_cdef foldable" id="base_simple3#B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_def nc_t popupable" title="class B" data-title="<a href="base_simple3.html#base_simple3#B">class B</a>" data-content="<div><b>class</b> <span>B</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">B</span>
+</span><span class="nc_pdef foldable" id="base_simple3#B#_val"><a id="base_simple3#B#val"></a><a id="base_simple3#B#val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_def nc_i popupable" title="base_simple3#B#val" data-title="<a href="base_simple3.html#base_simple3#B#val">base_simple3#B#val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3#B#init"><span class="line" id="L36"> <span class="nc_k">init</span><span>(</span><span class="nc_v nc_i popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">7</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L39"> <span class="nc_k">self</span><span>.</span><span class="nc_i popupable" title="call base_simple3#B#val=" data-title="<a href="base_simple3.html#base_simple3#B#val=">call base_simple3#B#val=</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#B#val=">val=</a><span>(val: <a href="base_simple3.html#base_simple3#Int">Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span>=</span> <span class="nc_v nc_i popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">v</span>
+</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">7</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L39"> <span class="nc_k">self</span><span>.</span><span class="nc_i popupable" title="call base_simple3#B#val=" data-title="<a href="base_simple3.html#base_simple3#B#val=">call base_simple3#B#val=</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#B#val=">val=</a><span>(val: <a href="base_simple3.html#base_simple3#Int">Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span>=</span> <span class="nc_v nc_i popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">v</span>
</span><span class="line" id="L40"> <span class="nc_k">end</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3#B#run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#B#run" data-title="<a href="base_simple3.html#base_simple3#B#run">base_simple3#B#run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3#B#val" data-title="<a href="base_simple3.html#base_simple3#B#val">call base_simple3#B#val</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#B#val">val</a><span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3#B#run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#B#run" data-title="<a href="base_simple3.html#base_simple3#B#run">base_simple3#B#run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3#B#val" data-title="<a href="base_simple3.html#base_simple3#B#val">call base_simple3#B#val</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#B#val">val</a><span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span><span class="line" id="L42"><span class="nc_k">end</span>
</span></span><span class="line" id="L43">
-</span><span class="nc_cdef foldable" id="base_simple3#C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_def nc_t popupable" title="class C" data-title="<a href="base_simple3.html#base_simple3#C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">C</span>
-</span><span class="nc_pdef foldable" id="base_simple3#C#_val1"><a id="base_simple3#C#val1"></a><a id="base_simple3#C#val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_def nc_i popupable" title="base_simple3#C#val1" data-title="<a href="base_simple3.html#base_simple3#C#val1">base_simple3#C#val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3#C#_val2"><a id="base_simple3#C#val2"></a><a id="base_simple3#C#val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_def nc_i popupable" title="base_simple3#C#val2" data-title="<a href="base_simple3.html#base_simple3#C#val2">base_simple3#C#val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">10</span>
+</span><span class="nc_cdef foldable" id="base_simple3#C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_def nc_t popupable" title="class C" data-title="<a href="base_simple3.html#base_simple3#C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="base_simple3.html#base_simple3#Object">Object</a></li></ul></div></div>" data-toggle="popover">C</span>
+</span><span class="nc_pdef foldable" id="base_simple3#C#_val1"><a id="base_simple3#C#val1"></a><a id="base_simple3#C#val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_def nc_i popupable" title="base_simple3#C#val1" data-title="<a href="base_simple3.html#base_simple3#C#val1">base_simple3#C#val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3#C#_val2"><a id="base_simple3#C#val2"></a><a id="base_simple3#C#val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_def nc_i popupable" title="base_simple3#C#val2" data-title="<a href="base_simple3.html#base_simple3#C#val2">base_simple3#C#val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">10</span>
</span></span><span class="line" id="L47"><span class="nc_k">end</span>
</span></span><span class="line" id="L48">
-</span><span class="nc_pdef foldable" id="base_simple3#Object#foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Object#foo" data-title="<a href="base_simple3.html#base_simple3#Object#foo">base_simple3#Object#foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">2</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3#Object#bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Object#bar" data-title="<a href="base_simple3.html#base_simple3#Object#bar">base_simple3#Object#bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="base_simple3.html#base_simple3#Int">Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_v nc_i popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_v nc_i popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">i</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3#Object#baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Object#baz" data-title="<a href="base_simple3.html#base_simple3#Object#baz">base_simple3#Object#baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">4</span>
+</span><span class="nc_pdef foldable" id="base_simple3#Object#foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Object#foo" data-title="<a href="base_simple3.html#base_simple3#Object#foo">base_simple3#Object#foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">2</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3#Object#bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Object#bar" data-title="<a href="base_simple3.html#base_simple3#Object#bar">base_simple3#Object#bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="base_simple3.html#base_simple3#Int">Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_v nc_i popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_v nc_i popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">i</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3#Object#baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Object#baz" data-title="<a href="base_simple3.html#base_simple3#Object#baz">base_simple3#Object#baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">4</span>
</span></span><span class="line" id="L52">
-</span><span class="nc_pdef foldable" id="base_simple3#Sys#main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">1</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3#Object#foo" data-title="<a href="base_simple3.html#base_simple3#Object#foo">call base_simple3#Object#foo</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Object#foo">foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
-</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3#Object#bar" data-title="<a href="base_simple3.html#base_simple3#Object#bar">call base_simple3#Object#bar</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Object#bar">bar</a><span>(i: <a href="base_simple3.html#base_simple3#Int">Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3#Object#baz" data-title="<a href="base_simple3.html#base_simple3#Object#baz">call base_simple3#Object#baz</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Object#baz">baz</a><span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="nc_pdef foldable" id="base_simple3#Sys#main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">1</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3#Object#foo" data-title="<a href="base_simple3.html#base_simple3#Object#foo">call base_simple3#Object#foo</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Object#foo">foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
+</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3#Object#bar" data-title="<a href="base_simple3.html#base_simple3#Object#bar">call base_simple3#Object#bar</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Object#bar">bar</a><span>(i: <a href="base_simple3.html#base_simple3#Int">Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
+</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3#Object#baz" data-title="<a href="base_simple3.html#base_simple3#Object#baz">call base_simple3#Object#baz</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Object#baz">baz</a><span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_v nc_i popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="base_simple3.html#base_simple3#A">A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t popupable" title="A" data-title="<a href="base_simple3.html#base_simple3#A">A</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#A">A</a></span><br/></div>" data-toggle="popover">A</span>
-</span><span class="line" id="L59"><span class="nc_v nc_i popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="base_simple3.html#base_simple3#A">A</a></span><br/></div>" data-toggle="popover">a</span><span>.</span><span class="nc_i popupable" title="call base_simple3#A#run" data-title="<a href="base_simple3.html#base_simple3#A#run">call base_simple3#A#run</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#A#run">run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_v nc_i popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="base_simple3.html#base_simple3#A">A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t popupable" title="A" data-title="<a href="base_simple3.html#base_simple3#A">A</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#A">A</a></span><br/></div>" data-toggle="popover">A</span>
+</span><span class="line" id="L59"><span class="nc_v nc_i popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="base_simple3.html#base_simple3#A">A</a></span><br/></div>" data-toggle="popover">a</span><span>.</span><span class="nc_i popupable" title="call base_simple3#A#run" data-title="<a href="base_simple3.html#base_simple3#A#run">call base_simple3#A#run</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#A#run">run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_v nc_i popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="base_simple3.html#base_simple3#B">B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t popupable" title="B" data-title="<a href="base_simple3.html#base_simple3#B">B</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#B">B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_v nc_i popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="base_simple3.html#base_simple3#B">B</a></span><br/></div>" data-toggle="popover">b</span><span>.</span><span class="nc_i popupable" title="call base_simple3#B#run" data-title="<a href="base_simple3.html#base_simple3#B#run">call base_simple3#B#run</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#B#run">run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_v nc_i popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="base_simple3.html#base_simple3#B">B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t popupable" title="B" data-title="<a href="base_simple3.html#base_simple3#B">B</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#B">B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
+</span><span class="line" id="L62"><span class="nc_v nc_i popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="base_simple3.html#base_simple3#B">B</a></span><br/></div>" data-toggle="popover">b</span><span>.</span><span class="nc_i popupable" title="call base_simple3#B#run" data-title="<a href="base_simple3.html#base_simple3#B#run">call base_simple3#B#run</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#B#run">run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_v nc_i popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="base_simple3.html#base_simple3#C">C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t popupable" title="C" data-title="<a href="base_simple3.html#base_simple3#C">C</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#C">C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_v nc_i popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="base_simple3.html#base_simple3#C">C</a></span><br/></div>" data-toggle="popover">c</span><span>.</span><span class="nc_i popupable" title="call base_simple3#C#val1" data-title="<a href="base_simple3.html#base_simple3#C#val1">call base_simple3#C#val1</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#C#val1">val1</a><span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L66"><span class="nc_v nc_i popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="base_simple3.html#base_simple3#C">C</a></span><br/></div>" data-toggle="popover">c</span><span>.</span><span class="nc_i popupable" title="call base_simple3#C#val2" data-title="<a href="base_simple3.html#base_simple3#C#val2">call base_simple3#C#val2</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#C#val2">val2</a><span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_v nc_i popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="base_simple3.html#base_simple3#C">C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t popupable" title="C" data-title="<a href="base_simple3.html#base_simple3#C">C</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#C">C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="base_simple3.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
+</span><span class="line" id="L65"><span class="nc_v nc_i popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="base_simple3.html#base_simple3#C">C</a></span><br/></div>" data-toggle="popover">c</span><span>.</span><span class="nc_i popupable" title="call base_simple3#C#val1" data-title="<a href="base_simple3.html#base_simple3#C#val1">call base_simple3#C#val1</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#C#val1">val1</a><span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L66"><span class="nc_v nc_i popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="base_simple3.html#base_simple3#C">C</a></span><br/></div>" data-toggle="popover">c</span><span>.</span><span class="nc_i popupable" title="call base_simple3#C#val2" data-title="<a href="base_simple3.html#base_simple3#C#val2">call base_simple3#C#val2</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#C#val2">val2</a><span>: <a href="base_simple3.html#base_simple3#Int">Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span><span class="line" id="L67"><span></span></span></span>
\ No newline at end of file
Class suites: 1; Test Cases: 3; Failures: 1
<testsuites><testsuite package="test_nitunit"><testcase classname="nitunit.test_nitunit.<module>" name="<module>"><system-err></system-err><system-out>assert true
</system-out></testcase><testcase classname="nitunit.test_nitunit.test_nitunit::X" name="<class>"><system-err></system-err><system-out>assert false
-</system-out><error message="Runtime error: Assert failed (.nitunit/test_nitunit-2.nit:5)
+</system-out><error message="Runtime error: Assert failed (.nitunit/test_nitunit-2.nit:5)
"></error></testcase><testcase classname="nitunit.test_nitunit.test_nitunit::X" name="test_nitunit::X::foo"><system-err></system-err><system-out>assert undefined_identifier
-</system-out><failure message=".nitunit/test_nitunit-3.nit:5,8--27: Error: Method or variable 'undefined_identifier' unknown in Sys.
+</system-out><failure message=".nitunit/test_nitunit-3.nit:5,8--27: Error: Method or variable 'undefined_identifier' unknown in Sys.
"></failure></testcase></testsuite><testsuite package="test_test_nitunit"><testcase classname="nitunit.test_test_nitunit.test_test_nitunit::TestX" name="test_test_nitunit::TestX::test_foo"><system-err></system-err><system-out>out</system-out></testcase><testcase classname="nitunit.test_test_nitunit.test_test_nitunit::TestX" name="test_test_nitunit::TestX::test_foo1"><system-err></system-err><system-out>out</system-out><error message="Runtime error: Assert failed (test_test_nitunit.nit:39)
"></error></testcase><testcase classname="nitunit.test_test_nitunit.test_test_nitunit::TestX" name="test_test_nitunit::TestX::test_foo2"><system-err></system-err><system-out>out</system-out></testcase></testsuite></testsuites>
\ No newline at end of file
</span><span class="line" id="L2"><span class="nc_i">block</span>
</span><span class="line" id="L3"><span></span></span></span></pre><p>a first example</p><pre class="nitcode"><span class="nitcode"><span class="line" id="L1"><span class="nc_k">assert</span> <span class="nc_l">1</span> <span class="nc_o">+</span> <span class="nc_l">1</span> <span class="nc_o">==</span> <span class="nc_l">2</span>
</span><span class="line" id="L2"><span></span></span></span></pre><p>and a last example to illustrate the <code class="nitcode"><span class="nitcode"><span class="line" id="L1"><span class="nc_i">to_s</span><span></span></span></span></code> method on <code class="nitcode"><span class="nitcode"><span class="line" id="L1"><span class="nc_t">A</span><span></span></span></span></code>.</p><pre class="nitcode"><span class="nitcode"><span class="line" id="L1"><span class="nc_k">var</span> <span class="nc_i">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">A</span>
-</span><span class="line" id="L2"><span class="nc_k">assert</span> <span class="nc_i">a</span><span>.</span><span class="nc_i">to_s</span> <span class="nc_o">==</span> <span class="nc_s">"A"</span>
+</span><span class="line" id="L2"><span class="nc_k">assert</span> <span class="nc_i">a</span><span>.</span><span class="nc_i">to_s</span> <span class="nc_o">==</span> <span class="nc_s">"A"</span>
</span><span class="line" id="L3"><span></span></span></span></pre></div><script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script>$(".popupable").popover({html:true, placement:'top'})/*initialize bootstrap popover*/</script></body></html>
\ No newline at end of file