mpropdef
associated with the current node.
# Execute a `mpropdef` associated with the current node.
private fun call(v: NaiveInterpreter, mpropdef: MMethodDef, args: Array[Instance]): nullable Instance
do
fatal(v, "NOT YET IMPLEMENTED method kind {class_name}. {mpropdef}")
abort
end
src/interpreter/naive_interpreter.nit:890,2--895,4
redef fun call(v, mpropdef, args)
do
var recv = args.first
assert recv isa MutableInstance
var attr = self.mpropdef.mproperty
if mpropdef == mreadpropdef then
assert args.length == 1
if not is_lazy or v.isset_attribute(attr, recv) then return v.read_attribute(attr, recv)
var f = v.new_frame(self, mpropdef, args)
return evaluate_expr(v, recv, f)
else if mpropdef == mwritepropdef then
assert args.length == 2
var arg = args[1]
if is_optional and arg.is_null then
var f = v.new_frame(self, mpropdef, args)
arg = evaluate_expr(v, recv, f)
end
v.write_attribute(attr, recv, arg)
return null
else
abort
end
end
src/interpreter/naive_interpreter.nit:1556,2--1578,4