|
@@ -1,4 +1,4 @@
|
|
|
-define("amber_core/Platform-ImportExport", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Platform-Services", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Classes"], function($boot){
|
|
|
+define("amber_core/Platform-ImportExport", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions", "amber_core/Platform-Services", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Classes"], function($boot){
|
|
|
var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
|
$core.addPackage('Platform-ImportExport');
|
|
|
$core.packages["Platform-ImportExport"].innerEval = function (expr) { return eval(expr); };
|
|
@@ -2287,54 +2287,28 @@ messageSends: ["stream:", "new"]
|
|
|
$globals.ChunkParser.klass);
|
|
|
|
|
|
|
|
|
-$core.addClass('ClassCategoryReader', $globals.Object, ['class', 'category'], 'Platform-ImportExport');
|
|
|
+$core.addClass('ClassCommentReader', $globals.Object, ['class'], 'Platform-ImportExport');
|
|
|
|
|
|
-$globals.ClassCategoryReader.comment="I provide a mechanism for retrieving class descriptions stored on a file in the Smalltalk chunk format.";
|
|
|
+$globals.ClassCommentReader.comment="I provide a mechanism for retrieving class comments stored on a file.\x0a\x0aSee also `ClassCategoryReader`.";
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "class:category:",
|
|
|
+selector: "class:",
|
|
|
protocol: 'accessing',
|
|
|
-fn: function (aClass,aString){
|
|
|
+fn: function (aClass){
|
|
|
var self=this;
|
|
|
self["@class"]=aClass;
|
|
|
-self["@category"]=aString;
|
|
|
return self;
|
|
|
|
|
|
},
|
|
|
|
|
|
-args: ["aClass", "aString"],
|
|
|
-source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
|
|
|
+args: ["aClass"],
|
|
|
+source: "class: aClass\x0a\x09class := aClass",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: []
|
|
|
}),
|
|
|
-$globals.ClassCategoryReader);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "compileMethod:",
|
|
|
-protocol: 'private',
|
|
|
-fn: function (aString){
|
|
|
-var self=this;
|
|
|
-function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-$recv($recv($Compiler())._new())._install_forClass_protocol_(aString,self["@class"],self["@category"]);
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString},$globals.ClassCategoryReader)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString"],
|
|
|
-source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class protocol: category",
|
|
|
-referencedClasses: ["Compiler"],
|
|
|
-
|
|
|
-messageSends: ["install:forClass:protocol:", "new"]
|
|
|
-}),
|
|
|
-$globals.ClassCategoryReader);
|
|
|
+$globals.ClassCommentReader);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
@@ -2349,13 +2323,13 @@ return $core.withContext(function($ctx1) {
|
|
|
|
|
|
$ctx1.supercall = true,
|
|
|
|
|
|
-$globals.ClassCategoryReader.superclass.fn.prototype._initialize.apply($recv(self), []));
|
|
|
+$globals.ClassCommentReader.superclass.fn.prototype._initialize.apply($recv(self), []));
|
|
|
|
|
|
$ctx1.supercall = false;
|
|
|
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ClassCategoryReader)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ClassCommentReader)});
|
|
|
|
|
|
},
|
|
|
|
|
@@ -2365,7 +2339,7 @@ referencedClasses: [],
|
|
|
|
|
|
messageSends: ["initialize"]
|
|
|
}),
|
|
|
-$globals.ClassCategoryReader);
|
|
|
+$globals.ClassCommentReader);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
@@ -2374,68 +2348,103 @@ protocol: 'fileIn',
|
|
|
fn: function (aChunkParser){
|
|
|
var self=this;
|
|
|
var chunk;
|
|
|
-function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-$recv((function(){
|
|
|
-
|
|
|
-return $core.withContext(function($ctx2) {
|
|
|
-
|
|
|
+var $1;
|
|
|
chunk=$recv(aChunkParser)._nextChunk();
|
|
|
-chunk;
|
|
|
-return $recv(chunk)._isEmpty();
|
|
|
-
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
-
|
|
|
-}))._whileFalse_((function(){
|
|
|
+$1=$recv(chunk)._isEmpty();
|
|
|
+if(!$core.assert($1)){
|
|
|
+self._setComment_(chunk);
|
|
|
+};
|
|
|
+return self;
|
|
|
|
|
|
-return $core.withContext(function($ctx2) {
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},$globals.ClassCommentReader)});
|
|
|
|
|
|
-return self._compileMethod_(chunk);
|
|
|
+},
|
|
|
+
|
|
|
+args: ["aChunkParser"],
|
|
|
+source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09\x09self setComment: chunk ].",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["nextChunk", "ifFalse:", "isEmpty", "setComment:"]
|
|
|
+}),
|
|
|
+$globals.ClassCommentReader);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "setComment:",
|
|
|
+protocol: 'private',
|
|
|
+fn: function (aString){
|
|
|
+var self=this;
|
|
|
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-}));
|
|
|
-$recv($recv($ClassBuilder())._new())._setupClass_(self["@class"]);
|
|
|
+$recv(self["@class"])._comment_(aString);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},$globals.ClassCategoryReader)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString},$globals.ClassCommentReader)});
|
|
|
|
|
|
},
|
|
|
|
|
|
-args: ["aChunkParser"],
|
|
|
-source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[ chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ] whileFalse: [\x0a\x09\x09self compileMethod: chunk ].\x0a\x09ClassBuilder new setupClass: class",
|
|
|
-referencedClasses: ["ClassBuilder"],
|
|
|
+args: ["aString"],
|
|
|
+source: "setComment: aString\x0a\x09class comment: aString",
|
|
|
+referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["whileFalse:", "nextChunk", "isEmpty", "compileMethod:", "setupClass:", "new"]
|
|
|
+messageSends: ["comment:"]
|
|
|
}),
|
|
|
-$globals.ClassCategoryReader);
|
|
|
+$globals.ClassCommentReader);
|
|
|
|
|
|
|
|
|
|
|
|
-$core.addClass('ClassCommentReader', $globals.Object, ['class'], 'Platform-ImportExport');
|
|
|
+$core.addClass('ClassProtocolReader', $globals.Object, ['class', 'category'], 'Platform-ImportExport');
|
|
|
|
|
|
-$globals.ClassCommentReader.comment="I provide a mechanism for retrieving class comments stored on a file.\x0a\x0aSee also `ClassCategoryReader`.";
|
|
|
+$globals.ClassProtocolReader.comment="I provide a mechanism for retrieving class descriptions stored on a file in the Smalltalk chunk format.";
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "class:",
|
|
|
+selector: "class:category:",
|
|
|
protocol: 'accessing',
|
|
|
-fn: function (aClass){
|
|
|
+fn: function (aClass,aString){
|
|
|
var self=this;
|
|
|
self["@class"]=aClass;
|
|
|
+self["@category"]=aString;
|
|
|
return self;
|
|
|
|
|
|
},
|
|
|
|
|
|
-args: ["aClass"],
|
|
|
-source: "class: aClass\x0a\x09class := aClass",
|
|
|
+args: ["aClass", "aString"],
|
|
|
+source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: []
|
|
|
}),
|
|
|
-$globals.ClassCommentReader);
|
|
|
+$globals.ClassProtocolReader);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "compileMethod:",
|
|
|
+protocol: 'private',
|
|
|
+fn: function (aString){
|
|
|
+var self=this;
|
|
|
+function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+$recv($recv($Compiler())._new())._install_forClass_protocol_(aString,self["@class"],self["@category"]);
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString},$globals.ClassProtocolReader)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: ["aString"],
|
|
|
+source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class protocol: category",
|
|
|
+referencedClasses: ["Compiler"],
|
|
|
+
|
|
|
+messageSends: ["install:forClass:protocol:", "new"]
|
|
|
+}),
|
|
|
+$globals.ClassProtocolReader);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
@@ -2450,13 +2459,13 @@ return $core.withContext(function($ctx1) {
|
|
|
|
|
|
$ctx1.supercall = true,
|
|
|
|
|
|
-$globals.ClassCommentReader.superclass.fn.prototype._initialize.apply($recv(self), []));
|
|
|
+$globals.ClassProtocolReader.superclass.fn.prototype._initialize.apply($recv(self), []));
|
|
|
|
|
|
$ctx1.supercall = false;
|
|
|
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ClassCommentReader)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ClassProtocolReader)});
|
|
|
|
|
|
},
|
|
|
|
|
@@ -2466,7 +2475,7 @@ referencedClasses: [],
|
|
|
|
|
|
messageSends: ["initialize"]
|
|
|
}),
|
|
|
-$globals.ClassCommentReader);
|
|
|
+$globals.ClassProtocolReader);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
@@ -2475,52 +2484,43 @@ protocol: 'fileIn',
|
|
|
fn: function (aChunkParser){
|
|
|
var self=this;
|
|
|
var chunk;
|
|
|
+function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-var $1;
|
|
|
+$recv((function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
chunk=$recv(aChunkParser)._nextChunk();
|
|
|
-$1=$recv(chunk)._isEmpty();
|
|
|
-if(!$core.assert($1)){
|
|
|
-self._setComment_(chunk);
|
|
|
-};
|
|
|
-return self;
|
|
|
+chunk;
|
|
|
+return $recv(chunk)._isEmpty();
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},$globals.ClassCommentReader)});
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aChunkParser"],
|
|
|
-source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09\x09self setComment: chunk ].",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["nextChunk", "ifFalse:", "isEmpty", "setComment:"]
|
|
|
-}),
|
|
|
-$globals.ClassCommentReader);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "setComment:",
|
|
|
-protocol: 'private',
|
|
|
-fn: function (aString){
|
|
|
-var self=this;
|
|
|
+}))._whileFalse_((function(){
|
|
|
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-$recv(self["@class"])._comment_(aString);
|
|
|
+return self._compileMethod_(chunk);
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
|
|
|
+
|
|
|
+}));
|
|
|
+$recv($recv($ClassBuilder())._new())._setupClass_(self["@class"]);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString},$globals.ClassCommentReader)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},$globals.ClassProtocolReader)});
|
|
|
|
|
|
},
|
|
|
|
|
|
-args: ["aString"],
|
|
|
-source: "setComment: aString\x0a\x09class comment: aString",
|
|
|
-referencedClasses: [],
|
|
|
+args: ["aChunkParser"],
|
|
|
+source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[ chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ] whileFalse: [\x0a\x09\x09self compileMethod: chunk ].\x0a\x09ClassBuilder new setupClass: class",
|
|
|
+referencedClasses: ["ClassBuilder"],
|
|
|
|
|
|
-messageSends: ["comment:"]
|
|
|
+messageSends: ["whileFalse:", "nextChunk", "isEmpty", "compileMethod:", "setupClass:", "new"]
|
|
|
}),
|
|
|
-$globals.ClassCommentReader);
|
|
|
+$globals.ClassProtocolReader);
|
|
|
|
|
|
|
|
|
|
|
@@ -4352,12 +4352,12 @@ selector: "methodsFor:",
|
|
|
protocol: '*Platform-ImportExport',
|
|
|
fn: function (aString){
|
|
|
var self=this;
|
|
|
-function $ClassCategoryReader(){return $globals.ClassCategoryReader||(typeof ClassCategoryReader=="undefined"?nil:ClassCategoryReader)}
|
|
|
+function $ClassProtocolReader(){return $globals.ClassProtocolReader||(typeof ClassProtocolReader=="undefined"?nil:ClassProtocolReader)}
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
var $2,$3,$1;
|
|
|
-$2=$recv($ClassCategoryReader())._new();
|
|
|
+$2=$recv($ClassProtocolReader())._new();
|
|
|
$recv($2)._class_category_(self,aString);
|
|
|
$3=$recv($2)._yourself();
|
|
|
$1=$3;
|
|
@@ -4368,8 +4368,8 @@ return $1;
|
|
|
},
|
|
|
|
|
|
args: ["aString"],
|
|
|
-source: "methodsFor: aString\x0a\x09^ ClassCategoryReader new\x0a\x09\x09class: self category: aString;\x0a\x09\x09yourself",
|
|
|
-referencedClasses: ["ClassCategoryReader"],
|
|
|
+source: "methodsFor: aString\x0a\x09^ ClassProtocolReader new\x0a\x09\x09class: self category: aString;\x0a\x09\x09yourself",
|
|
|
+referencedClasses: ["ClassProtocolReader"],
|
|
|
|
|
|
messageSends: ["class:category:", "new", "yourself"]
|
|
|
}),
|