Smalltalk.st
changeset 11655 4306fb61b9f8
parent 11624 c1ed76416b0a
child 11667 4994ddb5ed2f
equal deleted inserted replaced
11654:9dd403ddfb91 11655:4306fb61b9f8
  3746     newStream := 'src.tmp' asFilename writeStream.
  3746     newStream := 'src.tmp' asFilename writeStream.
  3747 
  3747 
  3748     table := IdentityDictionary new:100.
  3748     table := IdentityDictionary new:100.
  3749 
  3749 
  3750     Method allSubInstancesDo:[:aMethod |
  3750     Method allSubInstancesDo:[:aMethod |
  3751 	source := nil.
  3751         source := nil.
  3752 	aMethod sourcePosition notNil ifTrue:[
  3752         aMethod sourcePosition notNil ifTrue:[
  3753 	    aMethod sourceFilename = 'st.src' ifTrue:[
  3753             aMethod sourceFilename = 'st.src' ifTrue:[
  3754 		source := aMethod source.
  3754                 source := aMethod source.
  3755 	    ]
  3755             ]
  3756 	] ifFalse:[
  3756         ] ifFalse:[
  3757 	    source := aMethod source
  3757             source := aMethod source
  3758 	].
  3758         ].
  3759 
  3759 
  3760 	source notNil ifTrue:[
  3760         source notNil ifTrue:[
  3761 	    pos := newStream position1Based.
  3761             pos := newStream position1Based.
  3762 	    newStream nextChunkPut:source.
  3762             newStream nextChunkPut:source.
  3763 
  3763 
  3764 	    "
  3764             "
  3765 	     dont change the methods info - maybe some write error
  3765              dont change the methods info - maybe some write error
  3766 	     occurs later, in that case we abort and leave everything
  3766              occurs later, in that case we abort and leave everything
  3767 	     untouched.
  3767              untouched.
  3768 	    "
  3768             "
  3769 	    table at:aMethod put:pos
  3769             table at:aMethod put:pos
  3770 	]
  3770         ]
  3771     ].
  3771     ].
  3772 
  3772 
  3773     newStream close.
  3773     newStream syncData; close.
  3774 
  3774 
  3775     "
  3775     "
  3776      now, rename the new source file,
  3776      now, rename the new source file,
  3777     "
  3777     "
  3778     fileName := (ObjectMemory nameForSources).
  3778     fileName := (ObjectMemory nameForSources).
  3780 
  3780 
  3781     "good - now go over all changed methods, and change their
  3781     "good - now go over all changed methods, and change their
  3782      source reference"
  3782      source reference"
  3783 
  3783 
  3784     table keysAndValuesDo:[:aMethod :pos |
  3784     table keysAndValuesDo:[:aMethod :pos |
  3785 	aMethod localSourceFilename:fileName position:pos.
  3785         aMethod localSourceFilename:fileName position:pos.
  3786 "/        aMethod printCR.
  3786 "/        aMethod printCR.
  3787     ].
  3787     ].
  3788 
  3788 
  3789     "
  3789     "
  3790      Smalltalk compressSources
  3790      Smalltalk compressSources
  3808     newStream := 'src.tmp' asFilename writeStream.
  3808     newStream := 'src.tmp' asFilename writeStream.
  3809 
  3809 
  3810     table := IdentityDictionary new:100.
  3810     table := IdentityDictionary new:100.
  3811 
  3811 
  3812     Method allSubInstancesDo:[:aMethod |
  3812     Method allSubInstancesDo:[:aMethod |
  3813 	source := aMethod source.
  3813         source := aMethod source.
  3814 	source notNil ifTrue:[
  3814         source notNil ifTrue:[
  3815 	    pos := newStream position1Based.
  3815             pos := newStream position1Based.
  3816 	    newStream nextChunkPut:source.
  3816             newStream nextChunkPut:source.
  3817 
  3817 
  3818 	    "
  3818             "
  3819 	     dont change the methods info - maybe some write error
  3819              dont change the methods info - maybe some write error
  3820 	     occurs later, in that case we abort and leave everything
  3820              occurs later, in that case we abort and leave everything
  3821 	     untouched.
  3821              untouched.
  3822 	    "
  3822             "
  3823 	    table at:aMethod put:pos
  3823             table at:aMethod put:pos
  3824 	]
  3824         ]
  3825     ].
  3825     ].
  3826 
  3826 
  3827     newStream close.
  3827     newStream syncData; close.
  3828 
  3828 
  3829     "
  3829     "
  3830      now, rename the new source file,
  3830      now, rename the new source file,
  3831     "
  3831     "
  3832     fileName := (ObjectMemory nameForSources).
  3832     fileName := (ObjectMemory nameForSources).
  3834 
  3834 
  3835     "good - now go over all changed methods, and change their
  3835     "good - now go over all changed methods, and change their
  3836      source reference"
  3836      source reference"
  3837 
  3837 
  3838     table keysAndValuesDo:[:aMethod :pos |
  3838     table keysAndValuesDo:[:aMethod :pos |
  3839 	aMethod localSourceFilename:fileName position:pos.
  3839         aMethod localSourceFilename:fileName position:pos.
  3840 "/        aMethod printCR.
  3840 "/        aMethod printCR.
  3841     ].
  3841     ].
  3842 
  3842 
  3843     "
  3843     "
  3844      Smalltalk generateSingleSourceFile
  3844      Smalltalk generateSingleSourceFile
  7172 ! !
  7172 ! !
  7173 
  7173 
  7174 !Smalltalk class methodsFor:'documentation'!
  7174 !Smalltalk class methodsFor:'documentation'!
  7175 
  7175 
  7176 version
  7176 version
  7177     ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.872 2009-03-10 13:36:15 cg Exp $'
  7177     ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.873 2009-03-23 19:50:06 stefan Exp $'
  7178 ! !
  7178 ! !