author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 09 Jul 2013 22:51:30 +0100 | |
branch | jv |
changeset 18071 | 009cf668b0ed |
parent 18066 | 89d51443ba6f |
parent 15477 | 32c7805d7a6e |
child 18079 | 7b5afc0ad3d5 |
permissions | -rw-r--r-- |
8148 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
8047 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
8447
9bdea3431846
EncodedStream inherts from PeekableStream
Stefan Vogel <sv@exept.de>
parents:
8444
diff
changeset
|
14 |
PeekableStream subclass:#EncodedStream |
8047 | 15 |
instanceVariableNames:'encoder stream' |
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Collections-Text-Encodings' |
|
19 |
! |
|
20 |
||
8148 | 21 |
!EncodedStream class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
15049 | 35 |
! |
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
a stream which transparently decodes from an external decoding, |
|
40 |
looking for '---- Encoding: xxx' near the beginning of the file. |
|
41 |
||
42 |
especially targeted towards reading ST/X source files. |
|
43 |
" |
|
8148 | 44 |
! ! |
8047 | 45 |
|
46 |
!EncodedStream class methodsFor:'instance creation'! |
|
47 |
||
48 |
stream:streamArg encoder:encoder |
|
49 |
^ (self basicNew) stream:streamArg; encoder:encoder |
|
50 |
! ! |
|
51 |
||
12610 | 52 |
!EncodedStream class methodsFor:'utilities'! |
53 |
||
54 |
decodedStreamFor:aStream |
|
15345 | 55 |
"given a positionable stream, guess its encoding (by reading the |
56 |
first few lines, looking for a string with an encoding hint, |
|
57 |
and return an appropriate encoded string, which does the decoding |
|
58 |
on the fly. Used mostly to read UTF8 files (source code)" |
|
59 |
||
15049 | 60 |
|encodingSymbol decoder decodedStream| |
12610 | 61 |
|
62 |
aStream isPositionable ifTrue:[ |
|
15049 | 63 |
encodingSymbol := CharacterEncoder guessEncodingOfStream:aStream. |
18066
89d51443ba6f
Merged 1d9323e0a535 and 5fcd709c7fd2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
64 |
decoder := CharacterEncoder encoderFor:encodingSymbol. |
15049 | 65 |
decoder isNil ifTrue:[ |
66 |
"/ ascii or iso8895-1 |
|
67 |
^ aStream |
|
12610 | 68 |
]. |
15049 | 69 |
] ifFalse:[ |
70 |
"/ setup for no-encoding; |
|
71 |
"/ switch to a real encoder later, |
|
14095 | 72 |
"/ whenever an encoding pragma is encountered later. |
73 |
decoder := CharacterEncoder nullEncoderInstance. |
|
74 |
]. |
|
75 |
decodedStream := self stream:aStream encoder:decoder. |
|
18041
d17dbf11e306
Fix for file in of UTF8 files (part 2).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18039
diff
changeset
|
76 |
"JV@2012-03-27: NO, DO NOT CHANGE POSITION!! Caller might be interested |
d17dbf11e306
Fix for file in of UTF8 files (part 2).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18039
diff
changeset
|
77 |
in all data!!!!!!" |
d17dbf11e306
Fix for file in of UTF8 files (part 2).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18039
diff
changeset
|
78 |
"/decodedStream skipEncodingChunk. |
12610 | 79 |
^ decodedStream |
15049 | 80 |
|
18041
d17dbf11e306
Fix for file in of UTF8 files (part 2).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18039
diff
changeset
|
81 |
"Modified: / 27-03-2013 / 17:08:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
15049 | 82 |
! |
83 |
||
18066
89d51443ba6f
Merged 1d9323e0a535 and 5fcd709c7fd2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
84 |
! |
12610 | 85 |
|
8047 | 86 |
!EncodedStream methodsFor:'accessing'! |
87 |
||
11992 | 88 |
contentsSpecies |
89 |
||
90 |
"Not sure if this is ok" |
|
91 |
||
92 |
^ stream contentsSpecies. |
|
93 |
||
94 |
"/ ^UnicodeString |
|
95 |
||
96 |
"Created: / 14-06-2005 / 17:11:01 / janfrog" |
|
97 |
! |
|
98 |
||
8047 | 99 |
encoder |
100 |
^ encoder |
|
101 |
! |
|
102 |
||
103 |
encoder:something |
|
104 |
encoder := something. |
|
105 |
! |
|
106 |
||
12646 | 107 |
pathName |
108 |
"if our base stream hat a pathname, delegate..." |
|
109 |
||
110 |
stream isNil ifTrue:[ |
|
111 |
^ nil. |
|
112 |
]. |
|
113 |
^ stream pathName. |
|
114 |
! |
|
115 |
||
11766 | 116 |
readStream |
117 |
^ self |
|
118 |
! |
|
119 |
||
8047 | 120 |
stream |
121 |
^ stream |
|
122 |
! |
|
123 |
||
124 |
stream:something |
|
125 |
stream := something. |
|
126 |
! ! |
|
127 |
||
18039
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
128 |
!EncodedStream methodsFor:'private fileIn'! |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
129 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
130 |
basicFileInNotifying:someone passChunk:passChunk |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
131 |
"central method to file in from the receiver, i.e. read chunks and evaluate them - |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
132 |
return the value of the last chunk. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
133 |
Someone (which is usually some codeView) is notified of errors." |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
134 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
135 |
|lastValue pkg nameSpace usedNameSpaces |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
136 |
packageQuerySignal nameSpaceQuerySignal usedNameSpaceQuerySignal |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
137 |
changeDefaultApplicationNotificationSignal |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
138 |
defaultApplicationQuerySignal defaultApplication |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
139 |
confirmationQuerySignal handledSignals passedSignals askSomeoneForPackage outerContext askForVariableTypeOfUndeclaredQuery| |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
140 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
141 |
self skipSeparators. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
142 |
lastValue := self peek. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
143 |
lastValue == $< ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
144 |
"/ assume, it's an xml file |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
145 |
^ self fileInXMLNotifying:someone passChunk:passChunk. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
146 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
147 |
lastValue == $# ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
148 |
"assume unix interpreter name: |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
149 |
'#!!stx -e' or something like this" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
150 |
self nextPeek == $!! ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
151 |
"skip the unix command line" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
152 |
self nextLine |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
153 |
] ifFalse:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
154 |
self error:'Invalid chunk start' |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
155 |
] |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
156 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
157 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
158 |
Smalltalk::Compiler isNil ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
159 |
self isFileStream ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
160 |
Transcript show:('[' , self pathName , '] '). |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
161 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
162 |
Transcript showCR:'cannot fileIn (no compiler).'. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
163 |
^ nil. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
164 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
165 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
166 |
"/ support for V'Age applications |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
167 |
defaultApplicationQuerySignal := Class defaultApplicationQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
168 |
changeDefaultApplicationNotificationSignal := Class changeDefaultApplicationNotificationSignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
169 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
170 |
"/ support for ST/X's nameSpaces & packages |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
171 |
packageQuerySignal := Class packageQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
172 |
nameSpaceQuerySignal := Class nameSpaceQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
173 |
usedNameSpaceQuerySignal := Class usedNameSpaceQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
174 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
175 |
(someone respondsTo:#packageToInstall) ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
176 |
pkg := someone packageToInstall. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
177 |
askSomeoneForPackage := true. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
178 |
] ifFalse:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
179 |
pkg := packageQuerySignal query. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
180 |
askSomeoneForPackage := false. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
181 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
182 |
(someone respondsTo:#currentNameSpace) ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
183 |
nameSpace := someone currentNameSpace |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
184 |
] ifFalse:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
185 |
nameSpace := nameSpaceQuerySignal query. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
186 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
187 |
(someone respondsTo:#usedNameSpaces) ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
188 |
usedNameSpaces := someone usedNameSpaces |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
189 |
] ifFalse:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
190 |
usedNameSpaces := usedNameSpaceQuerySignal query. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
191 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
192 |
(someone respondsTo:#defaultApplication) ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
193 |
defaultApplication := someone defaultApplication |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
194 |
] ifFalse:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
195 |
defaultApplication := defaultApplicationQuerySignal query. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
196 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
197 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
198 |
confirmationQuerySignal := Metaclass confirmationQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
199 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
200 |
handledSignals := SignalSet new. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
201 |
passedSignals := IdentitySet new. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
202 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
203 |
handledSignals add:changeDefaultApplicationNotificationSignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
204 |
passedSignals add:changeDefaultApplicationNotificationSignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
205 |
handledSignals add:defaultApplicationQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
206 |
passedSignals add:defaultApplicationQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
207 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
208 |
handledSignals add:packageQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
209 |
handledSignals add:usedNameSpaceQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
210 |
handledSignals add:nameSpaceQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
211 |
handledSignals add:confirmationQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
212 |
passedSignals add:confirmationQuerySignal. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
213 |
Parser notNil ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
214 |
"only if libcomp is present" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
215 |
"Also catch a 'Parser askForVariableTypeOfUndeclaredQuery' and proceed with nil. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
216 |
Imagine somebody has autodefine workspace variables on and then |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
217 |
evaluate Smalltalk loadPackage:'xyz' that loads code from source (using file-in), |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
218 |
certainly we don't want to compile workspace variable access for every |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
219 |
not-yet-loaded class in some namespace. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
220 |
This is demonstrated by Regression::CompilerTests2>>test_01 |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
221 |
and this change actually fixes this test." |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
222 |
askForVariableTypeOfUndeclaredQuery := Parser askForVariableTypeOfUndeclaredQuery. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
223 |
handledSignals add:askForVariableTypeOfUndeclaredQuery. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
224 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
225 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
226 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
227 |
outerContext := thisContext. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
228 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
229 |
handledSignals handle:[:ex | |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
230 |
|sig| |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
231 |
|
18062
014678b4657a
Merged 2643e3012a13 and 395779f18870 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18045
diff
changeset
|
232 |
sig := ex creator. |
18039
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
233 |
((passedSignals includes:sig) and:[sig isHandledIn:outerContext]) ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
234 |
ex reject |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
235 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
236 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
237 |
sig == changeDefaultApplicationNotificationSignal ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
238 |
"/ invoked via #becomeDefault to set the defaultApp and the package. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
239 |
"/ (only when filing in V'Age code) |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
240 |
defaultApplication := ex parameter. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
241 |
pkg := defaultApplication name asSymbol. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
242 |
ex proceedWith:nil |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
243 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
244 |
sig == defaultApplicationQuerySignal ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
245 |
"/ query for the application to add classes & methods into |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
246 |
"/ (only when filing in V'Age code) |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
247 |
ex proceedWith:defaultApplication |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
248 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
249 |
sig == packageQuerySignal ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
250 |
"answer the package to use for classes & methods" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
251 |
askSomeoneForPackage ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
252 |
ex proceedWith:someone packageToInstall |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
253 |
] ifFalse:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
254 |
ex proceedWith:pkg |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
255 |
] |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
256 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
257 |
sig == usedNameSpaceQuerySignal ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
258 |
"answer the nameSpaces to be searched when encountering globals" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
259 |
ex proceedWith:usedNameSpaces |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
260 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
261 |
sig == nameSpaceQuerySignal ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
262 |
"answer the nameSpace to install new classes in" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
263 |
ex proceedWith:nameSpace |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
264 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
265 |
sig == confirmationQuerySignal ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
266 |
"don't pop up dialogs" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
267 |
ex proceedWith:false |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
268 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
269 |
sig == askForVariableTypeOfUndeclaredQuery ifTrue:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
270 |
"no autodefined variables or so" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
271 |
ex proceedWith:nil. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
272 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
273 |
] do:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
274 |
[self atEnd] whileFalse:[ |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
275 |
lastValue := self fileInNextChunkNotifying:someone passChunk:passChunk |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
276 |
] |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
277 |
]. |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
278 |
^ lastValue |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
279 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
280 |
"Modified: / 10.9.1999 / 16:54:01 / stefan" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
281 |
"Modified: / 16.11.2001 / 16:21:28 / cg" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
282 |
"Modified: / 18-03-2013 / 17:45:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
283 |
! ! |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
284 |
|
8047 | 285 |
!EncodedStream methodsFor:'stream protocol'! |
286 |
||
8175 | 287 |
atEnd |
288 |
^ stream atEnd |
|
289 |
! |
|
290 |
||
8165 | 291 |
close |
292 |
stream close |
|
293 |
! |
|
294 |
||
13400 | 295 |
contents |
296 |
||
297 |
^String streamContents: |
|
298 |
[:s| |
|
299 |
[ stream atEnd ] whileFalse: |
|
300 |
[s nextPut: stream next] |
|
301 |
] |
|
302 |
||
303 |
"Created: / 25-02-2010 / 23:34:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
304 |
! |
|
305 |
||
8213 | 306 |
cr |
8459 | 307 |
self nextPutAll:(Character cr asString) |
8213 | 308 |
! |
309 |
||
11992 | 310 |
emphasis:anObject |
311 |
||
312 |
stream emphasis:anObject |
|
313 |
||
314 |
"Created: / 15-06-2005 / 11:16:33 / janfrog" |
|
315 |
! |
|
316 |
||
15477 | 317 |
flush |
318 |
stream flush |
|
319 |
! |
|
320 |
||
11946 | 321 |
isOpen |
12690 | 322 |
^ stream notNil and:[stream isOpen] |
11946 | 323 |
! |
324 |
||
11766 | 325 |
next |
11992 | 326 |
|
327 |
^encoder readNextCharacterFrom:stream |
|
328 |
||
329 |
"Created: / 14-06-2005 / 17:01:39 / janfrog" |
|
330 |
! |
|
11766 | 331 |
|
11992 | 332 |
next:charactersToRead |
333 |
||
334 |
^encoder readNext:charactersToRead charactersFrom:stream |
|
335 |
||
336 |
"Created: / 16-06-2005 / 11:43:43 / masca" |
|
11766 | 337 |
! |
338 |
||
8147 | 339 |
nextChunk |
8175 | 340 |
|chunk| |
341 |
||
342 |
chunk := stream nextChunk. |
|
343 |
chunk isNil ifTrue:[^ chunk]. |
|
344 |
^ encoder decodeString:chunk |
|
8147 | 345 |
! |
346 |
||
8213 | 347 |
nextChunkPut:chunk |
348 |
stream nextChunkPut:(encoder encodeString:chunk) |
|
349 |
! |
|
350 |
||
8047 | 351 |
nextPut:aCharacter |
352 |
self nextPutAll:(aCharacter asString). |
|
353 |
! |
|
354 |
||
355 |
nextPutAll:aCollection |
|
356 |
stream nextPutAll:(encoder encodeString:aCollection). |
|
8147 | 357 |
! |
358 |
||
8444 | 359 |
peek |
11992 | 360 |
|
361 |
^stream peek |
|
362 |
||
363 |
"Created: / 20-06-2005 / 10:13:03 / masca" |
|
364 |
"Modified: / 20-06-2005 / 13:06:14 / masca" |
|
8444 | 365 |
! |
366 |
||
8175 | 367 |
peekFor:aCharacter |
368 |
^ stream peekFor:aCharacter |
|
369 |
! |
|
370 |
||
8165 | 371 |
position |
372 |
^ stream position |
|
373 |
! |
|
374 |
||
8197 | 375 |
position0Based |
11947 | 376 |
"to be obsoleted - use position" |
377 |
||
8197 | 378 |
^ stream position0Based |
379 |
! |
|
380 |
||
381 |
position0Based:newPosition |
|
11947 | 382 |
"to be obsoleted - use position" |
383 |
||
8197 | 384 |
stream position0Based:newPosition |
385 |
! |
|
386 |
||
8175 | 387 |
position1Based |
11947 | 388 |
"to be obsoleted - use position" |
389 |
||
8175 | 390 |
^ stream position1Based |
391 |
! |
|
392 |
||
8147 | 393 |
position1Based:newPosition |
11947 | 394 |
"to be obsoleted - use position" |
395 |
||
8147 | 396 |
stream position1Based:newPosition |
8175 | 397 |
! |
398 |
||
8197 | 399 |
position:newPosition |
400 |
stream position:newPosition |
|
401 |
! |
|
402 |
||
13400 | 403 |
reset |
404 |
stream reset |
|
405 |
||
406 |
"Created: / 25-02-2010 / 23:37:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
407 |
! |
|
408 |
||
8213 | 409 |
setToEnd |
410 |
stream setToEnd |
|
411 |
! |
|
412 |
||
14333 | 413 |
size |
414 |
"not correct, but probably better than 0" |
|
415 |
||
416 |
^ stream size |
|
417 |
||
418 |
"Created: / 31-08-2012 / 16:52:40 / cg" |
|
419 |
! |
|
420 |
||
11992 | 421 |
skip: anInteger |
422 |
||
423 |
"/ Should skip on character basis, not on bytes. This works for XML reader |
|
424 |
^stream skip: anInteger |
|
425 |
||
426 |
"Created: / 20-06-2005 / 13:06:06 / masca" |
|
427 |
! |
|
428 |
||
8175 | 429 |
skipSeparators |
430 |
^ stream skipSeparators |
|
15477 | 431 |
! |
432 |
||
433 |
sync |
|
434 |
stream sync |
|
435 |
! |
|
436 |
||
437 |
syncData |
|
438 |
stream syncData |
|
8047 | 439 |
! ! |
440 |
||
15049 | 441 |
!EncodedStream methodsFor:'testing'! |
442 |
||
18066
89d51443ba6f
Merged 1d9323e0a535 and 5fcd709c7fd2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
443 |
! |
15049 | 444 |
|
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
445 |
!EncodedStream methodsFor:'utilities'! |
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
446 |
|
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
447 |
skipEncodingChunk |
14091 | 448 |
|pos chunk token| |
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
449 |
|
13525
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
450 |
stream isPositionable ifFalse:[ |
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
451 |
^ self |
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
452 |
]. |
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
453 |
|
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
454 |
pos := self position. |
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
455 |
chunk := self nextChunk. |
14084 | 456 |
[ |
457 |
"/ if this is a valid chunk (i.e. not a comment or encoding-directive), |
|
458 |
"/ then position back, so it will be processed as usual. |
|
14091 | 459 |
"/ We could parse here, but this is overkill, since we are only interested in the fact, |
460 |
"/ that there is anything else than a comment in the chunk. |
|
461 |
"/ result := (Parser for:chunk) |
|
462 |
"/ ignoreErrors:true; |
|
463 |
"/ ignoreWarnings:true; |
|
464 |
"/ parseMethodBody. |
|
465 |
||
466 |
token := (Scanner for:chunk) |
|
467 |
ignoreErrors:true; |
|
468 |
ignoreWarnings:true; |
|
469 |
nextToken. |
|
470 |
||
471 |
token ~= #EOF ifTrue:[ |
|
14084 | 472 |
self position:pos |
473 |
]. |
|
14086 | 474 |
] on:Parser parseWarningSignal do:[:ex| |
14084 | 475 |
"really ignore any error. |
476 |
Even setting ignorError will output diagnostics here |
|
477 |
during standalone startup when debugging" |
|
14086 | 478 |
ex proceedWith:#ignore. |
14084 | 479 |
]. |
13525
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
480 |
|
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
481 |
"Modified: / 29-07-2011 / 17:42:11 / cg" |
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
482 |
! ! |
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
483 |
|
8047 | 484 |
!EncodedStream class methodsFor:'documentation'! |
485 |
||
14086 | 486 |
version |
15477 | 487 |
^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.29 2013-07-06 06:41:24 stefan Exp $' |
14086 | 488 |
! |
489 |
||
13400 | 490 |
version_CVS |
15477 | 491 |
^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.29 2013-07-06 06:41:24 stefan Exp $' |
12610 | 492 |
! |
493 |
||
18039
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
494 |
version_HG |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
495 |
|
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
496 |
^ '$Changeset: <not expanded> $' |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
497 |
! |
09806667c605
Bugfix : file-in of UTF8 encoded .st file.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18011
diff
changeset
|
498 |
|
13400 | 499 |
version_SVN |
15345 | 500 |
^ '$ Id: EncodedStream.st 10643 2011-06-08 21:53:07Z vranyj1 $' |
8047 | 501 |
! ! |
15049 | 502 |