SmalltalkChunkFileSourceWriter.st
branchjv
changeset 17845 7e0cfaac936d
parent 17841 7abcc4aef871
child 17846 24edc476ac18
equal deleted inserted replaced
17844:29a1536dffe4 17845:7e0cfaac936d
   119 
   119 
   120             versionMethods do:[:versionMethod |
   120             versionMethods do:[:versionMethod |
   121                 |source|
   121                 |source|
   122 
   122 
   123                 source := versionMethod source.
   123                 source := versionMethod source.
   124                 (source isEmptyOrNil or:[(source startsWith:nonMeta nameOfVersionMethod) not]) ifTrue:[
   124                 (source isEmptyOrNil or:[(source startsWith:nonMeta nameOfOldVersionMethod) not]) ifTrue:[
   125                     "something bad happend to the classes code"
   125                     "something bad happend to the classes code"
   126 
   126 
   127                     Class fileOutErrorSignal 
   127                     Class fileOutErrorSignal 
   128                         raiseRequestWith:aClass
   128                         raiseRequestWith:aClass
   129                         errorString:' - bad source for version method (uncompiled class file?): ', (versionMethod displayString)
   129                         errorString:' - bad source for version method (uncompiled class file?): ', (versionMethod displayString)
   292 
   292 
   293     |sortedSelectors first prevPrivacy privacy interestingMethods cat|
   293     |sortedSelectors first prevPrivacy privacy interestingMethods cat|
   294 
   294 
   295     interestingMethods := OrderedCollection new.
   295     interestingMethods := OrderedCollection new.
   296     aClass methodsDo:[:aMethod |
   296     aClass methodsDo:[:aMethod |
   297         |method wanted|
   297         |wanted|
   298         wanted := false.
   298 
   299         method := aMethod.
   299         (methodsAlreadySaved includes:aMethod) ifFalse:[
   300         "Check all overridden methods as well"
   300             (aCategory = aMethod category) ifTrue:[
   301         [ wanted not and:[method notNil]]
   301                 (methodFilter isNil or:[methodFilter value:aMethod]) ifTrue:[
   302             whileTrue:[
       
   303         (methodsAlreadySaved includes:method) ifFalse:[
       
   304             (aCategory = method category) ifTrue:[
       
   305                 (methodFilter isNil or:[methodFilter value:method]) ifTrue:[
       
   306                     skippedMethods notNil ifTrue:[
   302                     skippedMethods notNil ifTrue:[
   307                         wanted := (skippedMethods includesIdentical:method) not
   303                         wanted := (skippedMethods includesIdentical:aMethod) not
   308                     ] ifFalse:[
   304                     ] ifFalse:[
   309                         wanted := savedMethods isNil or:[ savedMethods includesIdentical:method ].
   305                         wanted := savedMethods isNil or:[ savedMethods includesIdentical:aMethod ].
   310                     ].
   306                     ].
   311                     wanted ifTrue:[
   307                     wanted ifTrue:[
   312                         "JV@2010-07-01: Changed to support selector/language namespaces"
   308                         aMethod selector isSymbol ifTrue:[
   313                         "Namespaced methods are stored in class under string selector"
   309                             interestingMethods add:aMethod
   314                         (method selector isSymbol or:[method nameSpace notNil]) ifTrue:[
       
   315                             interestingMethods add:method
       
   316                         ] ifFalse:[
   310                         ] ifFalse:[
   317                             Transcript showCR:'skipping non-symbol method ',method selector.
   311                             Transcript showCR:'skipping non-symbol method ',aMethod selector.
   318                         ].
   312                         ].
   319                     ].
   313                     ].
   320                 ]
   314                 ]
   321             ]
   315             ]
   322         ].
   316         ]
   323         method := method overriddenMethod.
       
   324         ].
       
   325     ].
   317     ].
   326     interestingMethods notEmpty ifTrue:[
   318     interestingMethods notEmpty ifTrue:[
   327         first := true.
   319         first := true.
   328         prevPrivacy := nil.
   320         prevPrivacy := nil.
   329 
   321 
   367         aStream space.
   359         aStream space.
   368         aStream nextPutChunkSeparator.
   360         aStream nextPutChunkSeparator.
   369         aStream cr
   361         aStream cr
   370     ]
   362     ]
   371 
   363 
   372     "Modified: / 28-08-1995 / 14:30:41 / claus"
   364     "Modified: 28.8.1995 / 14:30:41 / claus"
   373     "Modified: / 15-11-1996 / 11:32:21 / cg"
   365     "Modified: 12.6.1996 / 11:37:33 / stefan"
   374     "Created: / 01-04-1997 / 16:04:33 / stefan"
   366     "Modified: 15.11.1996 / 11:32:21 / cg"
   375     "Modified: / 21-08-2009 / 23:57:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
   367     "Created: 1.4.1997 / 16:04:33 / stefan"
   376     "Modified: / 01-07-2010 / 21:45:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   377 !
   368 !
   378 
   369 
   379 fileOutCategory:aCategory of:aClass methodFilter:methodFilter on:aStream
   370 fileOutCategory:aCategory of:aClass methodFilter:methodFilter on:aStream
   380     "file out all methods belonging to aCategory, aString onto aStream"
   371     "file out all methods belonging to aCategory, aString onto aStream"
   381 
   372 
   393 fileOutCommentLine:aString on:aStream
   384 fileOutCommentLine:aString on:aStream
   394     "Writes a single line of comment on a comment to a stream."
   385     "Writes a single line of comment on a comment to a stream."
   395 
   386 
   396     aStream 
   387     aStream 
   397         nextPutAll:'"/ ';
   388         nextPutAll:'"/ ';
   398         nextPutAll: aString.
   389         nextPutAll: aString
   399 
       
   400     "Modified: / 14-02-2010 / 10:24:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   401 !
   390 !
   402 
   391 
   403 fileOutCommentStartOn:aStream
   392 fileOutCommentStartOn:aStream
   404     "Writes a comment start mark on aStream."
   393     "Writes a comment start mark on aStream."
   405 
   394 
   502     ].
   491     ].
   503 ! !
   492 ! !
   504 
   493 
   505 !SmalltalkChunkFileSourceWriter class methodsFor:'documentation'!
   494 !SmalltalkChunkFileSourceWriter class methodsFor:'documentation'!
   506 
   495 
   507 version
       
   508     ^ '$Id: SmalltalkChunkFileSourceWriter.st 10643 2011-06-08 21:53:07Z vranyj1 $'
       
   509 !
       
   510 
       
   511 version_CVS
   496 version_CVS
   512     ^ 'Header: /cvs/stx/stx/libbasic/SmalltalkChunkFileSourceWriter.st,v 1.12 2009/10/02 14:30:07 cg Exp '
   497     ^ '§Header: /cvs/stx/stx/libbasic/SmalltalkChunkFileSourceWriter.st,v 1.14 2011/06/29 14:12:59 cg Exp §'
   513 !
   498 !
   514 
   499 
   515 version_SVN
   500 version_SVN
   516     ^ '$Id: SmalltalkChunkFileSourceWriter.st 10643 2011-06-08 21:53:07Z vranyj1 $'
   501     ^ '$ Id: SmalltalkChunkFileSourceWriter.st 10643 2011-06-08 21:53:07Z vranyj1  $'
   517 ! !
   502 ! !
   518 
       
   519 
       
   520 
       
   521 
       
   522