Ver código fonte

More improvements to the debugger

Nicolas Petton 11 anos atrás
pai
commit
3e7c429aae

+ 14 - 1
js/Compiler-Interpreter.deploy.js

@@ -223,6 +223,19 @@ return $1;
 }),
 smalltalk.ASTDebugger);
 
+smalltalk.addMethod(
+"_context",
+smalltalk.method({
+selector: "context",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=self["@context"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"context",{}, smalltalk.ASTDebugger)})}
+}),
+smalltalk.ASTDebugger);
+
 smalltalk.addMethod(
 "_context_",
 smalltalk.method({
@@ -264,7 +277,7 @@ smalltalk.method({
 selector: "initializeWithContext:",
 fn: function (aMethodContext){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._context_fromMethodContext_((smalltalk.IAContext || IAContext),aMethodContext);
+return smalltalk.withContext(function($ctx1) { 
_st(self)._context_(_st((smalltalk.AIContext || AIContext))._fromMethodContext_(aMethodContext));
 _st(self)._initializeInterpreter();
 return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aMethodContext:aMethodContext}, smalltalk.ASTDebugger)})}
 }),

+ 22 - 4
js/Compiler-Interpreter.js

@@ -300,6 +300,24 @@ referencedClasses: ["Smalltalk", "SemanticAnalyzer"]
 }),
 smalltalk.ASTDebugger);
 
+smalltalk.addMethod(
+"_context",
+smalltalk.method({
+selector: "context",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=self["@context"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"context",{}, smalltalk.ASTDebugger)})},
+args: [],
+source: "context\x0a\x09^ context",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ASTDebugger);
+
 smalltalk.addMethod(
 "_context_",
 smalltalk.method({
@@ -357,13 +375,13 @@ selector: "initializeWithContext:",
 category: 'initialization',
 fn: function (aMethodContext){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._context_fromMethodContext_((smalltalk.IAContext || IAContext),aMethodContext);
+return smalltalk.withContext(function($ctx1) { 
_st(self)._context_(_st((smalltalk.AIContext || AIContext))._fromMethodContext_(aMethodContext));
 _st(self)._initializeInterpreter();
 return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aMethodContext:aMethodContext}, smalltalk.ASTDebugger)})},
 args: ["aMethodContext"],
-source: "initializeWithContext: aMethodContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a    \x0a    self context: IAContext fromMethodContext: aMethodContext.\x0a    self initializeInterpreter",
-messageSends: ["context:fromMethodContext:", "initializeInterpreter"],
-referencedClasses: ["IAContext"]
+source: "initializeWithContext: aMethodContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a    \x0a    self context: (AIContext fromMethodContext: aMethodContext).\x0a    self initializeInterpreter",
+messageSends: ["context:", "fromMethodContext:", "initializeInterpreter"],
+referencedClasses: ["AIContext"]
 }),
 smalltalk.ASTDebugger);
 

+ 5 - 1
st/Compiler-Interpreter.st

@@ -93,6 +93,10 @@ Use the methods of the 'stepping' protocol to do stepping.!
 
 !ASTDebugger methodsFor: 'accessing'!
 
+context
+	^ context
+!
+
 context: aContext
 	context := AIContext new.
 !
@@ -138,7 +142,7 @@ initializeInterpreter
 initializeWithContext: aMethodContext
 	"TODO: do we need to handle block contexts?"
     
-    self context: IAContext fromMethodContext: aMethodContext.
+    self context: (AIContext fromMethodContext: aMethodContext).
     self initializeInterpreter
 ! !