|
@@ -1,6 +1,49 @@
|
|
|
define("amber/Importer-Exporter", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
|
|
|
smalltalk.addPackage('Importer-Exporter');
|
|
|
|
|
|
+smalltalk.addClass('AmdExporter', smalltalk.Object, [], 'Importer-Exporter');
|
|
|
+
|
|
|
+smalltalk.addMethod(
|
|
|
+smalltalk.method({
|
|
|
+selector: "exportPackageEpilogueOf:on:",
|
|
|
+category: 'exporting-output',
|
|
|
+fn: function (aPackage,aStream){
|
|
|
+var self=this;
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
+var $1,$2;
|
|
|
+$1=aStream;
|
|
|
+_st($1)._nextPutAll_("});");
|
|
|
+$2=_st($1)._lf();
|
|
|
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.AmdExporter.klass)})},
|
|
|
+args: ["aPackage", "aStream"],
|
|
|
+source: "exportPackageEpilogueOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '});';\x0a\x09\x09lf",
|
|
|
+messageSends: ["nextPutAll:", "lf"],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.AmdExporter.klass);
|
|
|
+
|
|
|
+smalltalk.addMethod(
|
|
|
+smalltalk.method({
|
|
|
+selector: "exportPackagePrologueOf:on:",
|
|
|
+category: 'exporting-output',
|
|
|
+fn: function (aPackage,aStream){
|
|
|
+var self=this;
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
+var $1,$2;
|
|
|
+$1=aStream;
|
|
|
+_st($1)._nextPutAll_("define(\x22amber/");
|
|
|
+_st($1)._nextPutAll_(_st(aPackage)._name());
|
|
|
+_st($1)._nextPutAll_("\x22, [\x22amber_vm/smalltalk\x22,\x22amber_vm/nil\x22,\x22amber_vm/_st\x22], function(smalltalk,nil,_st){");
|
|
|
+$2=_st($1)._lf();
|
|
|
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.AmdExporter.klass)})},
|
|
|
+args: ["aPackage", "aStream"],
|
|
|
+source: "exportPackagePrologueOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'define(\x22amber/';\x0a\x09\x09nextPutAll: aPackage name;\x0a\x09\x09nextPutAll: '\x22, [\x22amber_vm/smalltalk\x22,\x22amber_vm/nil\x22,\x22amber_vm/_st\x22], function(smalltalk,nil,_st){';\x0a\x09\x09lf",
|
|
|
+messageSends: ["nextPutAll:", "name", "lf"],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.AmdExporter.klass);
|
|
|
+
|
|
|
+
|
|
|
smalltalk.addClass('ChunkExporter', smalltalk.Object, [], 'Importer-Exporter');
|
|
|
smalltalk.ChunkExporter.comment="I am an exporter dedicated to outputting Amber source code in the classic Smalltalk chunk format.\x0a\x0aI do not output any compiled code.";
|
|
|
|
|
@@ -463,46 +506,6 @@ referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.Exporter.klass);
|
|
|
|
|
|
-smalltalk.addMethod(
|
|
|
-smalltalk.method({
|
|
|
-selector: "exportAmdPackageEpilogueOf:on:",
|
|
|
-category: 'exporting-output',
|
|
|
-fn: function (aPackage,aStream){
|
|
|
-var self=this;
|
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
-var $1,$2;
|
|
|
-$1=aStream;
|
|
|
-_st($1)._nextPutAll_("});");
|
|
|
-$2=_st($1)._lf();
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"exportAmdPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter.klass)})},
|
|
|
-args: ["aPackage", "aStream"],
|
|
|
-source: "exportAmdPackageEpilogueOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '});';\x0a\x09\x09lf",
|
|
|
-messageSends: ["nextPutAll:", "lf"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Exporter.klass);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-smalltalk.method({
|
|
|
-selector: "exportAmdPackagePrologueOf:on:",
|
|
|
-category: 'exporting-output',
|
|
|
-fn: function (aPackage,aStream){
|
|
|
-var self=this;
|
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
-var $1,$2;
|
|
|
-$1=aStream;
|
|
|
-_st($1)._nextPutAll_("define(\x22amber/");
|
|
|
-_st($1)._nextPutAll_(_st(aPackage)._name());
|
|
|
-_st($1)._nextPutAll_("\x22, [\x22amber_vm/smalltalk\x22,\x22amber_vm/nil\x22,\x22amber_vm/_st\x22], function(smalltalk,nil,_st){");
|
|
|
-$2=_st($1)._lf();
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"exportAmdPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter.klass)})},
|
|
|
-args: ["aPackage", "aStream"],
|
|
|
-source: "exportAmdPackagePrologueOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'define(\x22amber/';\x0a\x09\x09nextPutAll: aPackage name;\x0a\x09\x09nextPutAll: '\x22, [\x22amber_vm/smalltalk\x22,\x22amber_vm/nil\x22,\x22amber_vm/_st\x22], function(smalltalk,nil,_st){';\x0a\x09\x09lf",
|
|
|
-messageSends: ["nextPutAll:", "name", "lf"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Exporter.klass);
|
|
|
-
|
|
|
smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "exportDefinitionOf:on:",
|
|
@@ -766,16 +769,17 @@ selector: "recipe",
|
|
|
category: 'fileOut',
|
|
|
fn: function (){
|
|
|
var self=this;
|
|
|
+function $AmdExporter(){return smalltalk.AmdExporter||(typeof AmdExporter=="undefined"?nil:AmdExporter)}
|
|
|
function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $1;
|
|
|
-$1=[self.__minus_gt("exportAmdPackagePrologueOf:on:"),self.__minus_gt("exportPackageDefinitionOf:on:"),[_st($PluggableExporter()).__minus_gt("ownClassesOfPackage:"),self.__minus_gt("exportDefinitionOf:on:"),[self.__minus_gt("ownMethodsOfClass:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportMetaDefinitionOf:on:"),[self.__minus_gt("ownMethodsOfMetaClass:"),self.__minus_gt("exportMethod:on:")]],[self.__minus_gt("extensionMethodsOfPackage:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportAmdPackageEpilogueOf:on:")];
|
|
|
+$1=[_st($AmdExporter()).__minus_gt("exportPackagePrologueOf:on:"),self.__minus_gt("exportPackageDefinitionOf:on:"),[_st($PluggableExporter()).__minus_gt("ownClassesOfPackage:"),self.__minus_gt("exportDefinitionOf:on:"),[self.__minus_gt("ownMethodsOfClass:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportMetaDefinitionOf:on:"),[self.__minus_gt("ownMethodsOfMetaClass:"),self.__minus_gt("exportMethod:on:")]],[self.__minus_gt("extensionMethodsOfPackage:"),self.__minus_gt("exportMethod:on:")],_st($AmdExporter()).__minus_gt("exportPackageEpilogueOf:on:")];
|
|
|
return $1;
|
|
|
}, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.Exporter.klass)})},
|
|
|
args: [],
|
|
|
-source: "recipe\x0a\x09\x22Export a given package.\x22\x0a\x0a\x09^{\x0a\x09\x09self -> #exportAmdPackagePrologueOf:on:.\x0a\x09\x09self -> #exportPackageDefinitionOf:on:.\x0a\x09\x09{\x0a\x09\x09\x09PluggableExporter -> #ownClassesOfPackage:.\x0a\x09\x09\x09self -> #exportDefinitionOf:on:.\x0a\x09\x09\x09{\x0a\x09\x09\x09\x09self -> #ownMethodsOfClass:.\x0a\x09\x09\x09\x09self -> #exportMethod:on: }.\x0a\x09\x09\x09self -> #exportMetaDefinitionOf:on:.\x0a\x09\x09\x09{\x0a\x09\x09\x09\x09self -> #ownMethodsOfMetaClass:.\x0a\x09\x09\x09\x09self -> #exportMethod:on: } }.\x0a\x09\x09{\x0a\x09\x09\x09self -> #extensionMethodsOfPackage:.\x0a\x09\x09\x09self -> #exportMethod:on: }.\x0a\x09\x09self -> #exportAmdPackageEpilogueOf:on:\x0a\x09}",
|
|
|
+source: "recipe\x0a\x09\x22Export a given package.\x22\x0a\x0a\x09^{\x0a\x09\x09AmdExporter -> #exportPackagePrologueOf:on:.\x0a\x09\x09self -> #exportPackageDefinitionOf:on:.\x0a\x09\x09{\x0a\x09\x09\x09PluggableExporter -> #ownClassesOfPackage:.\x0a\x09\x09\x09self -> #exportDefinitionOf:on:.\x0a\x09\x09\x09{\x0a\x09\x09\x09\x09self -> #ownMethodsOfClass:.\x0a\x09\x09\x09\x09self -> #exportMethod:on: }.\x0a\x09\x09\x09self -> #exportMetaDefinitionOf:on:.\x0a\x09\x09\x09{\x0a\x09\x09\x09\x09self -> #ownMethodsOfMetaClass:.\x0a\x09\x09\x09\x09self -> #exportMethod:on: } }.\x0a\x09\x09{\x0a\x09\x09\x09self -> #extensionMethodsOfPackage:.\x0a\x09\x09\x09self -> #exportMethod:on: }.\x0a\x09\x09AmdExporter -> #exportPackageEpilogueOf:on:\x0a\x09}",
|
|
|
messageSends: ["->"],
|
|
|
-referencedClasses: ["PluggableExporter"]
|
|
|
+referencedClasses: ["AmdExporter", "PluggableExporter"]
|
|
|
}),
|
|
|
smalltalk.Exporter.klass);
|
|
|
|