Explorar el Código

Inline #and: and #or:.

Herby Vojčík hace 4 años
padre
commit
cadf9f419e
Se han modificado 1 ficheros con 79 adiciones y 101 borrados
  1. 79 101
      src/IDE.js

+ 79 - 101
src/IDE.js

@@ -2740,16 +2740,14 @@ var className;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
+var $1;
 className=$recv($globals.Terminal)._prompt_("New class");
-if($core.assert($recv($recv(className)._notNil())._and_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(className)._notEmpty();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
-//>>excludeEnd("ctx");
-})))){
+if($core.assert($recv(className)._notNil())){
+$1=$recv(className)._notEmpty();
+} else {
+$1=false;
+}
+if($core.assert($1)){
 $recv($globals.Object)._subclass_instanceVariableNames_package_(className,"",$self._selectedPackage());
 $self._resetClassesList();
 $self._updateClassesList();
@@ -2779,16 +2777,14 @@ var newProtocol;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
+var $1;
 newProtocol=$recv($globals.Terminal)._prompt_("New method protocol");
-if($core.assert($recv($recv(newProtocol)._notNil())._and_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(newProtocol)._notEmpty();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
-//>>excludeEnd("ctx");
-})))){
+if($core.assert($recv(newProtocol)._notNil())){
+$1=$recv(newProtocol)._notEmpty();
+} else {
+$1=false;
+}
+if($core.assert($1)){
 $recv($self.selectedMethod)._protocol_(newProtocol);
 $self._setMethodProtocol_(newProtocol);
 }
@@ -2984,7 +2980,7 @@ var currentEditLine;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
+var $1,$2;
 $self._disableSaveButton();
 currentEditLine=$recv([$recv($self.sourceArea)._editor()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -2999,19 +2995,16 @@ $1;
 $self._compileClassComment();
 }
 } else {
-if($core.assert($recv([$recv($self.selectedProtocol)._notNil()
+if($core.assert([$recv($self.selectedProtocol)._notNil()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["notNil"]=1
 //>>excludeEnd("ctx");
-][0])._or_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv($self.selectedMethod)._notNil();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
-//>>excludeEnd("ctx");
-})))){
+][0])){
+$2=true;
+} else {
+$2=$recv($self.selectedMethod)._notNil();
+}
+if($core.assert($2)){
 $self._compileMethodDefinition();
 } else {
 $self._compileDefinition();
@@ -3223,16 +3216,14 @@ var className;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
+var $1;
 className=$recv($globals.Terminal)._prompt_("Copy class");
-if($core.assert($recv($recv(className)._notNil())._and_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(className)._notEmpty();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
-//>>excludeEnd("ctx");
-})))){
+if($core.assert($recv(className)._notNil())){
+$1=$recv(className)._notEmpty();
+} else {
+$1=false;
+}
+if($core.assert($1)){
 $recv($recv($globals.ClassBuilder)._new())._copyClass_named_($self._selectedClass(),className);
 $self._resetClassesList();
 $self._updateClassesList();
@@ -3755,16 +3746,14 @@ var newName;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
+var $1;
 newName=$recv($globals.Terminal)._prompt_("Rename class ".__comma($recv($self.selectedClass)._name()));
-if($core.assert($recv($recv(newName)._notNil())._and_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(newName)._notEmpty();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
-//>>excludeEnd("ctx");
-})))){
+if($core.assert($recv(newName)._notNil())){
+$1=$recv(newName)._notEmpty();
+} else {
+$1=false;
+}
+if($core.assert($1)){
 $recv($self.selectedClass)._rename_(newName);
 $self._updateClassesList();
 $self._updateSourceAndButtons();
@@ -4646,28 +4635,25 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
+var $1,$2;
 if(!$core.assert($recv($self.selectedTab).__eq("comment"))){
-if($core.assert($recv([$recv($self.selectedProtocol)._notNil()
+if($core.assert([$recv($self.selectedProtocol)._notNil()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["notNil"]=1
 //>>excludeEnd("ctx");
-][0])._or_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv($self.selectedMethod)._notNil();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
-//>>excludeEnd("ctx");
-})))){
+][0])){
+$1=true;
+} else {
+$1=$recv($self.selectedMethod)._notNil();
+}
+if($core.assert($1)){
 return $self._methodSource();
 } else {
 return $self._declarationSource();
 }
 }
-$1=$self.selectedClass;
-if($1 == null || $1.a$nil){
+$2=$self.selectedClass;
+if($2 == null || $2.a$nil){
 return "";
 } else {
 return $self._classCommentSource();
@@ -4914,7 +4900,7 @@ var currentProtocol;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12;
+var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14;
 $self._disableSaveButton();
 [$recv($self.classButtons)._contents_((function(html){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -5126,23 +5112,20 @@ $9=[$recv(html)._option()
 //>>excludeEnd("ctx");
 ][0];
 currentProtocol=$self.selectedProtocol;
-if($core.assert($recv([$recv(currentProtocol)._isNil()
+if($core.assert([$recv(currentProtocol)._isNil()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx3.sendIdx["isNil"]=1
 //>>excludeEnd("ctx");
-][0])._and_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx4) {
-//>>excludeEnd("ctx");
-return [$recv($self.selectedMethod)._notNil()
+][0])){
+$10=[$recv($self.selectedMethod)._notNil()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-,$ctx4.sendIdx["notNil"]=1
+,$ctx3.sendIdx["notNil"]=1
 //>>excludeEnd("ctx");
 ][0];
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3,11)});
-//>>excludeEnd("ctx");
-})))){
+} else {
+$10=false;
+}
+if($core.assert($10)){
 currentProtocol=$recv($self.selectedMethod)._category();
 currentProtocol;
 }
@@ -5189,8 +5172,8 @@ if(!$core.assert([$recv($self.selectedMethod)._isNil()
 //>>excludeEnd("ctx");
 ][0])){
 referencesSelect=$recv(html)._select();
-$10=referencesSelect;
-$recv($10)._onChange_((function(){
+$11=referencesSelect;
+$recv($11)._onChange_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
@@ -5199,34 +5182,34 @@ return $self._searchReferencesOf_($recv($recv(referencesSelect)._asJQuery())._va
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,16)});
 //>>excludeEnd("ctx");
 }));
-return [$recv($10)._with_((function(){
+return [$recv($11)._with_((function(){
 var option;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-$11=[$recv(html)._option()
+$12=[$recv(html)._option()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx3.sendIdx["option"]=4
 //>>excludeEnd("ctx");
 ][0];
-[$recv($11)._with_("References")
+[$recv($12)._with_("References")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx3.sendIdx["with:"]=12
 //>>excludeEnd("ctx");
 ][0];
-[$recv($11)._at_put_("disabled","disabled")
+[$recv($12)._at_put_("disabled","disabled")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx3.sendIdx["at:put:"]=3
 //>>excludeEnd("ctx");
 ][0];
-$recv($11)._at_put_("selected","selected");
-$12=[$recv(html)._option()
+$recv($12)._at_put_("selected","selected");
+$13=[$recv(html)._option()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx3.sendIdx["option"]=5
 //>>excludeEnd("ctx");
 ][0];
-$recv($12)._class_("important");
-[$recv($12)._with_($recv($self.selectedMethod)._selector())
+$recv($13)._class_("important");
+[$recv($13)._with_($recv($self.selectedMethod)._selector())
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx3.sendIdx["with:"]=13
 //>>excludeEnd("ctx");
@@ -5259,15 +5242,12 @@ if($core.assert([$recv($self.selectedMethod)._isNil()
 //>>excludeEnd("ctx");
 ][0])){
 $self._hideMethodButtons();
-if($core.assert($recv($recv($self.selectedClass)._isNil())._or_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv($self.selectedProtocol)._notNil();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,20)});
-//>>excludeEnd("ctx");
-})))){
+if($core.assert($recv($self.selectedClass)._isNil())){
+$14=true;
+} else {
+$14=$recv($self.selectedProtocol)._notNil();
+}
+if($core.assert($14)){
 [$self._hideClassButtons()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["hideClassButtons"]=1
@@ -7241,19 +7221,17 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-if($core.assert($recv([$recv($self._selectedVariable())._notNil()
+var $1;
+if($core.assert([$recv($self._selectedVariable())._notNil()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["notNil"]=1
 //>>excludeEnd("ctx");
-][0])._and_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv($self._selectedVariableValue())._notNil();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
-//>>excludeEnd("ctx");
-})))){
+][0])){
+$1=$recv($self._selectedVariableValue())._notNil();
+} else {
+$1=false;
+}
+if($core.assert($1)){
 $recv($self.diveButton)._removeAt_("disabled");
 } else {
 $recv($self.diveButton)._at_put_("disabled",true);