Kaynağa Gözat

Renames AIInterpreterError to ASTInterpreterError

Nicolas Petton 10 yıl önce
ebeveyn
işleme
1667c7d52c
2 değiştirilmiş dosya ile 15 ekleme ve 15 silme
  1. 8 8
      js/Compiler-Interpreter.js
  2. 7 7
      st/Compiler-Interpreter.st

+ 8 - 8
js/Compiler-Interpreter.js

@@ -75,14 +75,14 @@ selector: "interpreterError",
 category: 'error handling',
 fn: function (){
 var self=this;
-function $AIInterpreterError(){return smalltalk.AIInterpreterError||(typeof AIInterpreterError=="undefined"?nil:AIInterpreterError)}
+function $ASTInterpreterError(){return smalltalk.ASTInterpreterError||(typeof ASTInterpreterError=="undefined"?nil:ASTInterpreterError)}
 return smalltalk.withContext(function($ctx1) { 
-_st($AIInterpreterError())._signal_("Method cannot be interpreted by the interpreter.");
+_st($ASTInterpreterError())._signal_("Method cannot be interpreted by the interpreter.");
 return self}, function($ctx1) {$ctx1.fill(self,"interpreterError",{},smalltalk.AIBlockClosure)})},
 args: [],
-source: "interpreterError\x0a\x09AIInterpreterError signal: 'Method cannot be interpreted by the interpreter.'",
+source: "interpreterError\x0a\x09ASTInterpreterError signal: 'Method cannot be interpreted by the interpreter.'",
 messageSends: ["signal:"],
-referencedClasses: ["AIInterpreterError"]
+referencedClasses: ["ASTInterpreterError"]
 }),
 smalltalk.AIBlockClosure);
 
@@ -899,10 +899,6 @@ referencedClasses: []
 smalltalk.AIContext.klass);
 
 
-smalltalk.addClass('AIInterpreterError', smalltalk.Error, [], 'Compiler-Interpreter');
-smalltalk.AIInterpreterError.comment="I get signaled when an AST interpreter is unable to interpret a node.";
-
-
 smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
 smalltalk.ASTDebugger.comment="I am a stepping debugger interface for Amber code.\x0aI internally use an instance of `ASTSteppingInterpreter` to actually step through node and interpret them.\x0a\x0aMy instances are created from a `MethodContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0a## API\x0a\x0aUse the methods of the `'stepping'` protocol to do stepping.";
 smalltalk.addMethod(
@@ -2041,6 +2037,10 @@ smalltalk.ASTInterpreter);
 
 
 
+smalltalk.addClass('ASTInterpreterError', smalltalk.Error, [], 'Compiler-Interpreter');
+smalltalk.ASTInterpreterError.comment="I get signaled when an AST interpreter is unable to interpret a node.";
+
+
 smalltalk.addClass('ASTPCNodeVisitor', smalltalk.NodeVisitor, ['useInlinings', 'pc', 'context', 'blockIndex', 'currentNode'], 'Compiler-Interpreter');
 smalltalk.ASTPCNodeVisitor.comment="I visit an AST until I get to the current pc node and answer it.\x0a\x0a## API\x0a\x0aMy instances must be filled with a context object using `#context:`.\x0a\x0aAfter visiting the AST the current node corresponding to the `pc` is answered by `#currentNode`";
 smalltalk.addMethod(

+ 7 - 7
st/Compiler-Interpreter.st

@@ -30,7 +30,7 @@ currySelf
 !AIBlockClosure methodsFor: 'error handling'!
 
 interpreterError
-	AIInterpreterError signal: 'Method cannot be interpreted by the interpreter.'
+	ASTInterpreterError signal: 'Method cannot be interpreted by the interpreter.'
 ! !
 
 !AIBlockClosure methodsFor: 'evaluating'!
@@ -295,12 +295,6 @@ fromMethodContext: aMethodContext
 		yourself
 ! !
 
-Error subclass: #AIInterpreterError
-	instanceVariableNames: ''
-	package: 'Compiler-Interpreter'!
-!AIInterpreterError commentStamp!
-I get signaled when an AST interpreter is unable to interpret a node.!
-
 Object subclass: #ASTDebugger
 	instanceVariableNames: 'interpreter context'
 	package: 'Compiler-Interpreter'!
@@ -718,6 +712,12 @@ visitVariableNode: aNode
 		ifFalse: [ self context localAt: aNode value ])
 ! !
 
+Error subclass: #ASTInterpreterError
+	instanceVariableNames: ''
+	package: 'Compiler-Interpreter'!
+!ASTInterpreterError commentStamp!
+I get signaled when an AST interpreter is unable to interpret a node.!
+
 NodeVisitor subclass: #ASTPCNodeVisitor
 	instanceVariableNames: 'useInlinings pc context blockIndex currentNode'
 	package: 'Compiler-Interpreter'!