|
@@ -5,30 +5,6 @@ $pkg.innerEval = function (expr) { return eval(expr); };
|
|
|
$pkg.transport = {"type":"amd","amdNamespace":"amber/core"};
|
|
|
|
|
|
$core.addClass("ASTMethodRunningTest", $globals.TestCase, ["receiver"], "Compiler-Tests");
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "actOn:in:",
|
|
|
-protocol: "running",
|
|
|
-
|
|
|
-args: ["aMethod", "aClass"],
|
|
|
-source: "actOn: aMethod in: aClass\x0a\x09self subclassResponsibility",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["subclassResponsibility"]
|
|
|
-}, function ($methodClass){ return function (aMethod,aClass){
|
|
|
-var self=this,$self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-$self._subclassResponsibility();
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"actOn:in:",{aMethod:aMethod,aClass:aClass})});
|
|
|
-
|
|
|
-}; }),
|
|
|
-$globals.ASTMethodRunningTest);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "receiver",
|
|
@@ -200,33 +176,17 @@ selector: "while:inClass:should:",
|
|
|
protocol: "testing",
|
|
|
|
|
|
args: ["aString", "aClass", "aBlock"],
|
|
|
-source: "while: aString inClass: aClass should: aBlock\x0a\x09self\x0a\x09\x09whileExamining: aString\x0a\x09\x09inClass: aClass\x0a\x09\x09should: [ :method | aBlock value: [ self actOn: method in: aClass ] ]",
|
|
|
+source: "while: aString inClass: aClass should: aBlock\x0a\x09self subclassResponsibility",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
pragmas: [],
|
|
|
-messageSends: ["whileExamining:inClass:should:", "value:", "actOn:in:"]
|
|
|
+messageSends: ["subclassResponsibility"]
|
|
|
}, function ($methodClass){ return function (aString,aClass,aBlock){
|
|
|
var self=this,$self=this;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-$self._whileExamining_inClass_should_(aString,aClass,(function(method){
|
|
|
-
|
|
|
-return $core.withContext(function($ctx2) {
|
|
|
-
|
|
|
-return $recv(aBlock)._value_((function(){
|
|
|
-
|
|
|
-return $core.withContext(function($ctx3) {
|
|
|
-
|
|
|
-return $self._actOn_in_(method,aClass);
|
|
|
-
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
|
|
|
-
|
|
|
-}));
|
|
|
-
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({method:method},$ctx1,1)});
|
|
|
-
|
|
|
-}));
|
|
|
+$self._subclassResponsibility();
|
|
|
return self;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"while:inClass:should:",{aString:aString,aClass:aClass,aBlock:aBlock})});
|
|
@@ -237,29 +197,6 @@ $globals.ASTMethodRunningTest);
|
|
|
|
|
|
|
|
|
$core.addClass("CodeGeneratorTest", $globals.ASTMethodRunningTest, [], "Compiler-Tests");
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "actOn:in:",
|
|
|
-protocol: "running",
|
|
|
-
|
|
|
-args: ["aMethod", "aClass"],
|
|
|
-source: "actOn: aMethod in: aClass\x0a\x09^ receiver perform: aMethod selector",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-pragmas: [],
|
|
|
-messageSends: ["perform:", "selector"]
|
|
|
-}, function ($methodClass){ return function (aMethod,aClass){
|
|
|
-var self=this,$self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return $recv($self.receiver)._perform_($recv(aMethod)._selector());
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"actOn:in:",{aMethod:aMethod,aClass:aClass})});
|
|
|
-
|
|
|
-}; }),
|
|
|
-$globals.CodeGeneratorTest);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "codeGeneratorClass",
|
|
@@ -1633,32 +1570,49 @@ return self;
|
|
|
}; }),
|
|
|
$globals.CodeGeneratorTest);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-$core.addClass("ASTInterpreterTest", $globals.CodeGeneratorTest, [], "Compiler-Tests");
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "actOn:in:",
|
|
|
-protocol: "running",
|
|
|
+selector: "while:inClass:should:",
|
|
|
+protocol: "testing",
|
|
|
|
|
|
-args: ["aMethod", "aClass"],
|
|
|
-source: "actOn: aMethod in: aClass\x0a\x09^ self\x0a\x09\x09interpret: aMethod source\x0a\x09\x09forClass: aClass\x0a\x09\x09receiver: receiver\x0a\x09\x09withArguments: #{}",
|
|
|
+args: ["aString", "aClass", "aBlock"],
|
|
|
+source: "while: aString inClass: aClass should: aBlock\x0a\x09self\x0a\x09\x09whileInstalled: aString\x0a\x09\x09inClass: aClass\x0a\x09\x09should: [ :method | aBlock value: [\x0a\x09\x09\x09receiver perform: method selector ] ]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
pragmas: [],
|
|
|
-messageSends: ["interpret:forClass:receiver:withArguments:", "source"]
|
|
|
-}, function ($methodClass){ return function (aMethod,aClass){
|
|
|
+messageSends: ["whileInstalled:inClass:should:", "value:", "perform:", "selector"]
|
|
|
+}, function ($methodClass){ return function (aString,aClass,aBlock){
|
|
|
var self=this,$self=this;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-return $self._interpret_forClass_receiver_withArguments_($recv(aMethod)._source(),aClass,$self.receiver,$globals.HashedCollection._newFromPairs_([]));
|
|
|
+$self._whileInstalled_inClass_should_(aString,aClass,(function(method){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
+return $recv(aBlock)._value_((function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx3) {
|
|
|
+
|
|
|
+return $recv($self.receiver)._perform_($recv(method)._selector());
|
|
|
+
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
|
|
|
+
|
|
|
+}));
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({method:method},$ctx1,1)});
|
|
|
+
|
|
|
+}));
|
|
|
+return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"actOn:in:",{aMethod:aMethod,aClass:aClass})});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"while:inClass:should:",{aString:aString,aClass:aClass,aBlock:aBlock})});
|
|
|
|
|
|
}; }),
|
|
|
-$globals.ASTInterpreterTest);
|
|
|
+$globals.CodeGeneratorTest);
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+$core.addClass("ASTInterpreterTest", $globals.CodeGeneratorTest, [], "Compiler-Tests");
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "interpret:forClass:receiver:withArguments:",
|
|
@@ -1750,6 +1704,46 @@ return ctx;
|
|
|
}; }),
|
|
|
$globals.ASTInterpreterTest);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "while:inClass:should:",
|
|
|
+protocol: "testing",
|
|
|
+
|
|
|
+args: ["aString", "aClass", "aBlock"],
|
|
|
+source: "while: aString inClass: aClass should: aBlock\x0a\x09self\x0a\x09\x09whileInstalled: aString\x0a\x09\x09inClass: aClass\x0a\x09\x09should: [ aBlock value: [\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09interpret: aString\x0a\x09\x09\x09\x09forClass: aClass\x0a\x09\x09\x09\x09receiver: receiver\x0a\x09\x09\x09\x09withArguments: #{} ] ]",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+pragmas: [],
|
|
|
+messageSends: ["whileInstalled:inClass:should:", "value:", "interpret:forClass:receiver:withArguments:"]
|
|
|
+}, function ($methodClass){ return function (aString,aClass,aBlock){
|
|
|
+var self=this,$self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+$self._whileInstalled_inClass_should_(aString,aClass,(function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
+return $recv(aBlock)._value_((function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx3) {
|
|
|
+
|
|
|
+return $self._interpret_forClass_receiver_withArguments_(aString,aClass,$self.receiver,$globals.HashedCollection._newFromPairs_([]));
|
|
|
+
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
|
|
|
+
|
|
|
+}));
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
+
|
|
|
+}));
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"while:inClass:should:",{aString:aString,aClass:aClass,aBlock:aBlock})});
|
|
|
+
|
|
|
+}; }),
|
|
|
+$globals.ASTInterpreterTest);
|
|
|
+
|
|
|
|
|
|
|
|
|
$core.addClass("ASTDebuggerTest", $globals.ASTInterpreterTest, [], "Compiler-Tests");
|
|
@@ -3517,7 +3511,7 @@ return $recv($recv($globals.Compiler)._new())._ast_forClass_protocol_(aString,aC
|
|
|
$globals.TASTParsingTest);
|
|
|
|
|
|
$core.setTraitComposition([{trait: $globals.TASTParsingTest}], $globals.TASTCompilingTest);
|
|
|
-$core.setTraitComposition([{trait: $globals.TASTCompilingTest, aliases: {"whileExamining:inClass:should:":"while:inClass:should:"}}], $globals.ASTMethodRunningTest);
|
|
|
+$core.setTraitComposition([{trait: $globals.TASTCompilingTest, aliases: {"whileInstalled:inClass:should:":"while:inClass:should:"}, exclusions: ["while:inClass:should:"]}], $globals.ASTMethodRunningTest);
|
|
|
$core.setTraitComposition([{trait: $globals.TASTParsingTest}], $globals.ASTPCNodeVisitorTest);
|
|
|
$core.setTraitComposition([{trait: $globals.TASTParsingTest}], $globals.ASTPositionTest);
|
|
|
$core.setTraitComposition([{trait: $globals.TASTCompilingTest}], $globals.CodeGeneratorInstallTest);
|