|
@@ -245,7 +245,7 @@ $globals.AbstractCodeGenerator);
|
|
|
|
|
|
|
|
|
|
|
|
-$core.addClass("CodeGenerator", $globals.AbstractCodeGenerator, [], "Compiler-Core");
|
|
|
+$core.addClass("CodeGenerator", $globals.AbstractCodeGenerator, ["transformersDictionary"], "Compiler-Core");
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
$globals.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation.";
|
|
|
//>>excludeEnd("ide");
|
|
@@ -328,28 +328,34 @@ var self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1;
|
|
|
-$1=$recv($globals.Dictionary)._new();
|
|
|
-$recv($1)._at_put_("2000-semantic",self._semanticAnalyzer());
|
|
|
+var $1,$2,$receiver;
|
|
|
+$1=self["@transformersDictionary"];
|
|
|
+if(($receiver = $1) == null || $receiver.isNil){
|
|
|
+$2=$recv($globals.Dictionary)._new();
|
|
|
+$recv($2)._at_put_("2000-semantic",self._semanticAnalyzer());
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
$ctx1.sendIdx["at:put:"]=1;
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$recv($1)._at_put_("5000-astToIr",self._translator());
|
|
|
+$recv($2)._at_put_("5000-astToIr",self._translator());
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
$ctx1.sendIdx["at:put:"]=2;
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$recv($1)._at_put_("8000-irToJs",self._irTranslator());
|
|
|
-return $recv($1)._yourself();
|
|
|
+$recv($2)._at_put_("8000-irToJs",self._irTranslator());
|
|
|
+self["@transformersDictionary"]=$recv($2)._yourself();
|
|
|
+return self["@transformersDictionary"];
|
|
|
+} else {
|
|
|
+return $1;
|
|
|
+}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"transformersDictionary",{},$globals.CodeGenerator)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
},
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
args: [],
|
|
|
-source: "transformersDictionary\x0a\x09^ Dictionary new\x0a\x09\x09at: '2000-semantic' put: self semanticAnalyzer;\x0a\x09\x09at: '5000-astToIr' put: self translator;\x0a\x09\x09at: '8000-irToJs' put: self irTranslator;\x0a\x09\x09yourself",
|
|
|
+source: "transformersDictionary\x0a\x09^ transformersDictionary ifNil: [ transformersDictionary := Dictionary new\x0a\x09\x09at: '2000-semantic' put: self semanticAnalyzer;\x0a\x09\x09at: '5000-astToIr' put: self translator;\x0a\x09\x09at: '8000-irToJs' put: self irTranslator;\x0a\x09\x09yourself ]",
|
|
|
referencedClasses: ["Dictionary"],
|
|
|
//>>excludeEnd("ide");
|
|
|
-messageSends: ["at:put:", "new", "semanticAnalyzer", "translator", "irTranslator", "yourself"]
|
|
|
+messageSends: ["ifNil:", "at:put:", "new", "semanticAnalyzer", "translator", "irTranslator", "yourself"]
|
|
|
}),
|
|
|
$globals.CodeGenerator);
|
|
|
|