[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
TextRider bug on last token
- To: ooc-list@informatik.uni-kl.de
- Subject: TextRider bug on last token
- From: Ian Rae <ianrae@istar.ca>
- Date: Wed, 24 Jun 1998 00:13:26 -0400
- MMDF-Warning: Parse error in original version of preceding line at uklirb.informatik.uni-kl.de
Two things:
1. There appears to be a bug in TextRider.ReadLInt(). If the integer
token has no other characters
following it in the input stream, the token is not read and "reading past
end of input stream" error is returned.
Here is the code:
(* accumulate the digits *)
WHILE (r.byteReader.res=done) & CharClass.IsNumeric(str[pos]) DO
INC(pos); r.ReadChar(str[pos])
END;
(* convert to an integer *)
IF r.byteReader.res#done THEN RETURN END; <== Give up if at end of
input. Wrong.
r.UngetChar(str[pos]); str[pos]:=0X;
IntStr.StrToInt(str, lint, res);
I downloaded 002c 1.3.7 but couldn't find TextRider.Mod. Perhaps this bug
has been fixed since ooc 1.13?
2. A small change request for Channel.Mod. Please add the following field:
eolType-: INTEGER;
(* Type of end-of-line char(s) this channel has.
0=lf, 1=cr/lf, 2=cr.
*)
This is necessary because my portable text i/o library supports several
types
of channels. The BBox implementation supports Files and Texts (the
Bbox text object). These have different eol characters: cr/lf and cr
respectively.
TextRider needs to be able to sense and generate eol chars for any
Channel.
There is no other place to put this information except Channel.Mod.
If this change is acceptable, I can send the mods for TextRider.Mod as
well,
which are mainly to deal with 1 or 2 char eol sequences.
Cheers,
--Ian