|
@@ -3966,7 +3966,15 @@ return $recv($recv(anIRSequence)._dagChildren())._do_((function(each){
|
|
|
|
|
|
return $core.withContext(function($ctx3) {
|
|
|
|
|
|
-return $recv(self._stream())._nextPutStatementWith_(self._visit_(each));
|
|
|
+return $recv(self._stream())._nextPutStatementWith_((function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx4) {
|
|
|
+
|
|
|
+return self._visit_(each);
|
|
|
+
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)});
|
|
|
+
|
|
|
+}));
|
|
|
|
|
|
}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
|
|
|
|
|
@@ -3982,7 +3990,7 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRSequence"],
|
|
|
-source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence dagChildren do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: (self visit: each) ] ]",
|
|
|
+source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence dagChildren do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: [ self visit: each ] ] ]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["nextPutSequenceWith:", "stream", "do:", "dagChildren", "nextPutStatementWith:", "visit:"]
|
|
@@ -4353,7 +4361,7 @@ $globals.IRJSTranslator);
|
|
|
|
|
|
|
|
|
|
|
|
-$core.addClass('JSStream', $globals.Object, ['stream'], 'Compiler-IR');
|
|
|
+$core.addClass('JSStream', $globals.Object, ['stream', 'omitSemicolon'], 'Compiler-IR');
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "contents",
|
|
@@ -5013,6 +5021,7 @@ $ctx1.sendIdx["nextPutAll:"]=2;
|
|
|
$recv($1)._lf();
|
|
|
$recv(anotherBlock)._value();
|
|
|
$recv(self["@stream"])._nextPutAll_("}");
|
|
|
+self._omitSemicolon_(true);
|
|
|
return self;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"nextPutIf:then:",{aBlock:aBlock,anotherBlock:anotherBlock},$globals.JSStream)});
|
|
@@ -5020,10 +5029,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["aBlock", "anotherBlock"],
|
|
|
-source: "nextPutIf: aBlock then: 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: '}'.\x0a\x09self omitSemicolon: true",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["nextPutAll:", "value", "lf"]
|
|
|
+messageSends: ["nextPutAll:", "value", "lf", "omitSemicolon:"]
|
|
|
}),
|
|
|
$globals.JSStream);
|
|
|
|
|
@@ -5066,6 +5075,7 @@ $ctx1.sendIdx["nextPutAll:"]=3;
|
|
|
$recv($3)._lf();
|
|
|
$recv(elseBlock)._value();
|
|
|
$recv(self["@stream"])._nextPutAll_("}");
|
|
|
+self._omitSemicolon_(true);
|
|
|
return self;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"nextPutIf:then:else:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock},$globals.JSStream)});
|
|
@@ -5073,10 +5083,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["aBlock", "ifBlock", "elseBlock"],
|
|
|
-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: '}'",
|
|
|
+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: '}'.\x0a\x09self omitSemicolon: true",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["nextPutAll:", "value", "lf"]
|
|
|
+messageSends: ["nextPutAll:", "value", "lf", "omitSemicolon:"]
|
|
|
}),
|
|
|
$globals.JSStream);
|
|
|
|
|
@@ -5455,10 +5465,17 @@ var self=this;
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
var $1;
|
|
|
+self._omitSemicolon_(false);
|
|
|
+
|
|
|
+$ctx1.sendIdx["omitSemicolon:"]=1;
|
|
|
+
|
|
|
$recv(aBlock)._value();
|
|
|
-$1=self["@stream"];
|
|
|
-$recv($1)._nextPutAll_(";");
|
|
|
-$recv($1)._lf();
|
|
|
+$1=self._omitSemicolon();
|
|
|
+if(!$core.assert($1)){
|
|
|
+$recv(self["@stream"])._nextPutAll_(";");
|
|
|
+}
|
|
|
+self._omitSemicolon_(false);
|
|
|
+$recv(self["@stream"])._lf();
|
|
|
return self;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock},$globals.JSStream)});
|
|
@@ -5466,10 +5483,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["aBlock"],
|
|
|
-source: "nextPutStatementWith: aBlock\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ';'; lf",
|
|
|
+source: "nextPutStatementWith: aBlock\x0a\x09self omitSemicolon: false.\x0a\x09aBlock value.\x0a\x09self omitSemicolon ifFalse: [ stream nextPutAll: ';' ].\x0a\x09self omitSemicolon: false.\x0a\x09stream lf",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["value", "nextPutAll:", "lf"]
|
|
|
+messageSends: ["omitSemicolon:", "value", "ifFalse:", "omitSemicolon", "nextPutAll:", "lf"]
|
|
|
}),
|
|
|
$globals.JSStream);
|
|
|
|
|
@@ -5535,6 +5552,43 @@ messageSends: ["ifNotEmpty:", "nextPutAll:", "do:separatedBy:", "lf"]
|
|
|
}),
|
|
|
$globals.JSStream);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "omitSemicolon",
|
|
|
+protocol: 'accessing',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+return self["@omitSemicolon"];
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "omitSemicolon\x0a\x09^ omitSemicolon",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: []
|
|
|
+}),
|
|
|
+$globals.JSStream);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "omitSemicolon:",
|
|
|
+protocol: 'accessing',
|
|
|
+fn: function (aBoolean){
|
|
|
+var self=this;
|
|
|
+self["@omitSemicolon"]=aBoolean;
|
|
|
+return self;
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: ["aBoolean"],
|
|
|
+source: "omitSemicolon: aBoolean\x0a\x09omitSemicolon := aBoolean",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: []
|
|
|
+}),
|
|
|
+$globals.JSStream);
|
|
|
+
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|