rta: add `live_methods_to_tree` to provide human-readable infos on methods
[nit.git] / src / naive_interpreter.nit
index 016cdc8..688d675 100644 (file)
@@ -623,10 +623,10 @@ redef class AConcreteMethPropdef
                        var args = [arguments.first]
                        for auto_super_init in auto_super_inits do
                                args.clear
-                               for i in [0..auto_super_init.intro.msignature.arity+1[ do
+                               for i in [0..auto_super_init.msignature.arity+1[ do
                                        args.add(arguments[i])
                                end
-                               v.send(auto_super_init, args)
+                               v.callsite(auto_super_init, args)
                        end
                end
 
@@ -716,6 +716,10 @@ redef class AInternMethPropdef
                                return v.char_instance(recv.succ)
                        else if pname == "prec" then
                                return v.char_instance(recv.prec)
+                       else if pname == "+" then
+                               return v.char_instance(recv + args[1].to_i)
+                       else if pname == "-" then
+                               return v.char_instance(recv - args[1].to_i)
                        else if pname == "<" then
                                return v.bool_instance(recv < args[1].val.as(Char))
                        else if pname == ">" then
@@ -929,6 +933,14 @@ redef class AExternMethPropdef
                                return v.float_instance(args[0].to_f.pow(args[1].to_f))
                        else if pname == "rand" then
                                return v.float_instance(args[0].to_f.rand)
+                       else if pname == "abs" then
+                               return v.float_instance(args[0].to_f.abs)
+                       else if pname == "hypot_with" then
+                               return v.float_instance(args[0].to_f.hypot_with(args[1].to_f))
+                       else if pname == "is_nan" then
+                               return v.bool_instance(args[0].to_f.is_nan)
+                       else if pname == "is_inf_extern" then
+                               return v.bool_instance(args[0].to_f.is_inf != 0)
                        end
                else if pname == "native_argc" then
                        return v.int_instance(v.arguments.length)