redef class ScopeVisitor
- redef init(toolcontext)
+ redef init
do
super
if toolcontext.dbg != null then
redef fun check_errors
do
if dbg == null then
- super
+ return super
else
if messages.length > 0 then
message_sorter.sort(messages)
messages.clear
end
+ return not had_error
end
# -d
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
private class TraceObject
# Map of the local names bound to a frame
- var trace_map: HashMap[Frame, String]
+ var trace_map = new HashMap[Frame, String]
+
# Decides if breaking or printing statement when the variable is encountered
var break_on_encounter: Bool
- init(break_on_encounter: Bool)
- do
- trace_map = new HashMap[Frame, String]
- self.break_on_encounter = break_on_encounter
- end
-
# Adds the local alias for a variable and the frame bound to it
fun add_frame_variable(frame: Frame, variable_name: String)
do