Jan's changes
authorvrany
Tue, 28 Jun 2011 22:46:36 +0200
changeset 2368 7e64ab6633f9
parent 2367 cdf165ed6951
child 2369 ffbd3aa42d28
Jan's changes
ClassDefinitionChange.st
--- a/ClassDefinitionChange.st	Tue Jun 28 22:39:28 2011 +0200
+++ b/ClassDefinitionChange.st	Tue Jun 28 22:46:36 2011 +0200
@@ -82,6 +82,16 @@
     classVariableNames := something.
 !
 
+delta
+
+    | class |
+    class := self changeClass.
+    class ifNil:[^#+].
+    ^(self class isSource: self source sameSourceAs: class definition)
+        ifTrue:[#=]
+        ifFalse:[#~]
+!
+
 instanceVariableNames
     ^ instanceVariableNames
 !
@@ -218,11 +228,29 @@
 !ClassDefinitionChange methodsFor:'applying'!
 
 apply
+
+    superClassName ifNil:[self setupFromSource].
+    superClassName ifNil:[self error: 'Should not happen'].
+    (Smalltalk hasClassNamed: superClassName) ifFalse:
+        [Class undeclared: superClassName].
+
     Parser evaluate:(self source).
 
     package notNil ifTrue:[
         self changeClass setPackage:package.
     ].
+
+    "
+        (ClassDefinitionChange className: #TestB source: 'TestA subclass: #TestB
+            instanceVariableNames:''''
+            classVariableNames:''''
+            poolDictionaries:''''
+            category:''* remove me *''')
+            apply
+
+    "
+
+    "Modified: / 08-11-2010 / 16:10:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ClassDefinitionChange methodsFor:'comparing'!
@@ -252,6 +280,7 @@
 
 ! !
 
+
 !ClassDefinitionChange methodsFor:'printing & storing'!
 
 definitionString
@@ -276,7 +305,7 @@
         stream 
             nextPutAll:self superClassNameWithoutMyNamespace;
             nextPutAll:' subclass:';
-            nextPutAll:"self" className asSymbol storeString
+            nextPutAll: self classNameWithoutNamespace asSymbol storeString
             ;
             cr;
             spaces:4;
@@ -457,18 +486,21 @@
         catIdx ~~ 0 ifTrue:[
             category := (parseTree args at:catIdx) evaluate.
         ].
+
+        superClassName := parseTree receiver name.
     ].
 
     "Created: / 11-10-2006 / 14:10:02 / cg"
     "Modified: / 26-10-2006 / 19:29:17 / cg"
+    "Modified: / 08-11-2010 / 13:47:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ClassDefinitionChange class methodsFor:'documentation'!
 
-version
-    ^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.55 2011-01-29 12:02:29 cg Exp $'
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.56 2011-06-28 20:46:36 vrany Exp $'
 !
 
-version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.55 2011-01-29 12:02:29 cg Exp $'
+version_SVN
+    ^ ' Id: ClassDefinitionChange.st 1867 2011-06-08 21:57:08Z vranyj1  '
 ! !