Parcourir la source

MethodCategory class defined

Herbert Vojčík il y a 11 ans
Parent
commit
d264da2568
3 fichiers modifiés avec 263 ajouts et 2 suppressions
  1. 93 0
      js/Importer-Exporter.deploy.js
  2. 128 0
      js/Importer-Exporter.js
  3. 42 2
      st/Importer-Exporter.st

+ 93 - 0
js/Importer-Exporter.deploy.js

@@ -702,6 +702,99 @@ smalltalk.Importer);
 
 
 
+smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'klass'], 'Importer-Exporter');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "klass",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@klass"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"klass",{},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "klass:",
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@klass"]=aClass;
+return self}, function($ctx1) {$ctx1.fill(self,"klass:",{aClass:aClass},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methods",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@methods"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methods:",
+fn: function (anArray){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@methods"]=anArray;
+return self}, function($ctx1) {$ctx1.fill(self,"methods:",{anArray:anArray},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@name"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name:",
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@name"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
+messageSends: []}),
+smalltalk.MethodCategory);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name:class:methods:",
+fn: function (aString,aClass,anArray){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=self._new();
+_st($2)._name_(aString);
+_st($2)._klass_(aClass);
+_st($2)._methods_(anArray);
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"name:class:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
+messageSends: ["name:", "new", "klass:", "methods:", "yourself"]}),
+smalltalk.MethodCategory.klass);
+
+
 smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
 smalltalk.addMethod(
 smalltalk.method({

+ 128 - 0
js/Importer-Exporter.js

@@ -857,6 +857,134 @@ smalltalk.Importer);
 
 
 
+smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'klass'], 'Importer-Exporter');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "klass",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@klass"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"klass",{},smalltalk.MethodCategory)})},
+args: [],
+source: "klass\x0a\x09^klass",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "klass:",
+category: 'accessing',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@klass"]=aClass;
+return self}, function($ctx1) {$ctx1.fill(self,"klass:",{aClass:aClass},smalltalk.MethodCategory)})},
+args: ["aClass"],
+source: "klass: aClass\x0a\x09klass := aClass",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methods",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@methods"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
+args: [],
+source: "methods\x0a\x09^methods",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methods:",
+category: 'accessing',
+fn: function (anArray){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@methods"]=anArray;
+return self}, function($ctx1) {$ctx1.fill(self,"methods:",{anArray:anArray},smalltalk.MethodCategory)})},
+args: ["anArray"],
+source: "methods: anArray\x0a\x09methods := anArray",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@name"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
+args: [],
+source: "name\x0a\x09^name",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name:",
+category: 'accessing',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@name"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
+args: ["aString"],
+source: "name: aString\x0a\x09name := aString",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodCategory);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "name:class:methods:",
+category: 'not yet classified',
+fn: function (aString,aClass,anArray){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=self._new();
+_st($2)._name_(aString);
+_st($2)._klass_(aClass);
+_st($2)._methods_(anArray);
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"name:class:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
+args: ["aString", "aClass", "anArray"],
+source: "name: aString class: aClass methods: anArray\x0a\x09^self new\x0a\x09\x09name: aString;\x0a\x09\x09klass: aClass;\x0a\x09\x09methods: anArray;\x0a\x09\x09yourself",
+messageSends: ["name:", "new", "klass:", "methods:", "yourself"],
+referencedClasses: []
+}),
+smalltalk.MethodCategory.klass);
+
+
 smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
 smalltalk.PackageHandler.comment="I am responsible for handling package loading and committing.\x0a\x0aI should not be used directly. Instead, use the corresponding `Package` methods.";
 smalltalk.addMethod(

+ 42 - 2
st/Importer-Exporter.st

@@ -425,6 +425,46 @@ import: aStream
 									result scanFrom: parser]]]
 ! !
 
+Object subclass: #MethodCategory
+	instanceVariableNames: 'methods name klass'
+	package: 'Importer-Exporter'!
+
+!MethodCategory methodsFor: 'accessing'!
+
+klass
+	^klass
+!
+
+klass: aClass
+	klass := aClass
+!
+
+methods
+	^methods
+!
+
+methods: anArray
+	methods := anArray
+!
+
+name
+	^name
+!
+
+name: aString
+	name := aString
+! !
+
+!MethodCategory class methodsFor: 'not yet classified'!
+
+name: aString class: aClass methods: anArray
+	^self new
+		name: aString;
+		klass: aClass;
+		methods: anArray;
+		yourself
+! !
+
 InterfacingObject subclass: #PackageHandler
 	instanceVariableNames: ''
 	package: 'Importer-Exporter'!
@@ -494,8 +534,8 @@ PackageHandler subclass: #LegacyPackageHandler
 	instanceVariableNames: ''
 	package: 'Importer-Exporter'!
 !LegacyPackageHandler commentStamp!
-I am responsible for handling package loading and committing.
-
+I am responsible for handling package loading and committing.
+
 I should not be used directly. Instead, use the corresponding `Package` methods.!
 
 !LegacyPackageHandler methodsFor: 'committing'!