|
@@ -1,22 +1,25 @@
|
|
|
-define("lyst/Lyst", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections"], function($boot){"use strict";
|
|
|
-var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
|
-$core.addPackage('Lyst');
|
|
|
+define(["amber/boot", "amber_core/Kernel-Collections", "amber_core/Kernel-Objects"], function($boot){"use strict";
|
|
|
+if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
|
|
|
+if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
|
|
|
+var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
|
+if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
|
|
|
+$core.addPackage("Lyst");
|
|
|
$core.packages["Lyst"].innerEval = function (expr) { return eval(expr); };
|
|
|
$core.packages["Lyst"].transport = {"type":"amd","amdNamespace":"lyst"};
|
|
|
|
|
|
-$core.addClass('Lyst', $globals.Object, [], 'Lyst');
|
|
|
+$core.addClass("Lyst", $globals.Object, [], "Lyst");
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "parse:",
|
|
|
-protocol: 'parsing',
|
|
|
+protocol: "parsing",
|
|
|
fn: function (message){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
var result,stack,anArray;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1,$2,$3,$5,$4,$6,$7,$8,$9,$10,$11,$12;
|
|
|
+var $1,$2,$3,$5,$4,$6,$7,$8,$9,$10,$11;
|
|
|
anArray=$recv(message)._tokenize_(" ");
|
|
|
result=[];
|
|
|
stack=[result];
|
|
@@ -145,7 +148,7 @@ $ctx3.sendIdx["="]=3;
|
|
|
if($core.assert($8)){
|
|
|
inner=[$recv(inner)._allButFirst()];
|
|
|
inner;
|
|
|
-};
|
|
|
+}
|
|
|
$9=$recv(inner)._isString();
|
|
|
if($core.assert($9)){
|
|
|
asNum=$recv($recv(inner)._ifEmpty_((function(){
|
|
@@ -154,7 +157,7 @@ return "NaN";
|
|
|
})))._asNumber();
|
|
|
} else {
|
|
|
asNum=inner;
|
|
|
-};
|
|
|
+}
|
|
|
asNum;
|
|
|
$10=$recv(asNum).__eq(asNum);
|
|
|
if($core.assert($10)){
|
|
@@ -176,7 +179,7 @@ return $recv($recv(stack)._last())._add_(inner);
|
|
|
}, function($ctx3) {$ctx3.fillBlock({},$ctx2,15)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}));
|
|
|
-};
|
|
|
+}
|
|
|
return $recv(close)._timesRepeat_((function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx3) {
|
|
@@ -190,10 +193,9 @@ return $recv(stack)._removeLast();
|
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each,asNum:asNum,inner:inner,close:close},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}));
|
|
|
-$12=result;
|
|
|
-return $12;
|
|
|
+return result;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"parse:",{message:message,result:result,stack:stack,anArray:anArray},$globals.Lyst.klass)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"parse:",{message:message,result:result,stack:stack,anArray:anArray},$globals.Lyst.a$cls)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
},
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
@@ -203,23 +205,22 @@ referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
messageSends: ["tokenize:", "do:", "whileTrue:", "and:", "notEmpty", "=", "first", "allButFirst", "add:", "last", "allButLast", "+", "ifTrue:", "ifTrue:ifFalse:", "isString", "asNumber", "ifEmpty:", "ifNotEmpty:", "timesRepeat:", "removeLast"]
|
|
|
}),
|
|
|
-$globals.Lyst.klass);
|
|
|
+$globals.Lyst.a$cls);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (anObject,aBlock){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
var receiver,selector,result;
|
|
|
-function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $5,$4,$3,$2,$1,$6,$7;
|
|
|
+var $5,$4,$3,$2,$1;
|
|
|
var $early={};
|
|
|
try {
|
|
|
-selector=self._first();
|
|
|
+selector=$self._first();
|
|
|
receiver=$recv(anObject)._yourself();
|
|
|
$recv((function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -230,7 +231,7 @@ return result;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-}))._on_do_($MessageNotUnderstood(),(function(mnu){
|
|
|
+}))._on_do_($globals.MessageNotUnderstood,(function(mnu){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -263,15 +264,13 @@ $ctx2.sendIdx["and:"]=1;
|
|
|
//>>excludeEnd("ctx");
|
|
|
if(!$core.assert($1)){
|
|
|
$recv(mnu)._resignal();
|
|
|
-};
|
|
|
-$6=$recv(aBlock)._value();
|
|
|
-throw $early=[$6];
|
|
|
+}
|
|
|
+throw $early=[$recv(aBlock)._value()];
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({mnu:mnu},$ctx1,2)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}));
|
|
|
-$7=result;
|
|
|
-return $7;
|
|
|
+return result;
|
|
|
}
|
|
|
catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -290,18 +289,17 @@ $globals.Array);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:put:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (anObject,aBlock,anotherObject){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
var receiver,selector,arguments_,result;
|
|
|
-function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $5,$4,$3,$2,$1,$6,$7;
|
|
|
+var $5,$4,$3,$2,$1;
|
|
|
var $early={};
|
|
|
try {
|
|
|
-selector=$recv(self._first())._asMutator();
|
|
|
+selector=$recv($self._first())._asMutator();
|
|
|
receiver=$recv(anObject)._yourself();
|
|
|
arguments_=[anotherObject];
|
|
|
$recv((function(){
|
|
@@ -313,7 +311,7 @@ return result;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
-}))._on_do_($MessageNotUnderstood(),(function(mnu){
|
|
|
+}))._on_do_($globals.MessageNotUnderstood,(function(mnu){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -349,15 +347,13 @@ $ctx2.sendIdx["and:"]=1;
|
|
|
//>>excludeEnd("ctx");
|
|
|
if(!$core.assert($1)){
|
|
|
$recv(mnu)._resignal();
|
|
|
-};
|
|
|
-$6=$recv(aBlock)._value();
|
|
|
-throw $early=[$6];
|
|
|
+}
|
|
|
+throw $early=[$recv(aBlock)._value()];
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({mnu:mnu},$ctx1,2)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}));
|
|
|
-$7=result;
|
|
|
-return $7;
|
|
|
+return result;
|
|
|
}
|
|
|
catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -376,13 +372,13 @@ $globals.Array);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (anObject,aBlock){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1,$2;
|
|
|
+var $1;
|
|
|
var $early={};
|
|
|
try {
|
|
|
$1=$recv(anObject)._respondsTo_("at:ifAbsent:");
|
|
@@ -390,8 +386,7 @@ $recv($1)._ifTrue_ifFalse_((function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$2=$recv(anObject)._at_ifAbsent_(self,aBlock);
|
|
|
-throw $early=[$2];
|
|
|
+throw $early=[$recv(anObject)._at_ifAbsent_(self,aBlock)];
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -415,13 +410,13 @@ $globals.Number);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:put:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (anObject,aBlock,anotherObject){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1,$2;
|
|
|
+var $1;
|
|
|
var $early={};
|
|
|
try {
|
|
|
$1=$recv(anObject)._respondsTo_("at:put:");
|
|
@@ -429,8 +424,7 @@ $recv($1)._ifTrue_ifFalse_((function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$2=$recv(anObject)._at_put_(self,anotherObject);
|
|
|
-throw $early=[$2];
|
|
|
+throw $early=[$recv(anObject)._at_put_(self,anotherObject)];
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -454,16 +448,15 @@ $globals.Number);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atLyst:ifAbsent:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (aCollection,aBlock){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $2,$1;
|
|
|
var $early={};
|
|
|
try {
|
|
|
-$1=$recv(aCollection)._inject_into_(self,(function(soFar,segment){
|
|
|
+return $recv(aCollection)._inject_into_(self,(function(soFar,segment){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -471,8 +464,7 @@ return $recv(segment)._atYndexIn_ifAbsent_(soFar,(function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx3) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$2=$recv(aBlock)._value();
|
|
|
-throw $early=[$2];
|
|
|
+throw $early=[$recv(aBlock)._value()];
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -481,7 +473,6 @@ throw $early=[$2];
|
|
|
}, function($ctx2) {$ctx2.fillBlock({soFar:soFar,segment:segment},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}));
|
|
|
-return $1;
|
|
|
}
|
|
|
catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -500,17 +491,15 @@ $globals.Object);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atLyst:ifAbsent:put:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (aCollection,aBlock,value){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
var penultimate;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1;
|
|
|
-penultimate=self._atLyst_ifAbsent_($recv(aCollection)._allButLast(),aBlock);
|
|
|
-$1=$recv($recv(aCollection)._last())._atYndexIn_ifAbsent_put_(penultimate,aBlock,value);
|
|
|
-return $1;
|
|
|
+penultimate=$self._atLyst_ifAbsent_($recv(aCollection)._allButLast(),aBlock);
|
|
|
+return $recv($recv(aCollection)._last())._atYndexIn_ifAbsent_put_(penultimate,aBlock,value);
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"atLyst:ifAbsent:put:",{aCollection:aCollection,aBlock:aBlock,value:value,penultimate:penultimate},$globals.Object)});
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -527,15 +516,13 @@ $globals.Object);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (anObject,aBlock){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1;
|
|
|
-$1=$recv(aBlock)._value();
|
|
|
-return $1;
|
|
|
+return $recv(aBlock)._value();
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"atYndexIn:ifAbsent:",{anObject:anObject,aBlock:aBlock},$globals.Object)});
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -552,15 +539,13 @@ $globals.Object);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:put:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (anObject,aBlock,anotherObject){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1;
|
|
|
-$1=$recv(aBlock)._value();
|
|
|
-return $1;
|
|
|
+return $recv(aBlock)._value();
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"atYndexIn:ifAbsent:put:",{anObject:anObject,aBlock:aBlock,anotherObject:anotherObject},$globals.Object)});
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -577,13 +562,13 @@ $globals.Object);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (anObject,aBlock){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1,$2;
|
|
|
+var $1;
|
|
|
var $early={};
|
|
|
try {
|
|
|
$1=$recv(anObject)._respondsTo_("at:ifAbsent:");
|
|
@@ -591,8 +576,7 @@ $recv($1)._ifTrue_ifFalse_((function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$2=$recv(anObject)._at_ifAbsent_(self,aBlock);
|
|
|
-throw $early=[$2];
|
|
|
+throw $early=[$recv(anObject)._at_ifAbsent_(self,aBlock)];
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -616,13 +600,13 @@ $globals.String);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:put:",
|
|
|
-protocol: '*Lyst',
|
|
|
+protocol: "*Lyst",
|
|
|
fn: function (anObject,aBlock,anotherObject){
|
|
|
-var self=this;
|
|
|
+var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1,$2;
|
|
|
+var $1;
|
|
|
var $early={};
|
|
|
try {
|
|
|
$1=$recv(anObject)._respondsTo_("at:put:");
|
|
@@ -630,8 +614,7 @@ $recv($1)._ifTrue_ifFalse_((function(){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$2=$recv(anObject)._at_put_(self,anotherObject);
|
|
|
-throw $early=[$2];
|
|
|
+throw $early=[$recv(anObject)._at_put_(self,anotherObject)];
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|