author | Stefan Vogel <sv@exept.de> |
Sun, 22 Aug 2004 19:58:15 +0200 | |
changeset 8485 | d94728eaf4f0 |
parent 8443 | 7bc4348c059e |
child 8714 | b93862ab1caa |
permissions | -rw-r--r-- |
58 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
379 | 3 |
All Rights Reserved |
58 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
5394 | 13 |
"{ Package: 'stx:libbasic' }" |
14 |
||
58 | 15 |
Stream subclass:#PeekableStream |
1295 | 16 |
instanceVariableNames:'' |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
17 |
classVariableNames:'ErrorDuringFileInSignal CurrentFileInDirectoryQuerySignal' |
1295 | 18 |
poolDictionaries:'' |
19 |
category:'Streams' |
|
58 | 20 |
! |
21 |
||
88 | 22 |
!PeekableStream class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
379 | 27 |
All Rights Reserved |
58 | 28 |
|
88 | 29 |
This software is furnished under a license and may be used |
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
58 | 37 |
|
88 | 38 |
documentation |
39 |
" |
|
40 |
abstract superclass for all Stream which support read-ahead |
|
41 |
(i.e. peeking) of one element. |
|
42 |
Concrete subclasses must implement a peek method. |
|
1295 | 43 |
|
44 |
[author:] |
|
45 |
Claus Gittinger |
|
88 | 46 |
" |
47 |
! ! |
|
58 | 48 |
|
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
49 |
!PeekableStream class methodsFor:'initialization'! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
50 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
51 |
initialize |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
52 |
"setup the signal used to handle errors during fileIn" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
53 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
54 |
ErrorDuringFileInSignal isNil ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
55 |
ErrorDuringFileInSignal := Error newSignalMayProceed:true. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
56 |
ErrorDuringFileInSignal nameClass:self message:#errorDuringFileInSignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
57 |
ErrorDuringFileInSignal notifierString:'error during fileIn'. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
58 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
59 |
CurrentFileInDirectoryQuerySignal := QuerySignal new. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
60 |
CurrentFileInDirectoryQuerySignal nameClass:self message:#currentFileInDirectoryQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
61 |
CurrentFileInDirectoryQuerySignal notifierString:'query for current directory when filing in'. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
62 |
CurrentFileInDirectoryQuerySignal handlerBlock:[:ex | ex proceedWith:Filename currentDirectory]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
63 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
64 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
65 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
66 |
self initialize |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
67 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
68 |
! ! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
69 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
70 |
!PeekableStream class methodsFor:'Signal constants'! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
71 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
72 |
currentFileInDirectoryQuerySignal |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
73 |
"return the querySignal, which can be used to ask for the current directory |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
74 |
during a fileIn (that is the directory where the filed-in file resides), |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
75 |
and in a fileBrowsers doIt. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
76 |
Using this, allows for the loaded code or doIts to ask for the fileBrowsers |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
77 |
current directory, by asking this querySignal (which is nice sometimes)." |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
78 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
79 |
^ CurrentFileInDirectoryQuerySignal |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
80 |
! ! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
81 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
82 |
!PeekableStream class methodsFor:'queries'! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
83 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
84 |
currentFileInDirectory |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
85 |
"during a fileIn (if a script), the script can ask for the current directory" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
86 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
87 |
^ CurrentFileInDirectoryQuerySignal query |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
88 |
! ! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
89 |
|
5394 | 90 |
!PeekableStream methodsFor:'chunk input/output'! |
91 |
||
92 |
nextChunk |
|
93 |
"return the next chunk, i.e. all characters up to the next |
|
94 |
exclamation mark. Within the chunk, exclamation marks have to be doubled, |
|
95 |
they are undoubled here. |
|
96 |
Except for primitive code, in which doubling is not needed (allowed). |
|
97 |
This exception was added to make it easier to edit primitive code with |
|
98 |
external editors. However, this means, that other Smalltalks cannot always |
|
99 |
read chunks containing primitive code |
|
100 |
- but that doesnt really matter, since C-primitives are an ST/X feature anyway." |
|
101 |
||
102 |
|theString sep newString done thisChar nextChar inPrimitive |
|
103 |
index "{ Class:SmallInteger }" |
|
104 |
currSize "{ Class:SmallInteger }" | |
|
105 |
||
106 |
sep := ChunkSeparator. |
|
107 |
theString := String new:500. |
|
108 |
currSize := 500. |
|
109 |
thisChar := self skipSeparators. |
|
110 |
thisChar := self next. |
|
111 |
index := 0. |
|
112 |
done := false. |
|
113 |
inPrimitive := false. |
|
114 |
||
115 |
[done] whileFalse:[ |
|
8192 | 116 |
((index + 2) <= currSize) ifFalse:[ |
117 |
newString := String new:(currSize * 2). |
|
118 |
newString replaceFrom:1 to:currSize with:theString. |
|
119 |
currSize := currSize * 2. |
|
120 |
theString := newString |
|
121 |
]. |
|
122 |
thisChar isNil ifTrue:[ |
|
123 |
done := true |
|
124 |
] ifFalse:[ |
|
125 |
(thisChar == $% ) ifTrue:[ |
|
126 |
nextChar := self peek. |
|
127 |
(nextChar == ${ ) ifTrue:[ |
|
128 |
inPrimitive := true. |
|
129 |
index := index + 1. |
|
130 |
theString at:index put:thisChar. |
|
131 |
thisChar := self next |
|
132 |
] ifFalse:[ |
|
133 |
(nextChar == $} ) ifTrue:[ |
|
134 |
inPrimitive := false. |
|
135 |
index := index + 1. |
|
136 |
theString at:index put:thisChar. |
|
137 |
thisChar := self next |
|
138 |
] |
|
139 |
] |
|
140 |
] ifFalse:[ |
|
141 |
inPrimitive ifFalse:[ |
|
142 |
(thisChar == sep) ifTrue:[ |
|
143 |
(self peek == sep) ifFalse:[ |
|
144 |
done := true |
|
145 |
] ifTrue:[ |
|
146 |
self next |
|
147 |
] |
|
148 |
] |
|
149 |
] |
|
150 |
] |
|
151 |
]. |
|
152 |
done ifFalse:[ |
|
153 |
index := index + 1. |
|
154 |
"/ thisChar == Character return ifTrue:[ |
|
155 |
"/ self peekOrNil == Character lf ifTrue:[ |
|
156 |
"/ thisChar := Character lf. |
|
157 |
"/ self next. |
|
158 |
"/ ] |
|
159 |
"/ ]. |
|
160 |
theString at:index put:thisChar. |
|
161 |
thisChar := self next. |
|
162 |
] |
|
5394 | 163 |
]. |
164 |
(index == 0) ifTrue:[^ '']. |
|
165 |
^ theString copyTo:index |
|
166 |
! ! |
|
167 |
||
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
168 |
!PeekableStream methodsFor:'fileIn'! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
169 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
170 |
askForDebug:message |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
171 |
"launch a box asking if a debugger is wanted - used when an error |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
172 |
occurs while filing in" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
173 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
174 |
^ self askForDebug:message canContinueForAll:false |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
175 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
176 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
177 |
askForDebug:message canContinueForAll:canContinueForAll |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
178 |
"launch a box asking if a debugger is wanted - used when an error |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
179 |
occurs while filing in" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
180 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
181 |
|labels values| |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
182 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
183 |
Smalltalk isInitialized ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
184 |
'PositionableStream [warning]: fileIn error during startup: ' errorPrint. message errorPrintCR. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
185 |
^ #debug |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
186 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
187 |
"/ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
188 |
"/ are we in the startup sequence of an image restart ? |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
189 |
"/ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
190 |
Processor activeProcessIsSystemProcess ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
191 |
'PositionableStream [warning]: fileIn error during startup: ' errorPrint. message errorPrintCR. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
192 |
^ #continue |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
193 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
194 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
195 |
canContinueForAll ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
196 |
labels := #('Cancel' 'Skip' 'Debug' 'Dont ask again' 'Continue'). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
197 |
values := #(#abort #skip #debug #continueForAll #continue). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
198 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
199 |
labels := #('Cancel' 'Skip' 'Debug' 'Continue'). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
200 |
values := #(#abort #skip #debug #continue). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
201 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
202 |
AbortAllSignal isHandled ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
203 |
labels := #('Cancel All') , labels. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
204 |
values := #(#cancelAll) , values. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
205 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
206 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
207 |
^ OptionBox |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
208 |
request:message |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
209 |
label:'Error in fileIn' |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
210 |
image:(WarningBox iconBitmap) |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
211 |
buttonLabels:labels |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
212 |
values:values |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
213 |
default:#continue |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
214 |
onCancel:#abort. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
215 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
216 |
"Modified: 10.1.1997 / 18:00:56 / cg" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
217 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
218 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
219 |
basicFileInNotifying:someone passChunk:passChunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
220 |
"central method to file in from the receiver, i.e. read chunks and evaluate them - |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
221 |
return the value of the last chunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
222 |
Someone (which is usually some codeView) is notified of errors." |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
223 |
|
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
224 |
|lastValue pkg nameSpace usedNameSpaces |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
225 |
packageQuerySignal nameSpaceQuerySignal usedNameSpaceQuerySignal |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
226 |
changeDefaultApplicationNotificationSignal |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
227 |
defaultApplicationQuerySignal defaultApplication |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
228 |
confirmationQuerySignal handledSignals passedSignals |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
229 |
dontAskSignals askSomeoneForPackage redef outerContext| |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
230 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
231 |
self skipSeparators. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
232 |
lastValue := self peek. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
233 |
lastValue == $< ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
234 |
"/ assume, its an xml file |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
235 |
^ self fileInXMLNotifying:someone passChunk:passChunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
236 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
237 |
lastValue == $# ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
238 |
"assume unix interpreter name: |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
239 |
'#!!stx -e' or something like this" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
240 |
self nextPeek == $!! ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
241 |
"skip the unix command line" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
242 |
self nextLine |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
243 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
244 |
self error:'Invalid chunk start' |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
245 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
246 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
247 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
248 |
Smalltalk::Compiler isNil ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
249 |
self isFileStream ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
250 |
Transcript show:('[' , self pathName , '] '). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
251 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
252 |
Transcript showCR:'cannot fileIn (no compiler).'. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
253 |
^ nil. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
254 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
255 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
256 |
"/ support for V'Age applications |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
257 |
defaultApplicationQuerySignal := Class defaultApplicationQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
258 |
changeDefaultApplicationNotificationSignal := Class changeDefaultApplicationNotificationSignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
259 |
|
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
260 |
"/ support for ST/X's nameSpaces & packages |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
261 |
packageQuerySignal := Class packageQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
262 |
nameSpaceQuerySignal := Class nameSpaceQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
263 |
usedNameSpaceQuerySignal := Class usedNameSpaceQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
264 |
|
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
265 |
(someone respondsTo:#packageToInstall) ifTrue:[ |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
266 |
pkg := someone packageToInstall. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
267 |
askSomeoneForPackage := true. |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
268 |
] ifFalse:[ |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
269 |
pkg := packageQuerySignal query. |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
270 |
askSomeoneForPackage := false. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
271 |
]. |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
272 |
(someone respondsTo:#currentNameSpace) ifTrue:[ |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
273 |
nameSpace := someone currentNameSpace |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
274 |
] ifFalse:[ |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
275 |
nameSpace := nameSpaceQuerySignal query. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
276 |
]. |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
277 |
(someone respondsTo:#usedNameSpaces) ifTrue:[ |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
278 |
usedNameSpaces := someone usedNameSpaces |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
279 |
] ifFalse:[ |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
280 |
usedNameSpaces := usedNameSpaceQuerySignal query. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
281 |
]. |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
282 |
(someone respondsTo:#defaultApplication) ifTrue:[ |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
283 |
defaultApplication := someone defaultApplication |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
284 |
] ifFalse:[ |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
285 |
defaultApplication := defaultApplicationQuerySignal query. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
286 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
287 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
288 |
confirmationQuerySignal := Metaclass confirmationQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
289 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
290 |
passedSignals := IdentitySet new. |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
291 |
handledSignals := SignalSet new. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
292 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
293 |
handledSignals add:changeDefaultApplicationNotificationSignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
294 |
passedSignals add:changeDefaultApplicationNotificationSignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
295 |
handledSignals add:defaultApplicationQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
296 |
passedSignals add:defaultApplicationQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
297 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
298 |
handledSignals add:packageQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
299 |
handledSignals add:usedNameSpaceQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
300 |
handledSignals add:nameSpaceQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
301 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
302 |
handledSignals add:Error. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
303 |
passedSignals add:Error. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
304 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
305 |
handledSignals add:(Class methodRedefinitionSignal). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
306 |
passedSignals add:(Class methodRedefinitionSignal). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
307 |
handledSignals add:(Class classRedefinitionSignal). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
308 |
passedSignals add:(Class classRedefinitionSignal). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
309 |
handledSignals add:confirmationQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
310 |
passedSignals add:confirmationQuerySignal. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
311 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
312 |
outerContext := thisContext. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
313 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
314 |
handledSignals handle:[:ex | |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
315 |
|sig action what sender msg proceedValue canContinueForAll| |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
316 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
317 |
sig := ex signal. |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
318 |
((passedSignals includes:sig) and:[sig isHandledIn:outerContext]) ifTrue:[ |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
319 |
ex reject |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
320 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
321 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
322 |
sig == changeDefaultApplicationNotificationSignal ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
323 |
"/ invoked via #becomeDefault to set the defaultApp and the package. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
324 |
"/ (only when filing in V'Age code) |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
325 |
defaultApplication := ex parameter. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
326 |
pkg := defaultApplication name asSymbol. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
327 |
ex proceedWith:nil |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
328 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
329 |
sig == defaultApplicationQuerySignal ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
330 |
"/ query for the application to add classes & methods into |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
331 |
"/ (only when filing in V'Age code) |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
332 |
ex proceedWith:defaultApplication |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
333 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
334 |
sig == packageQuerySignal ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
335 |
"answer the package to use for classes & methods" |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
336 |
askSomeoneForPackage ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
337 |
ex proceedWith:someone packageToInstall |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
338 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
339 |
ex proceedWith:pkg |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
340 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
341 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
342 |
sig == usedNameSpaceQuerySignal ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
343 |
"answer the nameSpaces to be searched when encountering globals" |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
344 |
ex proceedWith:usedNameSpaces |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
345 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
346 |
sig == nameSpaceQuerySignal ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
347 |
"answer the nameSpace to install new classes in" |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
348 |
ex proceedWith:nameSpace |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
349 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
350 |
sig == confirmationQuerySignal ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
351 |
"don't pop up dialogs" |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
352 |
ex proceedWith:false |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
353 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
354 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
355 |
sig == Stream endOfStreamSignal ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
356 |
"pass premature end of stream signal" |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
357 |
ex reject |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
358 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
359 |
|
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
360 |
sig == NoHandlerError ifTrue:[ |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
361 |
ex parameter rejected ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
362 |
ex reject |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
363 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
364 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
365 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
366 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
367 |
ex proceedWith:(dontAskSignals at:sig) |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
368 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
369 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
370 |
canContinueForAll := false. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
371 |
redef := false. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
372 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
373 |
"/ for your convenience ... |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
374 |
(sig == Class methodRedefinitionSignal) ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
375 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
376 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
377 |
canContinueForAll := true. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
378 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
379 |
(sig == Class classRedefinitionSignal) ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
380 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
381 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
382 |
canContinueForAll := true. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
383 |
redef := true. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
384 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
385 |
msg := 'error in fileIn: %1' |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
386 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
387 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
388 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
389 |
what := ex description. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
390 |
what isNil ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
391 |
what := ex signal notifierString. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
392 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
393 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
394 |
msg := msg bindWith:what. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
395 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
396 |
"/ handle the case where no GUI has been built in, |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
397 |
"/ just abort the fileIn with a notification |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
398 |
|
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
399 |
Screen current isNil ifTrue:[ |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
400 |
sender := ex suspendedContext sender. |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
401 |
msg := (msg , '\\in ' , sender receiver class name , '>>' , sender selector) withCRs. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
402 |
self notify:msg. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
403 |
ex return |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
404 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
405 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
406 |
sig == HaltInterrupt ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
407 |
sender := ex suspendedContext. |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
408 |
msg := (msg , '\\in ' , sender receiver class name , '>>' , sender selector) withCRs |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
409 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
410 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
411 |
"/ otherwise ask what should be done now and either |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
412 |
"/ continue or abort the fileIn |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
413 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
414 |
redef ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
415 |
action := OptionBox |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
416 |
request:(msg withCRs) |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
417 |
label:'Class redefinition in fileIn' |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
418 |
image:(WarningBox iconBitmap) |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
419 |
"/ cg: now always keep the old packageID |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
420 |
"/ buttonLabels:#('cancel' 'skip' 'debug' 'keep' 'keep all' 'continue' 'continue all') |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
421 |
"/ values:#(#abort #skip #debug #keep #keepAll #continue #continueForAll) |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
422 |
buttonLabels:#('Cancel' 'Skip' 'Debug' 'Continue' 'Continue All') |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
423 |
values:#(#abort #skip #debug #keep #keepAll) |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
424 |
default:#keep |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
425 |
onCancel:#abort. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
426 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
427 |
action := self askForDebug:msg withCRs canContinueForAll:canContinueForAll. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
428 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
429 |
action == #continueForAll ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
430 |
dontAskSignals isNil ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
431 |
dontAskSignals := IdentityDictionary new. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
432 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
433 |
dontAskSignals at:sig put:#continue. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
434 |
action := proceedValue := #continue. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
435 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
436 |
action == #keepForAll ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
437 |
dontAskSignals isNil ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
438 |
dontAskSignals := IdentityDictionary new. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
439 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
440 |
dontAskSignals at:sig put:#keep. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
441 |
action := #continue. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
442 |
proceedValue := #keep. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
443 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
444 |
action == #keep ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
445 |
action := #continue. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
446 |
proceedValue := #keep. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
447 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
448 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
449 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
450 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
451 |
action == #continue ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
452 |
ex proceedWith:proceedValue |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
453 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
454 |
action == #abort ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
455 |
AbortOperationRequest raise. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
456 |
ex return |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
457 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
458 |
action == #cancelAll ifTrue:[ |
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
459 |
AbortAllOperationRequest raise. |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
460 |
ex return |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
461 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
462 |
action == #skip ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
463 |
ex proceedWith:nil |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
464 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
465 |
action == #debug ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
466 |
Debugger enter:ex suspendedContext |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
467 |
withMessage:ex description |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
468 |
mayProceed:true. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
469 |
ex proceedWith:proceedValue |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
470 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
471 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
472 |
"/ (ex signal) enterDebuggerWith:ex message:what. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
473 |
ex reject |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
474 |
] do:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
475 |
[self atEnd] whileFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
476 |
lastValue := self fileInNextChunkNotifying:someone passChunk:passChunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
477 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
478 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
479 |
^ lastValue |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
480 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
481 |
"Modified: / 10.9.1999 / 16:54:01 / stefan" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
482 |
"Modified: / 16.11.2001 / 16:21:28 / cg" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
483 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
484 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
485 |
fileIn |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
486 |
"file in from the receiver, i.e. read chunks and evaluate them - |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
487 |
return the value of the last chunk." |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
488 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
489 |
|notifiedLoader| |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
490 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
491 |
SourceFileLoader notNil ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
492 |
notifiedLoader := SourceFileLoader on:self. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
493 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
494 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
495 |
^ self fileInNotifying:notifiedLoader passChunk:true. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
496 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
497 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
498 |
fileInBinary |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
499 |
"file in from the receiver, i.e. read binary stored classes and/or objects. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
500 |
Return the last object." |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
501 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
502 |
|bos obj| |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
503 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
504 |
bos := BinaryObjectStorage onOld:self. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
505 |
Class nameSpaceQuerySignal |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
506 |
answer:Smalltalk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
507 |
do:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
508 |
[self atEnd] whileFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
509 |
obj := bos next. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
510 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
511 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
512 |
bos close. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
513 |
^ obj |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
514 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
515 |
"Created: / 13.11.2001 / 10:12:30 / cg" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
516 |
"Modified: / 13.11.2001 / 10:14:04 / cg" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
517 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
518 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
519 |
fileInNextChunkNotifying:someone |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
520 |
"read next chunk, evaluate it and return the result; |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
521 |
someone (which is usually some codeView) is notified of errors. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
522 |
Filein is done as follows: |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
523 |
read a chunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
524 |
if it started with an excla, evaluate it, and let the resulting object |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
525 |
fileIn more chunks. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
526 |
This is a nice trick, since the methodsFor: expression evaluates to |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
527 |
a ClassCategoryReader which reads and compiles chunks for its class. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
528 |
However, other than methodsFor expressions are possible - you can |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
529 |
(in theory) create readers for any syntax. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
530 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
531 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
532 |
^ self fileInNextChunkNotifying:someone passChunk:false |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
533 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
534 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
535 |
fileInNextChunkNotifying:someone passChunk:passChunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
536 |
"read next chunk, evaluate it and return the result; |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
537 |
someone (which is usually some codeView) is notified of errors. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
538 |
Filein is done as follows: |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
539 |
read a chunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
540 |
if it started with an excla, evaluate it, and let the resulting object |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
541 |
fileIn more chunks. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
542 |
This is a nice trick, since the methodsFor: expression evaluates to |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
543 |
a ClassCategoryReader which reads and compiles chunks for its class. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
544 |
However, other than methodsFor expressions are possible - you can |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
545 |
(in theory) create readers for any syntax. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
546 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
547 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
548 |
^ self fileInNextChunkNotifying:someone passChunk:passChunk silent:nil |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
549 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
550 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
551 |
fileInNextChunkNotifying:someone passChunk:passChunk silent:beSilent |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
552 |
"read next chunk, evaluate it and return the result; |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
553 |
someone (which is usually some codeView) is notified of errors. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
554 |
Filein is done as follows: |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
555 |
read a chunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
556 |
if it started with an excla, evaluate it, and let the resulting object |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
557 |
fileIn more chunks. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
558 |
This is a nice trick, since the methodsFor: expression evaluates to |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
559 |
a ClassCategoryReader which reads and compiles chunks for its class. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
560 |
However, other than methodsFor expressions are possible - you can |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
561 |
(in theory) create readers for any syntax. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
562 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
563 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
564 |
|aString sawExcla rslt done| |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
565 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
566 |
self skipSeparators. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
567 |
self atEnd ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
568 |
sawExcla := self peekFor:(self class chunkSeparator). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
569 |
aString := self nextChunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
570 |
"/ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
571 |
"/ handle empty chunks; |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
572 |
"/ this allows for Squeak code to be filedIn |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
573 |
"/ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
574 |
[aString size == 0 |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
575 |
and:[self atEnd not]] whileTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
576 |
aString := self nextChunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
577 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
578 |
aString size ~~ 0 ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
579 |
passChunk ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
580 |
someone notNil ifTrue:[someone source:aString] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
581 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
582 |
sawExcla ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
583 |
rslt := Smalltalk::Compiler evaluate:aString notifying:someone. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
584 |
] ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
585 |
Smalltalk::Compiler emptySourceNotificationSignal handle:[:ex | |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
586 |
^ nil |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
587 |
] do:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
588 |
rslt := Smalltalk::Compiler evaluate:aString notifying:someone compile:false. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
589 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
590 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
591 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
592 |
usually, the above chunk consists of some methodsFor:-expression |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
593 |
in this case, the returned value is a ClassCategoryReader, |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
594 |
which is used to load & compile the methods ... |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
595 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
596 |
rslt isNil ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
597 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
598 |
however, if that was nil (i.e. some error), we skip chunks |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
599 |
up to the next empty chunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
600 |
" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
601 |
Transcript showCR:'skipping chunks ...'. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
602 |
done := false. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
603 |
[done] whileFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
604 |
aString := self nextChunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
605 |
done := (aString size == 0). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
606 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
607 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
608 |
rslt := rslt |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
609 |
fileInFrom:self |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
610 |
notifying:someone |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
611 |
passChunk:passChunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
612 |
single:false |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
613 |
silent:beSilent |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
614 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
615 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
616 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
617 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
618 |
^ rslt |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
619 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
620 |
"Modified: 14.10.1997 / 17:10:35 / cg" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
621 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
622 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
623 |
fileInNotifying:notifiedLoader passChunk:passChunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
624 |
"central method to file in from the receiver, i.e. read chunks and evaluate them - |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
625 |
return the value of the last chunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
626 |
Someone (which is usually some codeView) is notified of errors." |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
627 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
628 |
self isFileStream ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
629 |
^ self basicFileInNotifying:notifiedLoader passChunk:passChunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
630 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
631 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
632 |
^ self fileInNotifying:notifiedLoader passChunk:passChunk inDirectory:(self pathName asFilename directory). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
633 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
634 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
635 |
fileInNotifying:notifiedLoader passChunk:passChunk inDirectory:aDirectory |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
636 |
"central method to file in from the receiver, i.e. read chunks and evaluate them - |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
637 |
return the value of the last chunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
638 |
Someone (which is usually some codeView) is notified of errors." |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
639 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
640 |
|oldPath val thisDirectory thisDirectoryPathName| |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
641 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
642 |
thisDirectory := aDirectory asFilename. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
643 |
thisDirectoryPathName := thisDirectory pathName. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
644 |
oldPath := Smalltalk systemPath. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
645 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
646 |
[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
647 |
Smalltalk systemPath:(oldPath copy addFirst:thisDirectoryPathName; yourself). |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
648 |
CurrentFileInDirectoryQuerySignal answer:thisDirectory do:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
649 |
val := self basicFileInNotifying:notifiedLoader passChunk:passChunk. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
650 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
651 |
] ensure:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
652 |
"take care, someone could have changed SystemPath during fileIn!!" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
653 |
(Smalltalk systemPath copyFrom:2) = oldPath ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
654 |
Smalltalk systemPath:oldPath. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
655 |
] ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
656 |
(oldPath includes:thisDirectoryPathName) ifFalse:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
657 |
Smalltalk systemPath remove:thisDirectoryPathName ifAbsent:[]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
658 |
Smalltalk flushPathCaches. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
659 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
660 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
661 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
662 |
^ val |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
663 |
! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
664 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
665 |
fileInXMLNotifying:someone passChunk:passChunk |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
666 |
"filein an XML source file (format as in campSmalltalk DTD)" |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
667 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
668 |
| builder parser| |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
669 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
670 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
671 |
Smalltalk loadPackage:'stx:goodies/xml/vw'. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
672 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
673 |
self error:'Could not load XML package(s) from ''stx:goodies/xml/vw'''. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
674 |
] |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
675 |
]. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
676 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
677 |
builder := XML::SourceNodeBuilder new. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
678 |
parser := XML::XMLParser on:self. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
679 |
parser builder:builder. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
680 |
parser validate:false. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
681 |
parser scanDocument. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
682 |
"/ self halt. |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
683 |
! ! |
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
684 |
|
4404 | 685 |
!PeekableStream methodsFor:'positioning'! |
58 | 686 |
|
68 | 687 |
skipAny:skipCollection |
688 |
"skip all characters included in the argument-set. |
|
689 |
returns the next peeked element or nil, if the end-of-stream was reached." |
|
690 |
||
691 |
|nextOne| |
|
692 |
||
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
693 |
nextOne := self peekOrNil. |
68 | 694 |
[nextOne notNil and:[skipCollection includes:nextOne]] whileTrue:[ |
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
695 |
self next. |
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
696 |
nextOne := self peekOrNil |
68 | 697 |
]. |
698 |
^ nextOne |
|
699 |
||
700 |
" |
|
701 |
|s skipChars| |
|
702 |
||
703 |
s := ReadStream on:'some numbers1234with\in other99 stuff' withCRs. |
|
704 |
skipChars := 'abcdefghijklmnopqrstuvwxyz\ ' withCRs. |
|
705 |
s skipAny:skipChars. |
|
1422 | 706 |
Transcript showCR:(Integer readFrom:s). |
68 | 707 |
s skipAny:skipChars. |
1422 | 708 |
Transcript showCR:(Integer readFrom:s). |
68 | 709 |
" |
710 |
! |
|
711 |
||
611 | 712 |
skipSeparators |
713 |
"skip all whitespace; returns the next peeked element or |
|
714 |
nil, if the end-of-stream was reached. |
|
715 |
The streams elements should be characters. |
|
716 |
Notice: compare this method to skipSpaces" |
|
717 |
||
718 |
|nextOne| |
|
719 |
||
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
720 |
nextOne := self peekOrNil. |
611 | 721 |
[nextOne notNil and:[nextOne isSeparator]] whileTrue:[ |
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
722 |
self next. |
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
723 |
nextOne := self peekOrNil |
611 | 724 |
]. |
725 |
^ nextOne |
|
726 |
||
727 |
" |
|
728 |
|s| |
|
729 |
||
730 |
s := ReadStream on:'one two\three' withCRs. |
|
731 |
s skipSeparators. |
|
1422 | 732 |
Transcript showCR:(s nextWord). |
611 | 733 |
s skipSeparators. |
1422 | 734 |
Transcript showCR:(s nextWord). |
611 | 735 |
s skipSeparators. |
1422 | 736 |
Transcript showCR:(s next displayString). |
611 | 737 |
" |
738 |
! |
|
739 |
||
740 |
skipSeparatorsExceptCR |
|
741 |
"skip all whitespace except carriage return; returns the |
|
742 |
next peeked element or nil, if the end-of-stream was reached. |
|
743 |
The streams elements should be characters. |
|
744 |
Notice: compare this method to skipSpaces and skipSeparators" |
|
745 |
||
746 |
|nextOne| |
|
747 |
||
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
748 |
nextOne := self peekOrNil. |
611 | 749 |
[nextOne notNil |
750 |
and:[nextOne isSeparator |
|
751 |
and:[nextOne ~~ Character cr]]] whileTrue:[ |
|
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
752 |
self next. |
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
753 |
nextOne := self peekOrNil |
611 | 754 |
]. |
755 |
^ nextOne |
|
756 |
! |
|
757 |
||
68 | 758 |
skipSpaces |
759 |
"skip all spaces; returns the next peeked element or |
|
760 |
nil, if the end-of-stream was reached. |
|
761 |
The streams elements should be characters. |
|
762 |
Notice: this one skips only spaces (i.e. no cr, tabs etc) |
|
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
763 |
usually, skipSeparators is what you want." |
68 | 764 |
|
765 |
|nextOne| |
|
766 |
||
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
767 |
nextOne := self peekOrNil. |
68 | 768 |
[nextOne notNil and:[nextOne == Character space]] whileTrue:[ |
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
769 |
self next. |
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
770 |
nextOne := self peekOrNil |
68 | 771 |
]. |
772 |
^ nextOne |
|
773 |
||
774 |
" |
|
775 |
|s| |
|
776 |
||
777 |
s := ReadStream on:'one two\three' withCRs. |
|
778 |
s skipSpaces. |
|
1422 | 779 |
Transcript showCR:(s nextWord). |
68 | 780 |
s skipSpaces. |
1422 | 781 |
Transcript showCR:(s nextWord). |
68 | 782 |
s skipSpaces. |
1422 | 783 |
Transcript showCR:(s next displayString). |
68 | 784 |
" |
4404 | 785 |
! ! |
786 |
||
787 |
!PeekableStream methodsFor:'reading'! |
|
788 |
||
789 |
nextDecimalInteger |
|
790 |
"read the next integer in radix 10. Does NOT skip initial whitespace. |
|
791 |
The streams elements should be characters. |
|
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
792 |
Be careful - this method returns 0 if not posiioned on a digit intitially |
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
793 |
or if the end of the stream is encountered." |
4404 | 794 |
|
795 |
|nextOne value| |
|
796 |
||
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
797 |
nextOne := self peekOrNil. |
4404 | 798 |
value := 0. |
799 |
[nextOne notNil and:[nextOne isDigitRadix:10]] whileTrue:[ |
|
800 |
value := (value * 10) + nextOne digitValue. |
|
4432
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
801 |
self next. |
5267a659f8d9
avoid raising pastEnd exceptions in skip-methods
Claus Gittinger <cg@exept.de>
parents:
4404
diff
changeset
|
802 |
nextOne := self peekOrNil |
4404 | 803 |
]. |
804 |
^ value |
|
805 |
||
806 |
" |
|
807 |
|s| |
|
808 |
||
809 |
s := '1234 5678' readStream. |
|
810 |
s nextDecimalInteger. |
|
811 |
" |
|
812 |
||
813 |
" |
|
814 |
|s| |
|
815 |
||
816 |
s := '1234 5678' readStream. |
|
817 |
s nextDecimalInteger. |
|
818 |
s skipSpaces. |
|
819 |
s nextDecimalInteger. |
|
820 |
" |
|
821 |
! |
|
822 |
||
823 |
nextDelimited:terminator |
|
824 |
"return the contents of the receiver, up to the next terminator character. |
|
825 |
Doubled terminators indicate an embedded terminator character. |
|
826 |
For example: 'this '' was a quote'. |
|
827 |
Start postioned before the initial terminator." |
|
828 |
||
829 |
| out ch | |
|
830 |
||
7685
535a69a7cd69
String new -> uninitializedNew: / basicNew:
Claus Gittinger <cg@exept.de>
parents:
5394
diff
changeset
|
831 |
out := WriteStream on: (String uninitializedNew: 1000). |
4404 | 832 |
self atEnd ifTrue: [^ '']. |
833 |
self next == terminator ifFalse: [self skip: -1]. "absorb initial terminator" |
|
834 |
[(ch := self next) == nil] whileFalse: [ |
|
835 |
(ch == terminator) ifTrue: [ |
|
836 |
self peek == terminator ifFalse: [ |
|
837 |
^ out contents "terminator is not doubled; we're done!!" |
|
838 |
]. |
|
839 |
self next. "skip doubled terminator" |
|
840 |
]. |
|
841 |
out nextPut: ch. |
|
842 |
]. |
|
843 |
^ out contents |
|
844 |
||
845 |
" |
|
846 |
('*foo bar baz* more foo' readStream nextDelimited:$*) |
|
847 |
('*foo bar **baz***' readStream nextDelimited:$*) |
|
848 |
" |
|
849 |
! |
|
850 |
||
851 |
nextPeek |
|
852 |
"advance to next element and return the peeked element" |
|
853 |
||
854 |
self next. |
|
855 |
^ self peek |
|
856 |
! |
|
857 |
||
858 |
peek |
|
859 |
"return the next element of the stream without advancing (i.e. |
|
860 |
the following send of next will return this element again.) |
|
861 |
- we do not know here how to do it, it must be redefined in subclass" |
|
862 |
||
863 |
^ self subclassResponsibility |
|
864 |
! |
|
865 |
||
866 |
peekFor:anObject |
|
867 |
"if the next-to-be-read object is equal to the argument, anObject, read it |
|
868 |
and return true. Otherwise, leave the receiver unaffected and return false." |
|
869 |
||
870 |
self peek = anObject ifTrue:[ |
|
871 |
self next. |
|
872 |
^ true |
|
873 |
]. |
|
874 |
^ false |
|
68 | 875 |
! |
876 |
||
2419 | 877 |
upToMatching:aBlock |
878 |
"Return the next elements up to but not including the next element |
|
879 |
for which aBlock returns true. |
|
880 |
The next read will return that matching element." |
|
881 |
||
882 |
|answerStream element| |
|
883 |
||
884 |
answerStream := WriteStream on:(self contentsSpecies new). |
|
885 |
[self atEnd] whileFalse: [ |
|
886 |
element := self peek. |
|
887 |
(aBlock value:element) ifTrue: [^ answerStream contents]. |
|
888 |
answerStream nextPut:element. |
|
889 |
self next. |
|
890 |
]. |
|
891 |
^ answerStream contents |
|
892 |
||
893 |
" |
|
894 |
'hello world' readStream upToMatching:[:c | c isSeparator]. |
|
895 |
" |
|
4404 | 896 |
" |
897 |
|s| |
|
898 |
||
899 |
s := 'hello world' readStream. |
|
900 |
s upToMatching:[:c | c isSeparator]. |
|
901 |
s upToEnd |
|
902 |
" |
|
2419 | 903 |
|
2421 | 904 |
"Modified: 26.2.1997 / 12:20:57 / cg" |
2419 | 905 |
! |
906 |
||
68 | 907 |
upToSeparator |
908 |
"Return the next elements up to but not including the next separator. |
|
4404 | 909 |
The next read will return the separator. |
910 |
If no separator is encountered, the contents up to the end is returned. |
|
911 |
The elements are supposed to understand #isSeparator |
|
912 |
(i.e. the receiver is supposed to be a character-stream)." |
|
68 | 913 |
|
4404 | 914 |
^ self upToMatching:[:ch | ch isSeparator] |
2060 | 915 |
|
916 |
" |
|
4404 | 917 |
'hello world' readStream upToSeparator |
918 |
'helloworld' readStream upToSeparator |
|
919 |
'helloworld' readStream upToSeparator |
|
920 |
'' readStream upToSeparator |
|
921 |
||
922 |
|s| |
|
923 |
s := 'hello world' readStream. |
|
924 |
s upToSeparator. |
|
925 |
s upToEnd |
|
2060 | 926 |
" |
927 |
||
928 |
"Modified: 4.1.1997 / 23:38:05 / cg" |
|
611 | 929 |
! ! |
58 | 930 |
|
701 | 931 |
!PeekableStream class methodsFor:'documentation'! |
932 |
||
933 |
version |
|
8485
d94728eaf4f0
Use access methods for oldPackage and newPackage in notifications.
Stefan Vogel <sv@exept.de>
parents:
8443
diff
changeset
|
934 |
^ '$Header: /cvs/stx/stx/libbasic/PeekableStream.st,v 1.25 2004-08-22 17:58:15 stefan Exp $' |
701 | 935 |
! ! |
8443
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
936 |
|
7bc4348c059e
fileIn stuff moved to peekableStream
Claus Gittinger <cg@exept.de>
parents:
8192
diff
changeset
|
937 |
PeekableStream initialize! |