Browse Source

Tabs are now emitted in class definitions.

Herbert Vojčík 11 years ago
parent
commit
e9f6faee1d

+ 5 - 3
js/Importer-Exporter.deploy.js

@@ -351,7 +351,8 @@ $1=aStream;
 _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
 _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
 _st($1)._lf();
-$2=_st($1)._nextPutAll_(" instanceVariableNames: '");
+_st($1)._tab();
+$2=_st($1)._nextPutAll_("instanceVariableNames: '");
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
@@ -360,7 +361,8 @@ return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(
 $3=aStream;
 _st($3)._nextPutAll_("'");
 _st($3)._lf();
-_st($3)._nextPutAll_(_st(_st(" package: '").__comma(_st(aClass)._category())).__comma("'!"));
+_st($3)._tab();
+_st($3)._nextPutAll_(_st(_st("package: '").__comma(_st(aClass)._category())).__comma("'!"));
 $4=_st($3)._lf();
 $5=_st(_st(aClass)._comment())._notEmpty();
 if(smalltalk.assert($5)){
@@ -373,7 +375,7 @@ $7;
 };
 _st(aStream)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.ChunkExporter)})},
-messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"]}),
+messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "tab", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"]}),
 smalltalk.ChunkExporter);
 
 smalltalk.addMethod(

+ 6 - 4
js/Importer-Exporter.js

@@ -427,7 +427,8 @@ $1=aStream;
 _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
 _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
 _st($1)._lf();
-$2=_st($1)._nextPutAll_(" instanceVariableNames: '");
+_st($1)._tab();
+$2=_st($1)._nextPutAll_("instanceVariableNames: '");
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
@@ -436,7 +437,8 @@ return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(
 $3=aStream;
 _st($3)._nextPutAll_("'");
 _st($3)._lf();
-_st($3)._nextPutAll_(_st(_st(" package: '").__comma(_st(aClass)._category())).__comma("'!"));
+_st($3)._tab();
+_st($3)._nextPutAll_(_st(_st("package: '").__comma(_st(aClass)._category())).__comma("'!"));
 $4=_st($3)._lf();
 $5=_st(_st(aClass)._comment())._notEmpty();
 if(smalltalk.assert($5)){
@@ -450,8 +452,8 @@ $7;
 _st(aStream)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.ChunkExporter)})},
 args: ["aClass", "aStream"],
-source: "exportDefinitionOf: aClass on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream\x0a\x09\x09nextPutAll: (self classNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;\x0a\x09\x09nextPutAll: ' instanceVariableNames: '''.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [:each | aStream nextPutAll: each]\x0a\x09\x09separatedBy: [aStream nextPutAll: ' '].\x0a\x09aStream\x0a\x09\x09nextPutAll: ''''; lf;\x0a\x09\x09nextPutAll: ' package: ''', aClass category, '''!'; lf.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aClass), ' commentStamp!';lf;\x0a\x09\x09nextPutAll: (self chunkEscape: aClass comment), '!';lf].\x0a\x09aStream lf",
-messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"],
+source: "exportDefinitionOf: aClass on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream\x0a\x09\x09nextPutAll: (self classNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;\x0a\x09\x09tab; nextPutAll: 'instanceVariableNames: '''.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [:each | aStream nextPutAll: each]\x0a\x09\x09separatedBy: [aStream nextPutAll: ' '].\x0a\x09aStream\x0a\x09\x09nextPutAll: ''''; lf;\x0a\x09\x09tab; nextPutAll: 'package: ''', aClass category, '''!'; lf.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aClass), ' commentStamp!';lf;\x0a\x09\x09nextPutAll: (self chunkEscape: aClass comment), '!';lf].\x0a\x09aStream lf",
+messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "tab", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"],
 referencedClasses: []
 }),
 smalltalk.ChunkExporter);

+ 13 - 0
js/Kernel-Collections.deploy.js

@@ -4212,5 +4212,18 @@ return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.StringStream
 messageSends: ["nextPut:"]}),
 smalltalk.StringStream);
 
+smalltalk.addMethod(
+"_tab",
+smalltalk.method({
+selector: "tab",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._tab());
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
+messageSends: ["nextPutAll:", "tab"]}),
+smalltalk.StringStream);
+
 
 

+ 18 - 0
js/Kernel-Collections.js

@@ -5712,5 +5712,23 @@ referencedClasses: []
 }),
 smalltalk.StringStream);
 
+smalltalk.addMethod(
+"_tab",
+smalltalk.method({
+selector: "tab",
+category: 'writing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._tab());
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
+args: [],
+source: "tab\x0a\x09^self nextPutAll: String tab\x0a",
+messageSends: ["nextPutAll:", "tab"],
+referencedClasses: ["String"]
+}),
+smalltalk.StringStream);
+
 
 

+ 2 - 2
st/Importer-Exporter.st

@@ -198,13 +198,13 @@ exportDefinitionOf: aClass on: aStream
 	aStream
 		nextPutAll: (self classNameFor: aClass superclass);
 		nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;
-		nextPutAll: ' instanceVariableNames: '''.
+		tab; nextPutAll: 'instanceVariableNames: '''.
 	aClass instanceVariableNames
 		do: [:each | aStream nextPutAll: each]
 		separatedBy: [aStream nextPutAll: ' '].
 	aStream
 		nextPutAll: ''''; lf;
-		nextPutAll: ' package: ''', aClass category, '''!!'; lf.
+		tab; nextPutAll: 'package: ''', aClass category, '''!!'; lf.
 	aClass comment notEmpty ifTrue: [
 		aStream
 		nextPutAll: '!!', (self classNameFor: aClass), ' commentStamp!!';lf;

+ 4 - 0
st/Kernel-Collections.st

@@ -1889,5 +1889,9 @@ nextPutAll: aString
 
 space
 	self nextPut: ' '
+!
+
+tab
+	^self nextPutAll: String tab
 ! !