author | Stefan Vogel <sv@exept.de> |
Fri, 19 Jan 2018 10:40:38 +0100 | |
changeset 22458 | fc3246d004fa |
parent 22423 | ebb20e21f75e |
child 22480 | 15005492d6bd |
permissions | -rw-r--r-- |
22421 | 1 |
"{ Encoding: utf8 }" |
2 |
||
8148 | 3 |
" |
4 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
8047 | 14 |
"{ Package: 'stx:libbasic' }" |
15 |
||
17331 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
8447
9bdea3431846
EncodedStream inherts from PeekableStream
Stefan Vogel <sv@exept.de>
parents:
8444
diff
changeset
|
18 |
PeekableStream subclass:#EncodedStream |
22415 | 19 |
instanceVariableNames:'encoder stream peekChar' |
15618 | 20 |
classVariableNames:'' |
21 |
poolDictionaries:'' |
|
15963 | 22 |
category:'Collections-Text-Encodings' |
8047 | 23 |
! |
24 |
||
8148 | 25 |
!EncodedStream class methodsFor:'documentation'! |
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
15049 | 39 |
! |
40 |
||
41 |
documentation |
|
42 |
" |
|
15664 | 43 |
a stream which transparently decodes from an external decoding, |
44 |
looking for '{ Encoding: xxx' near the beginning of the file. |
|
15049 | 45 |
|
15664 | 46 |
especially targeted towards reading ST/X source files. |
15049 | 47 |
" |
8148 | 48 |
! ! |
8047 | 49 |
|
50 |
!EncodedStream class methodsFor:'instance creation'! |
|
51 |
||
52 |
stream:streamArg encoder:encoder |
|
53 |
^ (self basicNew) stream:streamArg; encoder:encoder |
|
16394 | 54 |
|
55 |
" |
|
56 |
|s| |
|
57 |
s := EncodedStream stream:Transcript encoder:(CharacterEncoder encoderToEncodeFrom:#utf8 into:#unicode). |
|
22421 | 58 |
s nextPutAll:('öäü' utf8Encoded) |
16394 | 59 |
" |
18763 | 60 |
! |
61 |
||
62 |
stream:streamArg encoding:encodingSymbol |
|
63 |
^ self stream:streamArg encoder:(CharacterEncoder encoderFor:encodingSymbol) |
|
64 |
||
65 |
" |
|
66 |
|baseStream s| |
|
67 |
baseStream := '' readWriteStream. |
|
68 |
s := EncodedStream stream:baseStream encoding:#utf8. |
|
22421 | 69 |
s nextPutAll:'öäü'. |
18763 | 70 |
baseStream reset; contents. |
71 |
" |
|
8047 | 72 |
! ! |
73 |
||
17650 | 74 |
!EncodedStream class methodsFor:'Compatibility-VW5.4'! |
75 |
||
76 |
on: aStream encodedBy: aStreamEncoder |
|
77 |
||
78 |
^self basicNew on: aStream encodedBy: aStreamEncoder |
|
79 |
! ! |
|
80 |
||
12610 | 81 |
!EncodedStream class methodsFor:'utilities'! |
82 |
||
83 |
decodedStreamFor:aStream |
|
15345 | 84 |
"given a positionable stream, guess its encoding (by reading the |
85 |
first few lines, looking for a string with an encoding hint, |
|
86 |
and return an appropriate encoded string, which does the decoding |
|
87 |
on the fly. Used mostly to read UTF8 files (source code)" |
|
88 |
||
18763 | 89 |
|encodingSymbol decodedStream| |
12610 | 90 |
|
15664 | 91 |
aStream inputStream isPositionable ifTrue:[ |
92 |
encodingSymbol := CharacterEncoder guessEncodingOfStream:aStream inputStream. |
|
18763 | 93 |
decodedStream := self stream:aStream encoding:encodingSymbol. |
15963 | 94 |
"JV@2012-03-27: NO, DO NOT CHANGE POSITION!! Caller might be interested |
95 |
in all data!!!!!!" |
|
96 |
"/decodedStream skipEncodingChunk. |
|
15049 | 97 |
] ifFalse:[ |
98 |
"/ setup for no-encoding; |
|
99 |
"/ switch to a real encoder later, |
|
15664 | 100 |
"/ whenever an encoding pragma is encountered later by #nextChunk. |
101 |
decodedStream := self stream:aStream encoder:CharacterEncoder nullEncoderInstance. |
|
14095 | 102 |
]. |
12610 | 103 |
^ decodedStream |
15963 | 104 |
|
105 |
"Modified: / 23-08-2013 / 17:30:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
15049 | 106 |
! |
107 |
||
108 |
encoderFor:anEncodingSymbol |
|
109 |
(anEncodingSymbol isNil |
|
110 |
or:[ anEncodingSymbol = #'iso8859-1' |
|
111 |
or:[ anEncodingSymbol = #'ascii' ]]) ifTrue:[ |
|
112 |
^ nil |
|
113 |
]. |
|
114 |
^ CharacterEncoder encoderFor:anEncodingSymbol. |
|
12610 | 115 |
! ! |
116 |
||
17650 | 117 |
!EncodedStream methodsFor:'Compatibility-VW5.4'! |
118 |
||
119 |
on:aStream encodedBy:aStreamEncoder |
|
120 |
"Initialize the receiver on aStream with aStreamEncoder." |
|
121 |
||
122 |
"/ skipSize := PositionRecord new. |
|
123 |
"/ aStreamEncoder skipRecord: skipSize. |
|
124 |
"/ binary := false. |
|
125 |
"/ lineEndConvention == nil |
|
126 |
"/ ifTrue: |
|
127 |
"/ [aStream needsFileLineEndConversion |
|
128 |
"/ ifTrue: [self lineEndConvention: IOAccessor defaultLineEndConvention] |
|
129 |
"/ ifFalse: [self lineEndConvention: LineEndTransparent]]. |
|
130 |
self stream: aStream. |
|
131 |
self encoder: aStreamEncoder |
|
132 |
! ! |
|
133 |
||
8047 | 134 |
!EncodedStream methodsFor:'accessing'! |
135 |
||
136 |
encoder |
|
137 |
^ encoder |
|
138 |
! |
|
139 |
||
140 |
encoder:something |
|
141 |
encoder := something. |
|
142 |
! |
|
143 |
||
21642 | 144 |
encoding |
145 |
^ encoder nameOfEncoding |
|
146 |
||
147 |
"Created: / 13-03-2017 / 11:17:56 / stefan" |
|
148 |
! |
|
149 |
||
15593 | 150 |
inputStream |
151 |
^ stream inputStream |
|
152 |
! |
|
153 |
||
154 |
lineNumber |
|
22415 | 155 |
"the linenumber doesn't change when characters are decoded" |
156 |
||
157 |
stream isNil ifTrue:[ |
|
158 |
^ nil. |
|
159 |
]. |
|
15593 | 160 |
^ stream lineNumber |
22415 | 161 |
|
162 |
"Modified: / 02-01-2018 / 20:12:18 / stefan" |
|
163 |
"Modified (comment): / 09-01-2018 / 17:47:20 / stefan" |
|
15593 | 164 |
! |
165 |
||
12646 | 166 |
pathName |
20477 | 167 |
"if our base stream has a pathname, delegate..." |
12646 | 168 |
|
169 |
stream isNil ifTrue:[ |
|
170 |
^ nil. |
|
171 |
]. |
|
172 |
^ stream pathName. |
|
173 |
! |
|
174 |
||
11766 | 175 |
readStream |
21472 | 176 |
"read from self" |
177 |
||
11766 | 178 |
^ self |
21472 | 179 |
|
180 |
"Modified (comment): / 16-02-2017 / 15:59:52 / stefan" |
|
11766 | 181 |
! |
182 |
||
8047 | 183 |
stream |
184 |
^ stream |
|
185 |
! |
|
186 |
||
187 |
stream:something |
|
188 |
stream := something. |
|
189 |
! ! |
|
190 |
||
21472 | 191 |
!EncodedStream methodsFor:'chunk input/output'! |
15963 | 192 |
|
21472 | 193 |
nextChunk |
194 |
"as a side effect, check for an encoding chunk" |
|
195 |
||
22415 | 196 |
|chunk| |
15963 | 197 |
|
22415 | 198 |
chunk := super nextChunk. |
15963 | 199 |
|
22415 | 200 |
(encoder isNullEncoder and:[stream isPositionable not]) ifTrue:[ |
201 |
"/ encoding not already checked |
|
21472 | 202 |
"/ check if we need lazy setup of the encoder |
203 |
"/ (used with non-positionable streams) |
|
22415 | 204 |
"/ encoder for PositionableStream is set up in self class decodedStreamFor: |
205 |
(chunk notNil and:[chunk includesString:'{ Encoding:']) ifTrue:[ |
|
21472 | 206 |
|enc| |
15963 | 207 |
|
21472 | 208 |
enc := self class encoderFor:(CharacterEncoder guessEncodingOfBuffer:chunk). |
209 |
enc notNil ifTrue:[ |
|
22415 | 210 |
encoder := enc. |
211 |
^ encoder decodeString:chunk. |
|
21472 | 212 |
]. |
22415 | 213 |
]. |
15963 | 214 |
]. |
215 |
||
22415 | 216 |
^ chunk. |
217 |
||
218 |
"Modified (format): / 04-01-2018 / 00:33:57 / stefan" |
|
15963 | 219 |
! ! |
220 |
||
21642 | 221 |
!EncodedStream methodsFor:'queries'! |
222 |
||
22415 | 223 |
contentsSpecies |
224 |
^ String |
|
225 |
||
226 |
"Created: / 14-06-2005 / 17:11:01 / janfrog" |
|
227 |
"Modified: / 10-01-2018 / 11:43:57 / stefan" |
|
228 |
! |
|
229 |
||
21642 | 230 |
isEncoderFor:encodingString |
231 |
^ encoder isEncoderFor:encodingString |
|
232 |
||
233 |
"Created: / 13-03-2017 / 11:20:20 / stefan" |
|
234 |
! ! |
|
235 |
||
8047 | 236 |
!EncodedStream methodsFor:'stream protocol'! |
237 |
||
8175 | 238 |
atEnd |
22415 | 239 |
^ peekChar isNil and:[stream atEnd] |
240 |
||
241 |
"Modified: / 02-01-2018 / 21:47:17 / stefan" |
|
8175 | 242 |
! |
243 |
||
8165 | 244 |
close |
22415 | 245 |
peekChar := nil. |
8165 | 246 |
stream close |
22415 | 247 |
|
248 |
"Modified: / 09-01-2018 / 18:33:01 / stefan" |
|
8165 | 249 |
! |
250 |
||
21521 | 251 |
collection |
21522 | 252 |
"return the underlying container; nil, if there is none (eg. external streams). |
253 |
Here we return nil, as the underlying collection (if any) is useless to the outside world" |
|
21521 | 254 |
|
21522 | 255 |
^ nil |
21521 | 256 |
|
257 |
"Created: / 22-02-2017 / 11:15:00 / cg" |
|
258 |
! |
|
259 |
||
13400 | 260 |
contents |
22415 | 261 |
^String streamContents:[:s| |
262 |
[self atEnd] whileFalse:[ |
|
18157 | 263 |
|ch| |
264 |
ch := self next. |
|
265 |
"/ decoder may decide to return nil from #next, even though the |
|
266 |
"/ underlying stream was not at the end before. This is probably a bug... |
|
267 |
ch notNil ifTrue:[ |
|
268 |
s nextPut: ch |
|
269 |
] |
|
13400 | 270 |
] |
18157 | 271 |
] |
13400 | 272 |
|
273 |
"Created: / 25-02-2010 / 23:34:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
22415 | 274 |
"Modified (format): / 02-01-2018 / 19:35:10 / stefan" |
8213 | 275 |
! |
276 |
||
11992 | 277 |
emphasis:anObject |
278 |
||
279 |
stream emphasis:anObject |
|
280 |
||
281 |
"Created: / 15-06-2005 / 11:16:33 / janfrog" |
|
282 |
! |
|
283 |
||
15477 | 284 |
flush |
22415 | 285 |
peekChar := nil. |
15477 | 286 |
stream flush |
22415 | 287 |
|
288 |
"Modified: / 02-01-2018 / 19:17:40 / stefan" |
|
15477 | 289 |
! |
290 |
||
20363 | 291 |
isEmpty |
22415 | 292 |
^ stream isEmptyOrNil. |
20363 | 293 |
|
22415 | 294 |
"Modified: / 02-01-2018 / 19:59:09 / stefan" |
11946 | 295 |
! |
296 |
||
11766 | 297 |
next |
22415 | 298 |
peekChar notNil ifTrue:[ |
299 |
|p| |
|
300 |
p := peekChar. |
|
301 |
peekChar := nil. |
|
302 |
^ p. |
|
303 |
]. |
|
304 |
^ encoder readNextCharacterFrom:stream |
|
11992 | 305 |
|
306 |
"Created: / 14-06-2005 / 17:01:39 / janfrog" |
|
22415 | 307 |
"Modified: / 02-01-2018 / 19:19:29 / stefan" |
11992 | 308 |
! |
11766 | 309 |
|
22415 | 310 |
next:nCharactersToRead |
311 |
|chars| |
|
11992 | 312 |
|
22415 | 313 |
nCharactersToRead == 1 ifTrue:[ |
314 |
^ self next. |
|
315 |
]. |
|
316 |
nCharactersToRead == 0 ifTrue:[ |
|
317 |
^ ''. |
|
318 |
]. |
|
319 |
||
320 |
peekChar isNil ifTrue:[ |
|
321 |
^ encoder readNext:nCharactersToRead charactersFrom:stream. |
|
322 |
]. |
|
323 |
||
324 |
chars := encoder readNext:nCharactersToRead-1 charactersFrom:stream. |
|
325 |
chars := chars copyWithFirst:peekChar. |
|
326 |
peekChar := nil. |
|
327 |
^ chars. |
|
11992 | 328 |
|
329 |
"Created: / 16-06-2005 / 11:43:43 / masca" |
|
22415 | 330 |
"Modified: / 03-01-2018 / 22:22:51 / stefan" |
11766 | 331 |
! |
332 |
||
21472 | 333 |
nextPut:aCharacter |
334 |
encoder encodeCharacter:aCharacter on:stream. |
|
8175 | 335 |
|
21472 | 336 |
"Modified: / 16-02-2017 / 16:22:23 / stefan" |
8047 | 337 |
! |
338 |
||
339 |
nextPutAll:aCollection |
|
17668 | 340 |
encoder encodeString:aCollection on:stream |
8147 | 341 |
! |
342 |
||
17331 | 343 |
nextPutAll:aCollection startingAt:start to:stop |
17668 | 344 |
encoder encodeString:(aCollection copyFrom:start to:stop) on:stream. |
17331 | 345 |
! |
346 |
||
8444 | 347 |
peek |
22415 | 348 |
peekChar isNil ifTrue:[ |
349 |
peekChar := self next. |
|
350 |
]. |
|
351 |
^ peekChar |
|
11992 | 352 |
|
353 |
"Created: / 20-06-2005 / 10:13:03 / masca" |
|
354 |
"Modified: / 20-06-2005 / 13:06:14 / masca" |
|
22415 | 355 |
"Modified (format): / 02-01-2018 / 19:21:00 / stefan" |
8175 | 356 |
! |
357 |
||
8165 | 358 |
position |
22415 | 359 |
"only use #position/#position: to restore a previous position. |
360 |
Computing relative positions does not work!!" |
|
361 |
||
22421 | 362 |
|pos| |
22415 | 363 |
|
22421 | 364 |
pos := stream position. |
365 |
peekChar notNil ifTrue:[ |
|
366 |
"#position: nils peekChar - make sure, that it positions before peekChar" |
|
22423 | 367 |
pos := pos - (encoder characterSize:peekChar). |
22421 | 368 |
]. |
369 |
^ pos. |
|
370 |
||
22423 | 371 |
"Modified: / 15-01-2018 / 22:42:01 / stefan" |
8165 | 372 |
! |
373 |
||
8197 | 374 |
position0Based |
15618 | 375 |
<resource: #obsolete> |
11947 | 376 |
"to be obsoleted - use position" |
377 |
||
15618 | 378 |
^ stream position |
8197 | 379 |
! |
380 |
||
381 |
position0Based:newPosition |
|
15618 | 382 |
<resource: #obsolete> |
11947 | 383 |
"to be obsoleted - use position" |
384 |
||
15618 | 385 |
stream position:newPosition |
8197 | 386 |
! |
387 |
||
8175 | 388 |
position1Based |
15618 | 389 |
<resource: #obsolete> |
11947 | 390 |
"to be obsoleted - use position" |
391 |
||
22415 | 392 |
^ stream position1Based |
393 |
||
394 |
"Modified: / 02-01-2018 / 20:00:57 / stefan" |
|
8175 | 395 |
! |
396 |
||
8147 | 397 |
position1Based:newPosition |
15618 | 398 |
<resource: #obsolete> |
11947 | 399 |
"to be obsoleted - use position" |
400 |
||
22415 | 401 |
stream position1Based:newPosition |
402 |
||
403 |
"Modified: / 02-01-2018 / 20:00:46 / stefan" |
|
8175 | 404 |
! |
405 |
||
8197 | 406 |
position:newPosition |
22415 | 407 |
"only use #position/#position: to restore a previous position. |
408 |
Computing relative positions does not work!! |
|
409 |
Use #skip: to advance forward." |
|
410 |
||
411 |
peekChar := nil. |
|
8197 | 412 |
stream position:newPosition |
22415 | 413 |
|
414 |
"Modified (comment): / 09-01-2018 / 17:53:04 / stefan" |
|
8197 | 415 |
! |
416 |
||
13400 | 417 |
reset |
22415 | 418 |
peekChar := nil. |
13400 | 419 |
stream reset |
420 |
||
421 |
"Created: / 25-02-2010 / 23:37:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
22415 | 422 |
"Modified: / 02-01-2018 / 19:34:20 / stefan" |
13400 | 423 |
! |
424 |
||
8213 | 425 |
setToEnd |
22415 | 426 |
peekChar := nil. |
8213 | 427 |
stream setToEnd |
22415 | 428 |
|
429 |
"Modified (comment): / 09-01-2018 / 17:50:27 / stefan" |
|
8213 | 430 |
! |
431 |
||
14333 | 432 |
size |
20363 | 433 |
"not always correct, but probably better than 0. |
434 |
Better use #isEmpty." |
|
14333 | 435 |
|
15585 | 436 |
"/ is that better? |
437 |
"/ self error:'size of input is unknown (due to decoding)' |
|
14333 | 438 |
^ stream size |
439 |
||
440 |
"Created: / 31-08-2012 / 16:52:40 / cg" |
|
441 |
! |
|
442 |
||
15477 | 443 |
sync |
444 |
stream sync |
|
445 |
! |
|
446 |
||
447 |
syncData |
|
448 |
stream syncData |
|
8047 | 449 |
! ! |
450 |
||
15049 | 451 |
!EncodedStream methodsFor:'testing'! |
452 |
||
453 |
isEncodedStream |
|
454 |
^ true |
|
15963 | 455 |
|
456 |
"Created: / 04-02-2014 / 20:27:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
15592 | 457 |
! |
458 |
||
22415 | 459 |
isOpen |
460 |
"for compatibility with externalStream: |
|
461 |
return true, if this stream is open." |
|
462 |
||
463 |
^ stream notNil and:[stream isOpen]. |
|
464 |
||
465 |
"Modified (comment): / 09-01-2018 / 18:34:47 / stefan" |
|
466 |
! |
|
467 |
||
16258
1582c656cdb0
Added EncodedStream>>isPositionable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15963
diff
changeset
|
468 |
isPositionable |
1582c656cdb0
Added EncodedStream>>isPositionable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15963
diff
changeset
|
469 |
^ stream isPositionable |
1582c656cdb0
Added EncodedStream>>isPositionable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15963
diff
changeset
|
470 |
|
1582c656cdb0
Added EncodedStream>>isPositionable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15963
diff
changeset
|
471 |
"Created: / 14-03-2014 / 16:18:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1582c656cdb0
Added EncodedStream>>isPositionable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15963
diff
changeset
|
472 |
! |
1582c656cdb0
Added EncodedStream>>isPositionable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15963
diff
changeset
|
473 |
|
15592 | 474 |
isReadable |
475 |
^ stream isReadable |
|
476 |
! |
|
477 |
||
478 |
isWritable |
|
479 |
^ stream isWritable |
|
15049 | 480 |
! ! |
481 |
||
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
482 |
!EncodedStream methodsFor:'utilities'! |
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
483 |
|
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
484 |
skipEncodingChunk |
14091 | 485 |
|pos chunk token| |
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
486 |
|
13525
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
487 |
stream isPositionable ifFalse:[ |
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
488 |
^ self |
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
489 |
]. |
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
490 |
|
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
491 |
pos := self position. |
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
492 |
chunk := self nextChunk. |
14084 | 493 |
[ |
494 |
"/ if this is a valid chunk (i.e. not a comment or encoding-directive), |
|
495 |
"/ then position back, so it will be processed as usual. |
|
14091 | 496 |
"/ We could parse here, but this is overkill, since we are only interested in the fact, |
497 |
"/ that there is anything else than a comment in the chunk. |
|
498 |
"/ result := (Parser for:chunk) |
|
499 |
"/ ignoreErrors:true; |
|
500 |
"/ ignoreWarnings:true; |
|
501 |
"/ parseMethodBody. |
|
502 |
||
503 |
token := (Scanner for:chunk) |
|
504 |
ignoreErrors:true; |
|
505 |
ignoreWarnings:true; |
|
506 |
nextToken. |
|
507 |
||
508 |
token ~= #EOF ifTrue:[ |
|
14084 | 509 |
self position:pos |
510 |
]. |
|
14086 | 511 |
] on:Parser parseWarningSignal do:[:ex| |
14084 | 512 |
"really ignore any error. |
21472 | 513 |
Even setting ignoreError will output diagnostics here |
14084 | 514 |
during standalone startup when debugging" |
14086 | 515 |
ex proceedWith:#ignore. |
14084 | 516 |
]. |
13525
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
517 |
|
e17ebc11ca73
changed: #skipEncodingChunk
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
518 |
"Modified: / 29-07-2011 / 17:42:11 / cg" |
21472 | 519 |
"Modified (format): / 16-02-2017 / 16:01:09 / stefan" |
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
520 |
! ! |
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8459
diff
changeset
|
521 |
|
8047 | 522 |
!EncodedStream class methodsFor:'documentation'! |
523 |
||
14086 | 524 |
version |
18763 | 525 |
^ '$Header$' |
14086 | 526 |
! |
527 |
||
13400 | 528 |
version_CVS |
18763 | 529 |
^ '$Header$' |
12610 | 530 |
! |
531 |
||
13400 | 532 |
version_SVN |
15345 | 533 |
^ '$ Id: EncodedStream.st 10643 2011-06-08 21:53:07Z vranyj1 $' |
8047 | 534 |
! ! |
15049 | 535 |