Merge: interpreter use the catch from the compiler
[nit.git] / src / interpreter / debugger.nit
index 4400939..25ca6c2 100644 (file)
@@ -18,7 +18,6 @@
 module debugger
 
 intrude import naive_interpreter
-import nitx
 intrude import semantize::local_var_init
 intrude import semantize::scope
 intrude import toolcontext
@@ -225,7 +224,7 @@ class Debugger
        # Auto continues the execution until the end or until an error is encountered
        var autocontinue = false
 
-       redef type FRAME: Frame
+       redef type FRAME: InterpreterFrame
 
        #######################################################################
        ##                  Execution of statement function                  ##
@@ -470,10 +469,6 @@ class Debugger
                else if command == "help" then
                        help
                        return true
-               # Opens a new NitIndex prompt on current model
-               else if command == "nitx" then
-                       new NitIndex.with_infos(modelbuilder, self.mainmodule).prompt
-                       return true
                else if command == "bt" or command == "backtrack" then
                        print stack_trace
                        return true
@@ -1411,7 +1406,7 @@ redef class AMethPropdef
        # Not supposed to be used by anyone else than the Debugger.
        private fun rt_call(v: Debugger, mpropdef: MMethodDef, args: Array[Instance]): nullable Instance
        do
-               var f = new Frame(self, self.mpropdef.as(not null), args)
+               var f = new InterpreterFrame(self, self.mpropdef.as(not null), args)
                var curr_instances = v.frame.map
                for i in curr_instances.keys do
                        f.map[i] = curr_instances[i]
@@ -1423,10 +1418,8 @@ redef class AMethPropdef
                                curr_instances[i] = currFra.map[i]
                        end
                end
-               if v.returnmark == f then
-                       v.returnmark = null
+               if v.is_escape(self.return_mark) then
                        var res = v.escapevalue
-                       v.escapevalue = null
                        return res
                end
                return null