Browse Source

JSStream: rename to #nextPutIf:then:[else:]

Herbert Vojčík 8 years ago
parent
commit
5366cc32d8
4 changed files with 28 additions and 28 deletions
  1. 6 6
      src/Compiler-IR.js
  2. 2 2
      src/Compiler-IR.st
  3. 12 12
      src/Compiler-Inlining.js
  4. 8 8
      src/Compiler-Inlining.st

+ 6 - 6
src/Compiler-IR.js

@@ -5367,7 +5367,7 @@ $globals.JSStream);
 
 $core.addMethod(
 $core.method({
-selector: "nextPutIf:with:",
+selector: "nextPutIf:then:",
 protocol: 'streaming',
 fn: function (aBlock,anotherBlock){
 var self=this;
@@ -5393,12 +5393,12 @@ $recv(anotherBlock)._value();
 $recv(self["@stream"])._nextPutAll_("}");
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock},$globals.JSStream)});
+}, function($ctx1) {$ctx1.fill(self,"nextPutIf:then:",{aBlock:aBlock,anotherBlock:anotherBlock},$globals.JSStream)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aBlock", "anotherBlock"],
-source: "nextPutIf: aBlock with: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
+source: "nextPutIf: aBlock then: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["nextPutAll:", "value", "lf"]
@@ -5407,7 +5407,7 @@ $globals.JSStream);
 
 $core.addMethod(
 $core.method({
-selector: "nextPutIfElse:with:with:",
+selector: "nextPutIf:then:else:",
 protocol: 'streaming',
 fn: function (aBlock,ifBlock,elseBlock){
 var self=this;
@@ -5446,12 +5446,12 @@ $recv(elseBlock)._value();
 $recv(self["@stream"])._nextPutAll_("}");
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock},$globals.JSStream)});
+}, function($ctx1) {$ctx1.fill(self,"nextPutIf:then:else:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock},$globals.JSStream)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aBlock", "ifBlock", "elseBlock"],
-source: "nextPutIfElse: aBlock with: ifBlock with: elseBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09ifBlock value.\x0a\x09stream nextPutAll: '} else {'; lf.\x0a\x09elseBlock value.\x0a\x09stream nextPutAll: '}'",
+source: "nextPutIf: aBlock then: ifBlock else: elseBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09ifBlock value.\x0a\x09stream nextPutAll: '} else {'; lf.\x0a\x09elseBlock value.\x0a\x09stream nextPutAll: '}'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["nextPutAll:", "value", "lf"]

+ 2 - 2
src/Compiler-IR.st

@@ -1223,7 +1223,7 @@ nextPutFunctionWith: aBlock arguments: anArray
 	stream lf; nextPutAll: '}'
 !
 
-nextPutIf: aBlock with: anotherBlock
+nextPutIf: aBlock then: anotherBlock
 	stream nextPutAll: 'if('.
 	aBlock value.
 	stream nextPutAll: '){'; lf.
@@ -1231,7 +1231,7 @@ nextPutIf: aBlock with: anotherBlock
 	stream nextPutAll: '}'
 !
 
-nextPutIfElse: aBlock with: ifBlock with: elseBlock
+nextPutIf: aBlock then: ifBlock else: elseBlock
 	stream nextPutAll: 'if('.
 	aBlock value.
 	stream nextPutAll: '){'; lf.

+ 12 - 12
src/Compiler-Inlining.js

@@ -958,7 +958,7 @@ $1=self._stream();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["stream"]=1;
 //>>excludeEnd("ctx");
-$recv($1)._nextPutIf_with_((function(){
+$recv($1)._nextPutIf_then_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -999,10 +999,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedIfFalse"],
-source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '!$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfFalse instructions last ]",
+source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '!$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfFalse instructions last ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutIf:with:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
+messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -1020,7 +1020,7 @@ $1=self._stream();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["stream"]=1;
 //>>excludeEnd("ctx");
-$recv($1)._nextPutIfElse_with_with_((function(){
+$recv($1)._nextPutIf_then_else_((function(){
 var recvVarName;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -1093,10 +1093,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedIfNilIfNotNil"],
-source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream\x0a\x09\x09nextPutIfElse: [\x0a\x09\x09\x09| recvVarName |\x0a\x09\x09\x09recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.\x0a\x09\x09\x09self stream nextPutAll: '(', recvVarName, ' = '.\x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil instructions first.\x0a\x09\x09\x09self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]",
+source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09| recvVarName |\x0a\x09\x09\x09recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.\x0a\x09\x09\x09self stream nextPutAll: '(', recvVarName, ' = '.\x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil instructions first.\x0a\x09\x09\x09self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutIfElse:with:with:", "stream", "receiverInternalVariableName", "nextPutAll:", ",", "visit:", "first", "instructions", "second", "third"]
+messageSends: ["nextPutIf:then:else:", "stream", "receiverInternalVariableName", "nextPutAll:", ",", "visit:", "first", "instructions", "second", "third"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -1114,7 +1114,7 @@ $1=self._stream();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["stream"]=1;
 //>>excludeEnd("ctx");
-$recv($1)._nextPutIf_with_((function(){
+$recv($1)._nextPutIf_then_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -1155,10 +1155,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedIfTrue"],
-source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfTrue instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrue instructions last ]",
+source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfTrue instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrue instructions last ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutIf:with:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
+messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -1176,7 +1176,7 @@ $1=self._stream();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["stream"]=1;
 //>>excludeEnd("ctx");
-$recv($1)._nextPutIfElse_with_with_((function(){
+$recv($1)._nextPutIf_then_else_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -1233,10 +1233,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedIfTrueIfFalse"],
-source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream\x0a\x09\x09nextPutIfElse: [\x0a\x09\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse instructions first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]",
+source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse instructions first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutIfElse:with:with:", "stream", "nextPutAll:", "visit:", "first", "instructions", "second", "third"]
+messageSends: ["nextPutIf:then:else:", "stream", "nextPutAll:", "visit:", "first", "instructions", "second", "third"]
 }),
 $globals.IRInliningJSTranslator);
 

+ 8 - 8
src/Compiler-Inlining.st

@@ -273,19 +273,19 @@ visitIRInlinedIfFalse: anIRInlinedIfFalse
 		self stream nextPutAll: '!!$core.assert('.
 		self visit: anIRInlinedIfFalse instructions first.
 		self stream nextPutAll: ')' ]
-		with: [ self visit: anIRInlinedIfFalse instructions last ]
+		then: [ self visit: anIRInlinedIfFalse instructions last ]
 !
 
 visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
 	self stream
-		nextPutIfElse: [
+		nextPutIf: [
 			| recvVarName |
 			recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.
 			self stream nextPutAll: '(', recvVarName, ' = '.
 			self visit: anIRInlinedIfNilIfNotNil instructions first.
 			self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]
-		with: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]
-		with: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]
+		then: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]
+		else: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]
 !
 
 visitIRInlinedIfTrue: anIRInlinedIfTrue
@@ -293,17 +293,17 @@ visitIRInlinedIfTrue: anIRInlinedIfTrue
 		self stream nextPutAll: '$core.assert('.
 		self visit: anIRInlinedIfTrue instructions first.
 		self stream nextPutAll: ')' ]
-		with: [ self visit: anIRInlinedIfTrue instructions last ]
+		then: [ self visit: anIRInlinedIfTrue instructions last ]
 !
 
 visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
 	self stream
-		nextPutIfElse: [
+		nextPutIf: [
 			self stream nextPutAll: '$core.assert('.
 			self visit: anIRInlinedIfTrueIfFalse instructions first.
 			self stream nextPutAll: ')' ]
-		with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]
-		with: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]
+		then: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]
+		else: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]
 !
 
 visitIRInlinedNonLocalReturn: anIRInlinedReturn