--- a/ChangeSet.st Sun Mar 20 11:06:10 2016 +0100
+++ b/ChangeSet.st Sun Mar 20 13:38:45 2016 +0100
@@ -790,6 +790,7 @@
"Created: / 27.10.1997 / 13:52:54 / cg"
! !
+
!ChangeSet class methodsFor:'Compatibility-VW'!
component: component definition: anObject change: changeSymbol
@@ -2616,43 +2617,104 @@
attributes := OrderedCollection new.
[
- inputStream skipSeparators.
- category := inputStream nextChunk.
- category notEmptyOrNil
+ inputStream skipSeparators.
+ category := inputStream nextChunk.
+ category notEmptyOrNil
] whileTrue:[
- ( #( 'public' 'private' ) includes: category) ifTrue:[
- attributes add:category
- ] ifFalse:[
- categories add:category
- ].
+ ( #( 'public' 'private' ) includes: category) ifTrue:[
+ attributes add:category
+ ] ifFalse:[
+ categories add:category
+ ].
+ ].
+ categories notEmpty ifTrue:[
+ categories size == 1 ifTrue:[
+ category := categories first.
+ ] ifFalse:[
+ category := categories asStringWith:' and '
+ ].
+ change := MethodCategoryChange
+ className:className
+ selector:selector
+ source:(parseTree printString)
+ category:category.
+ self addChange:change.
+ ].
+
+ attributes notEmpty ifTrue:[
+ attributes size == 1 ifTrue:[
+ "/ easy
+ (attributes first = 'public') ifTrue:[
+ "/ default anyway - ignore
+ ] ifFalse:[
+ change := MethodPrivacyChange
+ className:className
+ selector:selector
+ privacy:(attributes first asSymbol).
+ change nameSpaceOverride:nameSpaceOverride.
+ change source:(parseTree printString).
+ self addChange:change.
+ ].
+ ] ifFalse:[
+ self halt:'multiple/missing attributes not supported'.
+ ].
].
- categories size == 1 ifTrue:[
- "/ easy
- change := MethodCategoryChange
- className:className
- selector:selector
- source:(parseTree printString)
- category:(categories first).
- self addChange:change.
- ] ifFalse:[
- self halt:'multiple/missing categories not supported'.
+ ^ true
+
+ "Modified: / 11-06-2013 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+handleCategoriesForClassChange
+ |category categories attributes change|
+
+ className := self receiversClassNameRememberingNamespace.
+
+ categories := OrderedCollection new.
+ attributes := OrderedCollection new.
+
+ [
+ inputStream skipSeparators.
+ category := inputStream nextChunk.
+ category notEmptyOrNil
+ ] whileTrue:[
+ ( #( 'public' 'private' ) includes: category) ifTrue:[
+ attributes add:category
+ ] ifFalse:[
+ categories add:category
+ ].
].
- attributes size == 1 ifTrue:[
- "/ easy
- (attributes first = 'public') ifTrue:[
- "/ default anyway - ignore
- ] ifFalse:[
- change := MethodPrivacyChange
- className:className
- selector:selector
- privacy:(attributes first asSymbol).
- change nameSpaceOverride:nameSpaceOverride.
- change source:(parseTree printString).
- self addChange:change.
- ].
- ] ifFalse:[
- self halt:'multiple/missing attributes not supported'.
+ categories notEmpty ifTrue:[
+ categories size == 1 ifTrue:[
+ "/ easy
+ category := categories first
+ ] ifFalse:[
+ category := categories asStringWith:' and '
+ ].
+ change := ClassCategoryChange new
+ className:className
+ category:category.
+ self addChange:change.
+ ].
+
+ attributes notEmpty ifTrue:[
+ attributes size == 1 ifTrue:[
+ "/ easy
+ (attributes first = 'public') ifTrue:[
+ "/ default anyway - ignore
+ ] ifFalse:[
+ "/ a private class!!
+"/ change := ClassDefinitionChange
+"/ className:className
+"/ selector:selector
+"/ privacy:(attributes first asSymbol).
+"/ change nameSpaceOverride:nameSpaceOverride.
+"/ change source:(parseTree printString).
+"/ self addChange:change.
+ ].
+ ] ifFalse:[
+ self halt:'multiple/missing attributes not supported'.
+ ].
].
^ true
@@ -3188,24 +3250,6 @@
^ self handleClassInstanceVariableDefinitionChange.
!
-process_methods
- "'methods' chunk (ST/V and dolphin)"
-
- ^ self handleMethodChange.
-!
-
-process_methodsFor
- "'methodsFor' chunk (ST/V and dolphin)"
-
- ^ self handleMethodChange.
-!
-
-process_methodsFor_
- "'methodsFor:' chunk (ST/80, Squeak, ST/X, VW, ...)"
-
- ^ self handleMethodChange.
-!
-
process_name_
"'name:' chunk (ST/X)"
@@ -3405,18 +3449,42 @@
!ChangeSet::ChangeFileReader methodsFor:'reading-private-dolphin'!
+process_categoriesForClass
+ "'categoriesForClass' chunk (Dolphin)"
+
+ ^ self handleCategoriesForClassChange.
+!
+
process_categoriesFor_
"'categoriesFor:' chunk (Dolphin)"
^ self handleCategoriesForChange.
!
+process_methods
+ "'methods' chunk (ST/V and dolphin)"
+
+ ^ self handleMethodChange.
+!
+
+process_methodsFor
+ "'methodsFor' chunk (ST/V and dolphin)"
+
+ ^ self handleMethodChange.
+!
+
process_methodsForUndefined_
"'methodsForUndefined:' chunk (?)"
^ self handleMethodChange.
!
+process_methodsFor_
+ "'methodsFor:' chunk (ST/80, Squeak, ST/X, VW, ...)"
+
+ ^ self handleMethodChange.
+!
+
process_publicMethods
"'publicMethods' chunk (ST/V and dolphin)"