[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New TextRider & oo2c patch
> Date: Mon, 29 Jun 1998 09:11:19 -0500
> From: "Mark K. Gardner" <mkgardne@rtsl3.cs.uiuc.edu>
>
> If we assume that a text file will only contain one of the three EOL
> conventions and if ASCII.CR ASCII.LF cannot be used in any other way
> (reasonable assumptions), we can distinguish the convention being used
> without attempting a (possibly blocking) lookahead.
I don't think your proposal works. Here are three examples:
1) r.Eol() needs to return _without_ inspecting the character after
the end-of-line, and, of course, it cannot return `FALSE' just to be
on the save side.
2) if r.ReadLine() runs into a CR without knowing if eol is CR or
CR+LF, it cannot decide if the CR is part of the line, or if it is its
eol. In the first case it needs to read further, in the second it
must return without inspecting the next char.
3) SkipBlanks with `returnCtrlChars' set: the procedure has to decide
whether a CR is whitespace or not, with the usual "peek ahead"
dilemma.
-- mva