extra entry to store a chunk without appending a chunk-separator
authorClaus Gittinger <cg@exept.de>
Sat, 09 Dec 1995 15:57:29 +0100
changeset 718 6f8222ff2ff0
parent 717 a9d03e3c21cf
child 719 c557a530f971
extra entry to store a chunk without appending a chunk-separator
PosStream.st
PositionableStream.st
--- a/PosStream.st	Sat Dec 09 15:46:03 1995 +0100
+++ b/PosStream.st	Sat Dec 09 15:57:29 1995 +0100
@@ -203,10 +203,26 @@
     "put aString as a chunk onto the receiver;
      double all exclamation marks except within primitives and append a 
      single delimiting exclamation mark at the end.
-     This modification of the chunk format was done to have primitive
-     code more readable. (since it must be edited using the fileBrowser).
+     This modification of the chunk format (not doubling exclas in primitive code)
+     was done to have primitive code more readable and easier be edited in the fileBrowser
+     or other editors.
      Its no incompatibility, since inline primitives are an ST/X special
-     anyway."
+     and code containing ST/X primitives cannot be loaded into other smalltalks anyway."
+
+    self nextPutAllAsChunk:aString.
+    self nextPut:ChunkSeparator
+
+    "Modified: 9.12.1995 / 15:56:54 / cg"
+!
+
+nextPutAllAsChunk:aString
+    "put aString as a chunk onto the receiver;
+     double all exclamation marks except within primitives.
+     This modification of the chunk format (not doubling exclas in primitive code)
+     was done to have primitive code more readable and easier be edited in the fileBrowser
+     or other editors.
+     Its no incompatibility, since inline primitives are an ST/X special
+     and code containing ST/X primitives cannot be loaded into other smalltalks anyway."
 
     |sep stopChars inPrimitive character
      index    "{ Class:SmallInteger }"
@@ -223,52 +239,51 @@
     stop := endIndex + 1.
 
     [index <= endIndex] whileTrue:[
-	"
-	 find position of next interresting character; 
-	 output stuff up to that one in one piece
-	"
-	next := aString indexOfAny:stopChars startingAt:index ifAbsent:stop.
+        "
+         find position of next interresting 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
+        ]
     ].
-    self nextPut:sep
 
-    "Modified: 10.11.1995 / 16:04:49 / cg"
+    "Modified: 9.12.1995 / 15:56:47 / cg"
 !
 
 nextPutChunkSeparator
@@ -532,6 +547,6 @@
 !PositionableStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/PosStream.st,v 1.35 1995-12-07 21:37:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/PosStream.st,v 1.36 1995-12-09 14:57:29 cg Exp $'
 ! !
 PositionableStream initialize!
--- a/PositionableStream.st	Sat Dec 09 15:46:03 1995 +0100
+++ b/PositionableStream.st	Sat Dec 09 15:57:29 1995 +0100
@@ -203,10 +203,26 @@
     "put aString as a chunk onto the receiver;
      double all exclamation marks except within primitives and append a 
      single delimiting exclamation mark at the end.
-     This modification of the chunk format was done to have primitive
-     code more readable. (since it must be edited using the fileBrowser).
+     This modification of the chunk format (not doubling exclas in primitive code)
+     was done to have primitive code more readable and easier be edited in the fileBrowser
+     or other editors.
      Its no incompatibility, since inline primitives are an ST/X special
-     anyway."
+     and code containing ST/X primitives cannot be loaded into other smalltalks anyway."
+
+    self nextPutAllAsChunk:aString.
+    self nextPut:ChunkSeparator
+
+    "Modified: 9.12.1995 / 15:56:54 / cg"
+!
+
+nextPutAllAsChunk:aString
+    "put aString as a chunk onto the receiver;
+     double all exclamation marks except within primitives.
+     This modification of the chunk format (not doubling exclas in primitive code)
+     was done to have primitive code more readable and easier be edited in the fileBrowser
+     or other editors.
+     Its no incompatibility, since inline primitives are an ST/X special
+     and code containing ST/X primitives cannot be loaded into other smalltalks anyway."
 
     |sep stopChars inPrimitive character
      index    "{ Class:SmallInteger }"
@@ -223,52 +239,51 @@
     stop := endIndex + 1.
 
     [index <= endIndex] whileTrue:[
-	"
-	 find position of next interresting character; 
-	 output stuff up to that one in one piece
-	"
-	next := aString indexOfAny:stopChars startingAt:index ifAbsent:stop.
+        "
+         find position of next interresting 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
+        ]
     ].
-    self nextPut:sep
 
-    "Modified: 10.11.1995 / 16:04:49 / cg"
+    "Modified: 9.12.1995 / 15:56:47 / cg"
 !
 
 nextPutChunkSeparator
@@ -532,6 +547,6 @@
 !PositionableStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.35 1995-12-07 21:37:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.36 1995-12-09 14:57:29 cg Exp $'
 ! !
 PositionableStream initialize!