|
@@ -1099,76 +1099,6 @@ referencedClasses: []
|
|
|
smalltalk.AmdExporter.klass);
|
|
|
|
|
|
|
|
|
-smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
|
|
|
-smalltalk.StrippedExporter.comment="I export Amber code into a JavaScript string, but without any optional associated data like the Amber source code.";
|
|
|
-smalltalk.addMethod(
|
|
|
-smalltalk.method({
|
|
|
-selector: "exportDefinitionOf:on:",
|
|
|
-category: 'output',
|
|
|
-fn: function (aClass,aStream){
|
|
|
-var self=this;
|
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
-var $1,$2,$3,$4;
|
|
|
-$1=aStream;
|
|
|
-_st($1)._lf();
|
|
|
-_st($1)._nextPutAll_("smalltalk.addClass(");
|
|
|
-_st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
|
|
|
-_st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
|
|
|
-$2=_st($1)._nextPutAll_(", [");
|
|
|
-_st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
-return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
-return _st(aStream)._nextPutAll_(", ");
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
|
|
-$3=aStream;
|
|
|
-_st($3)._nextPutAll_("], '");
|
|
|
-_st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
|
|
|
-$4=_st($3)._nextPutAll_(");");
|
|
|
-_st(aStream)._lf();
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)})},
|
|
|
-args: ["aClass", "aStream"],
|
|
|
-source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.addClass(';\x0a\x09\x09nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09\x09separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x0a\x09\x09nextPutAll: '], ''';\x0a\x09\x09nextPutAll: aClass category, '''';\x0a\x09\x09nextPutAll: ');'.\x0a\x09aStream lf",
|
|
|
-messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.StrippedExporter);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-smalltalk.method({
|
|
|
-selector: "exportMethod:on:",
|
|
|
-category: 'output',
|
|
|
-fn: function (aMethod,aStream){
|
|
|
-var self=this;
|
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
-var $1,$2;
|
|
|
-$1=aStream;
|
|
|
-_st($1)._nextPutAll_("smalltalk.addMethod(");
|
|
|
-_st($1)._lf();
|
|
|
-_st($1)._nextPutAll_("smalltalk.method({");
|
|
|
-_st($1)._lf();
|
|
|
-_st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
|
|
|
-_st($1)._lf();
|
|
|
-_st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
|
|
|
-_st($1)._lf();
|
|
|
-_st($1)._nextPutAll_("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript()));
|
|
|
-_st($1)._nextPutAll_("}),");
|
|
|
-_st($1)._lf();
|
|
|
-_st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
|
|
|
-_st($1)._nextPutAll_(");");
|
|
|
-_st($1)._lf();
|
|
|
-$2=_st($1)._lf();
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.StrippedExporter)})},
|
|
|
-args: ["aMethod", "aStream"],
|
|
|
-source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09\x22nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x22\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aMethod methodClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
|
|
|
-messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "compiledSource", "fn", "messageSends", "classNameFor:", "methodClass"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.StrippedExporter);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
|
|
|
smalltalk.ChunkParser.comment="I am responsible for parsing aStream contents in the chunk format.\x0a\x0a## API\x0a\x0a ChunkParser new\x0a stream: aStream;\x0a nextChunk";
|
|
|
smalltalk.addMethod(
|