CharacterWriteStream.st
changeset 24648 a19f893311d9
parent 24642 95ccaa31c09f
child 25118 b375fd4078c2
--- a/CharacterWriteStream.st	Mon Aug 26 23:13:04 2019 +0200
+++ b/CharacterWriteStream.st	Mon Aug 26 23:13:18 2019 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 2005 by eXept Software AG
               All Rights Reserved
@@ -179,6 +177,7 @@
 
 nextPut:aCharacter
     "append the argument, aCharacter to the stream.
+     Answer aCharacter.
      Specially tuned for appending to String, Unicode16String and Unicode32String streams."
 
 %{  /* NOCONTEXT */
@@ -212,7 +211,7 @@
                         __INST(readLimit) = __mkSmallInteger(pos);
                     }
                     __INST(position) = __mkSmallInteger(__intVal(__INST(position)) + 1);
-                    RETURN ( self );
+                    RETURN ( aCharacter );
                 }
             } else if (cls == @global(Unicode16String)) {
                 if (ch > 0xFFFF) {
@@ -224,7 +223,7 @@
                         __INST(readLimit) = __mkSmallInteger(pos);
                     }
                     __INST(position) = __mkSmallInteger(__intVal(__INST(position)) + 1);
-                    RETURN ( self );
+                    RETURN ( aCharacter );
                 }
             } else if (cls == @global(Unicode32String)) {
                 if ((pos <= __unicode32StringSize(coll))) {
@@ -233,7 +232,7 @@
                         __INST(readLimit) = __mkSmallInteger(pos);
                     }
                     __INST(position) = __mkSmallInteger(__intVal(__INST(position)) + 1);
-                    RETURN ( self );
+                    RETURN ( aCharacter );
                 }
             }
         }
@@ -242,7 +241,6 @@
 #endif
 %}.
 
-
     (writeLimit isNil
      or:[(position + 1) <= writeLimit]) ifTrue:[
         |needCharacterSize|
@@ -259,6 +257,7 @@
     ] ifFalse:[
         WriteError raiseErrorString:'write beyond writeLimit'
     ].
+    ^ aCharacter
 !
 
 nextPutAll:aCollection