import auto_super_init
import frontend
import common_ffi
+private import parser::tables
redef class ToolContext
# --discover-call-trace
if initprop != null then
interpreter.send(initprop, [mainobj])
end
- var mainprop = mainmodule.try_get_primitive_method("main", sys_type.mclass)
+ var mainprop = mainmodule.try_get_primitive_method("run", sys_type.mclass) or else
+ mainmodule.try_get_primitive_method("main", sys_type.mclass)
if mainprop != null then
interpreter.send(mainprop, [mainobj])
end
var attr = self.mpropdef.mproperty
if mpropdef == mreadpropdef then
assert args.length == 1
- return v.read_attribute(attr, recv)
+ if not is_lazy or v.isset_attribute(attr, recv) then return v.read_attribute(attr, recv)
+ return evaluate_expr(v, recv)
else if mpropdef == mwritepropdef then
assert args.length == 2
v.write_attribute(attr, recv, args[1])
# Evaluate and set the default value of the attribute in `recv`
private fun init_expr(v: NaiveInterpreter, recv: Instance)
do
+ if is_lazy then return
var nexpr = self.n_expr
if nexpr != null then
evaluate_expr(v, recv)