Smalltalk.st
branchjv
changeset 18086 33a050555eb1
parent 18085 d27c9dd72330
parent 15665 eb289b107887
child 18093 2b786a9af1d0
--- a/Smalltalk.st	Wed Aug 21 11:51:30 2013 +0100
+++ b/Smalltalk.st	Fri Aug 23 11:44:50 2013 +0100
@@ -1039,7 +1039,6 @@
     "Created: 20.6.1997 / 16:58:28 / cg"
 ! !
 
-
 !Smalltalk class methodsFor:'browsing'!
 
 browseAllCallsOn:aSelectorSymbol
@@ -5441,12 +5440,12 @@
      If silent is true, no compiler messages are output to the transcript.
      Giving nil for silent/lazy will use the current settings.
      This method can load almost anything which makes sense:
-	.st    - source files
-	.cls   - binary smalltalk bytecode files
-	.so    - binary compiled machine code class libraries
-	[.class - java bytecode -- soon to come]"
-
-    |fileNameString aStream path morePath bos|
+        .st    - source files
+        .cls   - binary smalltalk bytecode files
+        .so    - binary compiled machine code class libraries
+        [.class - java bytecode -- soon to come]"
+
+    |fileNameString inStream path morePath bos|
 
     fileNameString := aFileNameOrString asString.
 
@@ -5455,47 +5454,45 @@
     "
     (ObjectFileLoader notNil
     and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[
-	"/ LoadBinaries ifFalse:[^ false].
-	path := self getBinaryFileName:fileNameString.
-	path isNil ifTrue:[
-	    path := self getSystemFileName:fileNameString.
-	].
-	path isNil ifTrue:[^ false].
-	^ (ObjectFileLoader loadObjectFile:path) notNil
-    ].
+        "/ LoadBinaries ifFalse:[^ false].
+        path := self getBinaryFileName:fileNameString.
+        path isNil ifTrue:[
+            path := self getSystemFileName:fileNameString.
+        ].
+        path isNil ifTrue:[^ false].
+        ^ (ObjectFileLoader loadObjectFile:path) notNil
+    ].
+
+    inStream := self systemFileStreamFor:fileNameString.
+    inStream isNil ifTrue:[^ false].
 
     (fileNameString asFilename hasSuffix:'cls') ifTrue:[
-	BinaryObjectStorage notNil ifTrue:[
-	    aStream := self systemFileStreamFor:fileNameString.
-"/            path := self getBinaryFileName:fileNameString.
-"/            path isNil ifTrue:[^ false].
-"/            aStream := path asFilename readStream.
-	    aStream notNil ifTrue:[
-		aStream binary.
-		bos := BinaryObjectStorage onOld:aStream.
-		bos next.
-		bos close.
-		^ true
-	    ].
-	    ^ false
-	]
-    ].
-
-    aStream := self systemFileStreamFor:fileNameString.
-    aStream isNil ifTrue:[^ false].
+        BinaryObjectStorage notNil ifTrue:[
+            [
+                inStream binary.
+                bos := BinaryObjectStorage onOld:inStream.
+                bos next.
+            ] ensure:[
+                bos close.
+            ].
+            ^ true
+        ].
+        ^ false
+    ].
 
     (fileNameString includes:$/) ifTrue:[
-	"/ temporarily prepend the files directory
-	"/ to the searchPath.
-	"/ This allows fileIn-driver files to refer to local
-	"/ files via a relative path, and drivers to fileIn other
-	"/ drivers ...
-	morePath := aStream pathName asFilename directoryName.
-    ].
-    ^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath
-
-    "
-     Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true
+        "/ temporarily prepend the files directory
+        "/ to the searchPath.
+        "/ This allows fileIn-driver files to refer to local
+        "/ files via a relative path, and drivers to fileIn other
+        "/ drivers ...
+        morePath := inStream pathName asFilename directoryName.
+    ].
+    ^ self fileInStream:inStream lazy:lazy silent:silent logged:logged addPath:morePath
+
+    "
+     Smalltalk fileIn:'clients/TicTacToe/TicTacToe.st' lazy:true silent:true
+     Smalltalk fileIn:'keyboard.rc'
     "
 
     "Modified: / 08-09-2006 / 19:21:16 / cg"
@@ -6112,41 +6109,42 @@
 
     inStream := streamArg.
     inStream isNil ifTrue:[^ false].
+    inStream := LineNumberReadStream on:inStream.
     inStream := EncodedStream isNil
-		    ifTrue:[ inStream ]
-		    ifFalse:[ EncodedStream decodedStreamFor:inStream ].
+                    ifTrue:[ inStream ]
+                    ifFalse:[ EncodedStream decodedStreamFor:inStream ].
 
     lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy].
     silent notNil ifTrue:[wasSilent := self silentLoading:silent].
     morePath notNil ifTrue:[
-	oldSystemPath := SystemPath copy.
-	SystemPath addFirst:morePath.
-	oldRealPath := RealSystemPath.
-	RealSystemPath := nil.
+        oldSystemPath := SystemPath copy.
+        SystemPath addFirst:morePath.
+        oldRealPath := RealSystemPath.
+        RealSystemPath := nil.
     ].
     [
-	(Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[
-	    "JV: Changed to give ProgrammingLanguage to choose
-	     proper reader"
-	    (ProgrammingLanguage forStream: inStream)
-		fileInStream: inStream
-	]
+        (Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[
+            "JV: Changed to give ProgrammingLanguage to choose
+             proper reader"
+            (ProgrammingLanguage forStream: inStream)
+                fileInStream: inStream
+        ]
     ] ensure:[
-	morePath notNil ifTrue:[
-	    "take care, someone could have changed SystemPath during fileIn!!"
-	    (SystemPath copyFrom:2) = oldSystemPath ifTrue:[
-		SystemPath := oldSystemPath.
-		RealSystemPath := oldRealPath.
-	    ] ifFalse:[
-		(oldSystemPath includes:morePath) ifFalse:[
-		    SystemPath remove:morePath ifAbsent:[].
-		].
-		RealSystemPath := nil.
-	    ].
-	].
-	lazy notNil ifTrue:[Compiler compileLazy:wasLazy].
-	silent notNil ifTrue:[self silentLoading:wasSilent].
-	inStream close
+        morePath notNil ifTrue:[
+            "take care, someone could have changed SystemPath during fileIn!!"
+            (SystemPath copyFrom:2) = oldSystemPath ifTrue:[
+                SystemPath := oldSystemPath.
+                RealSystemPath := oldRealPath.
+            ] ifFalse:[
+                (oldSystemPath includes:morePath) ifFalse:[
+                    SystemPath remove:morePath ifAbsent:[].
+                ].
+                RealSystemPath := nil.
+            ].
+        ].
+        lazy notNil ifTrue:[Compiler compileLazy:wasLazy].
+        silent notNil ifTrue:[self silentLoading:wasSilent].
+        inStream close
     ].
     ^ true
 
@@ -7997,11 +7995,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1034 2013-08-10 11:24:53 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1035 2013-08-21 14:08:19 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1034 2013-08-10 11:24:53 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1035 2013-08-21 14:08:19 stefan Exp $'
 !
 
 version_HG