--- a/ChangeSet.st Sun Apr 19 21:30:23 2015 +0100
+++ b/ChangeSet.st Mon Apr 20 06:40:30 2015 +0200
@@ -721,23 +721,23 @@
fromStream:aStream while:aConditionBlock
"build a changeSet from a stream, containing chunks.
(i.e. either a classes sourceFile or a change-file).
- Pass each change to the conditionBlock and stop whenever that
- returns false. This allows skipping reamaining chunks, and speeding up
- reading, if only parts need to be extracted
+ Pass each change to the conditionBlock and stop whenever that returns false.
+ This allows skipping reamaining chunks,
+ and thus speeding up reading, if only parts need to be extracted
(for example: only documentation methods).
- Return the changeSet."
+ Returns the changeSet."
|changeSet|
changeSet := self new.
self
- changesFromStream:aStream
- for:changeSet
- reader:(ChangeFileReader new)
- do:[:aChange :lineNumberOrNil :posOrNil |
- changeSet add:aChange.
- (aConditionBlock value:aChange) ifFalse:[^ changeSet].
- ].
+ changesFromStream:aStream
+ for:changeSet
+ reader:(ChangeFileReader new)
+ do:[:aChange :lineNumberOrNil :posOrNil |
+ (aConditionBlock value:aChange) ifFalse:[^ changeSet].
+ changeSet add:aChange.
+ ].
^ changeSet
@@ -3721,68 +3721,70 @@
topClassName := nil.
"Pass 1 - collect classes"
changeSetBeingSaved do:[:change|
- | pkg |
- pkg := change package.
- packageName isNil ifTrue:[
- packageName := pkg.
- ] ifFalse:[
- "/Just a defensive check...
- self assert: (pkg isNil or:[pkg = packageName]) description: 'STC does not support multiple packages in source files'.
- ].
-
- change isClassDefinitionChange ifTrue:[
- | nm ns |
-
-
-
- nm := change className.
- (nm endsWith:' class') ifFalse:[
- (classInfos includesKey: nm) ifTrue:[
- self error:'Multiple definitions of class ', nm.
- ^self.
- ].
- classInfos at: nm put: (ClassInfo new name: nm).
- metaInfos at: nm put: (ClassInfo new name: nm , ' class').
- change isPrivateClassDefinitionChange ifFalse:[
- topClassName notNil ifTrue:[
- self error: ('Multiple top class definitions (%1 vs %2)' bindWith: topClassName with: nm).
- ^self.
- ].
- topClassName := nm.
- namespaceName := change nameSpaceName.
-
- ]
- ]
- ]
+ | pkg |
+ pkg := change package.
+ packageName isNil ifTrue:[
+ packageName := pkg.
+ ] ifFalse:[
+ "/Just a defensive check...
+ self assert: (pkg isNil or:[pkg = packageName]) description: 'STC does not support multiple packages in source files'.
+ ].
+
+ change isClassDefinitionChange ifTrue:[
+ | nm ns |
+
+
+
+ nm := change className.
+ (nm endsWith:' class') ifFalse:[
+ (classInfos includesKey: nm) ifTrue:[
+ self error:'Multiple definitions of class ', nm.
+ ^self.
+ ].
+ classInfos at: nm put: (ClassInfo new name: nm).
+ metaInfos at: nm put: (ClassInfo new name: nm , ' class').
+ change isPrivateClassDefinitionChange ifFalse:[
+ topClassName notNil ifTrue:[
+ self error: ('Multiple top class definitions (%1 vs %2)' bindWith: topClassName with: nm).
+ ^self.
+ ].
+ topClassName := nm.
+ namespaceName := change nameSpaceName.
+
+ ]
+ ]
+ ]
].
"/ Could be an extension container...
topClassName isNil ifTrue:[
- ^self
+ ^self
].
"Pass 2: fill in infos"
changeSetBeingSaved do:[:change|
- change isClassChange ifTrue:[
- | nm info |
-
- nm := change className.
- (nm endsWith: ' class') ifTrue:[
- info := metaInfos at: (nm copyButLast:(' class' size)).
- ] ifFalse:[
- info := classInfos at: nm.
- "Fill superclass info..."
- change isClassDefinitionChange ifTrue:[
- | superNm |
- superNm := change superClassName.
- (classInfos includesKey: superNm) ifTrue:[
- info superclass: (classInfos at: superNm).
- (metaInfos at: nm) superclass: (classInfos at: superNm).
- ].
- ].
- ].
- info addChange: change.
- ]
+ change isClassChange ifTrue:[
+ | nm info |
+
+ nm := change className.
+ (nm endsWith: ' class') ifTrue:[
+ info := metaInfos at: (nm copyButLast:(' class' size)).
+ ] ifFalse:[
+ info := classInfos at: nm.
+ "Fill superclass info..."
+ change isClassDefinitionChange ifTrue:[
+ | superNm |
+ superNm := change superClassName.
+ superNm notNil ifTrue:[
+ (classInfos includesKey: superNm) ifTrue:[
+ info superclass: (classInfos at: superNm).
+ (metaInfos at: nm) superclass: (classInfos at: superNm).
+ ].
+ ].
+ ].
+ ].
+ info addChange: change.
+ ]
].
classInfos do:[:info|info namespace: namespaceName].
@@ -3790,10 +3792,10 @@
"
- ChangeSet::ClassSourceWriter new
- changeSetBeingSaved: (ChangeSet forExistingClass: ChangeSet);
- analyze;
- yourself
+ ChangeSet::ClassSourceWriter new
+ changeSetBeingSaved: (ChangeSet forExistingClass: ChangeSet);
+ analyze;
+ yourself
"
@@ -4336,7 +4338,7 @@
!
version_SVN
- ^ '$Id: ChangeSet.st,v 1.261 2015-04-14 11:04:58 cg Exp $'
+ ^ '$Id: ChangeSet.st,v 1.262 2015-04-19 22:29:09 cg Exp $'
! !
!ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'instance creation'!
@@ -5016,11 +5018,11 @@
!ChangeSet class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.261 2015-04-14 11:04:58 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.262 2015-04-19 22:29:09 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.261 2015-04-14 11:04:58 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.262 2015-04-19 22:29:09 cg Exp $'
!
version_HG
@@ -5029,6 +5031,6 @@
!
version_SVN
- ^ '$Id: ChangeSet.st,v 1.261 2015-04-14 11:04:58 cg Exp $'
+ ^ '$Id: ChangeSet.st,v 1.262 2015-04-19 22:29:09 cg Exp $'
! !