--- a/ReadStream.st Fri May 05 14:44:38 2006 +0200
+++ b/ReadStream.st Mon May 08 09:07:39 2006 +0200
@@ -450,63 +450,6 @@
^ collection at:(position + 1 - ZeroPosition)
!
-nextSymbol
- "read the next selector-symbol (i.e. up to non letter-or-digit).
- return a string containing those characters.
- - tuned for speed on String-Streams for faster scanning"
-%{
- int pos, limit, sz;
- int len;
- char buffer[256];
- REGISTER unsigned char *cp;
- REGISTER unsigned ch;
- OBJ coll, p, l;
-
- coll = __INST(collection);
- p = __INST(position);
- l = __INST(readLimit);
-
- if (__isString(coll) && __bothSmallInteger(p, l)) {
-
- pos = __intVal(p);
- /* make 1-based */
- pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition));
- limit = __intVal(l);
- sz = __qSize(coll) - OHDR_SIZE;
- if (sz < limit)
- limit = sz;
- cp = __stringVal(coll) + pos - 1;
-
- len = 0;
- for (;;) {
- if (pos > limit) break;
- ch = *cp;
-
- if (! (((ch >= 'a') && (ch <= 'z')) ||
- ((ch >= 'A') && (ch <= 'Z')) ||
- ((ch >= '0') && (ch <= '9')) ||
- (ch == ':')))
- break;
- buffer[len++] = ch;
- if (len >= (sizeof(buffer)-1)) {
- /* emergency */
- break;
- }
- pos++;
- cp++;
- }
-
- /* make ZeroPosition-based */
- pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition));
- __INST(position) = __mkSmallInteger(pos);
- buffer[len] = '\0';
- RETURN ( (len != 0) ? __MKSTRING_L(buffer, len) : nil );
- }
-%}
-.
- ^ super nextSymbol
-!
-
peek
"return the next element; do NOT advance read pointer.
return nil, if there is no next element.
@@ -792,5 +735,5 @@
!ReadStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.56 2006-03-28 14:34:56 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.57 2006-05-08 07:07:39 stefan Exp $'
! !