--- a/PosStream.st Tue Apr 21 15:58:50 1998 +0200
+++ b/PosStream.st Tue Apr 21 18:55:28 1998 +0200
@@ -265,60 +265,62 @@
stop "{ Class:SmallInteger }"
next "{ Class:SmallInteger }"|
+ endIndex := aString size.
+ endIndex == 0 ifTrue:[^ self].
+
sep := ChunkSeparator.
stopChars := '{}' copyWith:sep.
inPrimitive := false.
index := 1.
- endIndex := aString size.
stop := endIndex + 1.
[index <= endIndex] whileTrue:[
- "
- find position of next interesting character;
- output stuff up to that one in one piece
- "
- next := aString indexOfAny:stopChars startingAt:index ifAbsent:stop.
+ "
+ find position of next interesting character;
+ output stuff up to that one in one piece
+ "
+ next := aString indexOfAny:stopChars startingAt:index ifAbsent:stop.
- ((index == 1) and:[next == stop]) ifTrue:[
- self nextPutAll:aString
- ] ifFalse:[
- self nextPutAll:aString startingAt:index to:(next - 1)
- ].
+ ((index == 1) and:[next == stop]) ifTrue:[
+ self nextPutAll:aString
+ ] ifFalse:[
+ self nextPutAll:aString startingAt:index to:(next - 1)
+ ].
- index := next.
- (index <= endIndex) ifTrue:[
- character := aString at:index.
+ index := next.
+ (index <= endIndex) ifTrue:[
+ character := aString at:index.
- (character == ${ ) ifTrue:[
- "/ starts a primitive
- ((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[
- inPrimitive := true
- ]
- ] ifFalse:[
- "/ ends a primitive
- (character == $} ) ifTrue:[
- ((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[
- inPrimitive := false
- ]
- ] ifFalse:[
- "/
- "/ exclas have to be doubled - except if within a primitive
- "/
- inPrimitive ifFalse:[
- (character == sep) ifTrue:[
- self nextPut:sep
- ]
- ]
- ]
- ].
+ (character == ${ ) ifTrue:[
+ "/ starts a primitive
+ ((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[
+ inPrimitive := true
+ ]
+ ] ifFalse:[
+ "/ ends a primitive
+ (character == $} ) ifTrue:[
+ ((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[
+ inPrimitive := false
+ ]
+ ] ifFalse:[
+ "/
+ "/ exclas have to be doubled - except if within a primitive
+ "/
+ inPrimitive ifFalse:[
+ (character == sep) ifTrue:[
+ self nextPut:sep
+ ]
+ ]
+ ]
+ ].
- self nextPut:character.
- index := index + 1
- ]
+ self nextPut:character.
+ index := index + 1
+ ]
].
- "Modified: 9.12.1995 / 15:56:47 / cg"
+ "Modified: / 21.4.1998 / 17:22:47 / cg"
!
nextPutChunkSeparator
@@ -787,6 +789,6 @@
!PositionableStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/PosStream.st,v 1.62 1998-01-29 22:06:26 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/PosStream.st,v 1.63 1998-04-21 16:55:28 cg Exp $'
! !
PositionableStream initialize!
--- a/PositionableStream.st Tue Apr 21 15:58:50 1998 +0200
+++ b/PositionableStream.st Tue Apr 21 18:55:28 1998 +0200
@@ -265,60 +265,62 @@
stop "{ Class:SmallInteger }"
next "{ Class:SmallInteger }"|
+ endIndex := aString size.
+ endIndex == 0 ifTrue:[^ self].
+
sep := ChunkSeparator.
stopChars := '{}' copyWith:sep.
inPrimitive := false.
index := 1.
- endIndex := aString size.
stop := endIndex + 1.
[index <= endIndex] whileTrue:[
- "
- find position of next interesting character;
- output stuff up to that one in one piece
- "
- next := aString indexOfAny:stopChars startingAt:index ifAbsent:stop.
+ "
+ find position of next interesting character;
+ output stuff up to that one in one piece
+ "
+ next := aString indexOfAny:stopChars startingAt:index ifAbsent:stop.
- ((index == 1) and:[next == stop]) ifTrue:[
- self nextPutAll:aString
- ] ifFalse:[
- self nextPutAll:aString startingAt:index to:(next - 1)
- ].
+ ((index == 1) and:[next == stop]) ifTrue:[
+ self nextPutAll:aString
+ ] ifFalse:[
+ self nextPutAll:aString startingAt:index to:(next - 1)
+ ].
- index := next.
- (index <= endIndex) ifTrue:[
- character := aString at:index.
+ index := next.
+ (index <= endIndex) ifTrue:[
+ character := aString at:index.
- (character == ${ ) ifTrue:[
- "/ starts a primitive
- ((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[
- inPrimitive := true
- ]
- ] ifFalse:[
- "/ ends a primitive
- (character == $} ) ifTrue:[
- ((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[
- inPrimitive := false
- ]
- ] ifFalse:[
- "/
- "/ exclas have to be doubled - except if within a primitive
- "/
- inPrimitive ifFalse:[
- (character == sep) ifTrue:[
- self nextPut:sep
- ]
- ]
- ]
- ].
+ (character == ${ ) ifTrue:[
+ "/ starts a primitive
+ ((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[
+ inPrimitive := true
+ ]
+ ] ifFalse:[
+ "/ ends a primitive
+ (character == $} ) ifTrue:[
+ ((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[
+ inPrimitive := false
+ ]
+ ] ifFalse:[
+ "/
+ "/ exclas have to be doubled - except if within a primitive
+ "/
+ inPrimitive ifFalse:[
+ (character == sep) ifTrue:[
+ self nextPut:sep
+ ]
+ ]
+ ]
+ ].
- self nextPut:character.
- index := index + 1
- ]
+ self nextPut:character.
+ index := index + 1
+ ]
].
- "Modified: 9.12.1995 / 15:56:47 / cg"
+ "Modified: / 21.4.1998 / 17:22:47 / cg"
!
nextPutChunkSeparator
@@ -787,6 +789,6 @@
!PositionableStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.62 1998-01-29 22:06:26 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.63 1998-04-21 16:55:28 cg Exp $'
! !
PositionableStream initialize!