|
@@ -841,12 +841,18 @@ selector: "setTraitComposition:",
|
|
|
protocol: "compiling",
|
|
|
fn: function (aTraitComposition){
|
|
|
var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+$core.setTraitComposition(aTraitComposition._asJSON(), self);
|
|
|
return self;
|
|
|
-
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"setTraitComposition:",{aTraitComposition:aTraitComposition},$globals.BehaviorBody)});
|
|
|
+
|
|
|
},
|
|
|
|
|
|
args: ["aTraitComposition"],
|
|
|
-source: "setTraitComposition: aTraitComposition\x0a\x09\x22not implemented yet, noop atm\x22",
|
|
|
+source: "setTraitComposition: aTraitComposition\x0a\x09<inlineJS: '$core.setTraitComposition(aTraitComposition._asJSON(), self)'>",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: []
|
|
@@ -901,6 +907,103 @@ messageSends: ["subclassResponsibility"]
|
|
|
}),
|
|
|
$globals.BehaviorBody);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "traitComposition",
|
|
|
+protocol: "accessing",
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+return $recv(self._basicAt_("traitComposition"))._collect_((function(each){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
+return $recv($globals.TraitTransformation)._fromJSON_(each);
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
|
|
|
+
|
|
|
+}));
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"traitComposition",{},$globals.BehaviorBody)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "traitComposition\x0a\x09^ (self basicAt: 'traitComposition') collect: [ :each | TraitTransformation fromJSON: each ]",
|
|
|
+referencedClasses: ["TraitTransformation"],
|
|
|
+
|
|
|
+messageSends: ["collect:", "basicAt:", "fromJSON:"]
|
|
|
+}),
|
|
|
+$globals.BehaviorBody);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "usesDefinition",
|
|
|
+protocol: "accessing",
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+return $recv(self._traitComposition())._ifNotEmpty_((function(traitComposition){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
+return $recv($globals.String)._streamContents_((function(str){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx3) {
|
|
|
+
|
|
|
+$recv(str)._write_("uses: {");
|
|
|
+
|
|
|
+$ctx3.sendIdx["write:"]=1;
|
|
|
+
|
|
|
+$recv(traitComposition)._do_separatedBy_((function(each){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx4) {
|
|
|
+
|
|
|
+return $recv(str)._write_($recv(each)._definition());
|
|
|
+
|
|
|
+$ctx4.sendIdx["write:"]=2;
|
|
|
+
|
|
|
+
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,3)});
|
|
|
+
|
|
|
+}),(function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx4) {
|
|
|
+
|
|
|
+return $recv(str)._write_(". ");
|
|
|
+
|
|
|
+$ctx4.sendIdx["write:"]=3;
|
|
|
+
|
|
|
+
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
|
|
|
+
|
|
|
+}));
|
|
|
+return $recv(str)._write_("}");
|
|
|
+
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({str:str},$ctx2,2)});
|
|
|
+
|
|
|
+}));
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({traitComposition:traitComposition},$ctx1,1)});
|
|
|
+
|
|
|
+}));
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"usesDefinition",{},$globals.BehaviorBody)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "usesDefinition\x0a\x09^ self traitComposition ifNotEmpty: [ :traitComposition |\x0a\x09\x09String streamContents: [ :str |\x0a\x09\x09\x09str write: 'uses: {'.\x0a\x09\x09\x09traitComposition\x0a\x09\x09\x09\x09do: [ :each | str write: each definition ]\x0a\x09\x09\x09\x09separatedBy: [ str write: '. ' ].\x0a\x09\x09\x09str write: '}' ] ]",
|
|
|
+referencedClasses: ["String"],
|
|
|
+
|
|
|
+messageSends: ["ifNotEmpty:", "traitComposition", "streamContents:", "write:", "do:separatedBy:", "definition"]
|
|
|
+}),
|
|
|
+$globals.BehaviorBody);
|
|
|
+
|
|
|
|
|
|
|
|
|
$core.addClass("Behavior", $globals.BehaviorBody, [], "Kernel-Classes");
|
|
@@ -1671,6 +1774,7 @@ var self=this;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
+var $1,$2;
|
|
|
return $recv($globals.String)._streamContents_((function(stream){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
@@ -1688,13 +1792,33 @@ $recv(stream)._lf();
|
|
|
|
|
|
$ctx2.sendIdx["lf"]=1;
|
|
|
|
|
|
+$recv(stream)._write_($recv(self._usesDefinition())._ifNotEmpty_((function(uses){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx3) {
|
|
|
+
|
|
|
+$1=$recv($globals.String)._tab();
|
|
|
+
|
|
|
+$ctx3.sendIdx["tab"]=1;
|
|
|
+
|
|
|
+$2=$recv($globals.String)._lf();
|
|
|
+
|
|
|
+$ctx3.sendIdx["lf"]=2;
|
|
|
+
|
|
|
+return [$1,uses,$2];
|
|
|
+
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({uses:uses},$ctx2,2)});
|
|
|
+
|
|
|
+})));
|
|
|
+
|
|
|
+$ctx2.sendIdx["write:"]=2;
|
|
|
+
|
|
|
$recv(stream)._tab();
|
|
|
|
|
|
-$ctx2.sendIdx["tab"]=1;
|
|
|
+$ctx2.sendIdx["tab"]=2;
|
|
|
|
|
|
$recv(stream)._write_("instanceVariableNames: ");
|
|
|
|
|
|
-$ctx2.sendIdx["write:"]=2;
|
|
|
+$ctx2.sendIdx["write:"]=3;
|
|
|
|
|
|
$recv(stream)._print_(" "._join_(self._instanceVariableNames()));
|
|
|
|
|
@@ -1714,10 +1838,10 @@ return $recv(stream)._print_(self._category());
|
|
|
},
|
|
|
|
|
|
args: [],
|
|
|
-source: "definition\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09print: self superclass; write: ' subclass: '; printSymbol: self name; lf;\x0a\x09\x09tab; write: 'instanceVariableNames: '; print: (' ' join: self instanceVariableNames); lf;\x0a\x09\x09tab; write: 'package: '; print: self category ]",
|
|
|
+source: "definition\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09print: self superclass; write: ' subclass: '; printSymbol: self name; lf;\x0a\x09\x09write: (self usesDefinition ifNotEmpty: [ :uses | { String tab. uses. String lf }]);\x0a\x09\x09tab; write: 'instanceVariableNames: '; print: (' ' join: self instanceVariableNames); lf;\x0a\x09\x09tab; write: 'package: '; print: self category ]",
|
|
|
referencedClasses: ["String"],
|
|
|
|
|
|
-messageSends: ["streamContents:", "print:", "superclass", "write:", "printSymbol:", "name", "lf", "tab", "join:", "instanceVariableNames", "category"]
|
|
|
+messageSends: ["streamContents:", "print:", "superclass", "write:", "printSymbol:", "name", "lf", "ifNotEmpty:", "usesDefinition", "tab", "join:", "instanceVariableNames", "category"]
|
|
|
}),
|
|
|
$globals.Class);
|
|
|
|
|
@@ -3903,10 +4027,6 @@ return $recv($globals.String)._streamContents_((function(str){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-$recv(str)._write_("(");
|
|
|
-
|
|
|
-$ctx2.sendIdx["write:"]=1;
|
|
|
-
|
|
|
$recv(str)._print_(self._trait());
|
|
|
$recv(self._aliases())._ifNotEmpty_((function(al){
|
|
|
|
|
@@ -3914,7 +4034,7 @@ return $core.withContext(function($ctx3) {
|
|
|
|
|
|
$recv(str)._write_(" @ {");
|
|
|
|
|
|
-$ctx3.sendIdx["write:"]=2;
|
|
|
+$ctx3.sendIdx["write:"]=1;
|
|
|
|
|
|
$recv($recv(al)._associations())._do_separatedBy_((function(each){
|
|
|
|
|
@@ -3926,7 +4046,7 @@ $ctx4.sendIdx["printSymbol:"]=1;
|
|
|
|
|
|
$recv(str)._write_(" -> ");
|
|
|
|
|
|
-$ctx4.sendIdx["write:"]=3;
|
|
|
+$ctx4.sendIdx["write:"]=2;
|
|
|
|
|
|
return $recv(str)._printSymbol_($recv(each)._value());
|
|
|
|
|
@@ -3938,7 +4058,7 @@ return $core.withContext(function($ctx4) {
|
|
|
|
|
|
return $recv(str)._write_(". ");
|
|
|
|
|
|
-$ctx4.sendIdx["write:"]=4;
|
|
|
+$ctx4.sendIdx["write:"]=3;
|
|
|
|
|
|
|
|
|
}, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
|
|
@@ -3949,7 +4069,7 @@ $ctx3.sendIdx["do:separatedBy:"]=1;
|
|
|
|
|
|
return $recv(str)._write_("}");
|
|
|
|
|
|
-$ctx3.sendIdx["write:"]=5;
|
|
|
+$ctx3.sendIdx["write:"]=4;
|
|
|
|
|
|
|
|
|
}, function($ctx3) {$ctx3.fillBlock({al:al},$ctx2,2)});
|
|
@@ -3958,13 +4078,13 @@ $ctx3.sendIdx["write:"]=5;
|
|
|
|
|
|
$ctx2.sendIdx["ifNotEmpty:"]=1;
|
|
|
|
|
|
-$recv(self._exclusions())._ifNotEmpty_((function(ex){
|
|
|
+return $recv(self._exclusions())._ifNotEmpty_((function(ex){
|
|
|
|
|
|
return $core.withContext(function($ctx3) {
|
|
|
|
|
|
$recv(str)._write_(" - #(");
|
|
|
|
|
|
-$ctx3.sendIdx["write:"]=6;
|
|
|
+$ctx3.sendIdx["write:"]=5;
|
|
|
|
|
|
$recv($recv($recv(ex)._asArray())._sorted())._do_separatedBy_((function(each){
|
|
|
|
|
@@ -3972,7 +4092,7 @@ return $core.withContext(function($ctx4) {
|
|
|
|
|
|
return $recv(str)._write_($recv($recv(each)._symbolPrintString())._allButFirst());
|
|
|
|
|
|
-$ctx4.sendIdx["write:"]=7;
|
|
|
+$ctx4.sendIdx["write:"]=6;
|
|
|
|
|
|
|
|
|
}, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,6)});
|
|
@@ -3988,13 +4108,9 @@ return $recv(str)._space();
|
|
|
}));
|
|
|
return $recv(str)._write_(")");
|
|
|
|
|
|
-$ctx3.sendIdx["write:"]=8;
|
|
|
-
|
|
|
-
|
|
|
}, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,5)});
|
|
|
|
|
|
}));
|
|
|
-return $recv(str)._write_(")");
|
|
|
|
|
|
}, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
|
|
|
|
|
@@ -4005,10 +4121,10 @@ return $recv(str)._write_(")");
|
|
|
},
|
|
|
|
|
|
args: [],
|
|
|
-source: "definition\x0a\x09^ String streamContents: [ :str |\x0a\x09\x09str write: '('; print: self trait.\x0a\x09\x09self aliases ifNotEmpty: [ :al |\x0a\x09\x09\x09str write: ' @ {'.\x0a\x09\x09\x09al associations\x0a\x09\x09\x09\x09do: [ :each | str printSymbol: each key; write: ' -> '; printSymbol: each value ]\x0a\x09\x09\x09\x09separatedBy: [ str write: '. ' ].\x0a\x09\x09\x09str write: '}' ].\x0a\x09\x09self exclusions ifNotEmpty: [ :ex |\x0a\x09\x09\x09str write: ' - #('.\x0a\x09\x09\x09ex asArray sorted \x0a\x09\x09\x09\x09do: [ :each | str write: each symbolPrintString allButFirst ]\x0a\x09\x09\x09\x09separatedBy: [ str space ].\x0a\x09\x09\x09str write: ')' ].\x0a\x09\x09str write: ')' ]",
|
|
|
+source: "definition\x0a\x09^ String streamContents: [ :str |\x0a\x09\x09str print: self trait.\x0a\x09\x09self aliases ifNotEmpty: [ :al |\x0a\x09\x09\x09str write: ' @ {'.\x0a\x09\x09\x09al associations\x0a\x09\x09\x09\x09do: [ :each | str printSymbol: each key; write: ' -> '; printSymbol: each value ]\x0a\x09\x09\x09\x09separatedBy: [ str write: '. ' ].\x0a\x09\x09\x09str write: '}' ].\x0a\x09\x09self exclusions ifNotEmpty: [ :ex |\x0a\x09\x09\x09str write: ' - #('.\x0a\x09\x09\x09ex asArray sorted \x0a\x09\x09\x09\x09do: [ :each | str write: each symbolPrintString allButFirst ]\x0a\x09\x09\x09\x09separatedBy: [ str space ].\x0a\x09\x09\x09str write: ')' ] ]",
|
|
|
referencedClasses: ["String"],
|
|
|
|
|
|
-messageSends: ["streamContents:", "write:", "print:", "trait", "ifNotEmpty:", "aliases", "do:separatedBy:", "associations", "printSymbol:", "key", "value", "exclusions", "sorted", "asArray", "allButFirst", "symbolPrintString", "space"]
|
|
|
+messageSends: ["streamContents:", "print:", "trait", "ifNotEmpty:", "aliases", "write:", "do:separatedBy:", "associations", "printSymbol:", "key", "value", "exclusions", "sorted", "asArray", "allButFirst", "symbolPrintString", "space"]
|
|
|
}),
|
|
|
$globals.TraitTransformation);
|
|
|
|