Re: Line-number references wrong by several lines
Re: Line-number references wrong by several lines
- Subject: Re: Line-number references wrong by several lines
- From: Jeffrey Oleander <email@hidden>
- Date: Sat, 2 Feb 2008 20:32:12 -0800 (PST)
> Steve Sisak <email@hidden> wrote:
>> At 2008-02-01 12:47 +0100, Markus Hitter wrote:
>> Because there is no definite solution to this?
>> Is \n\r\n an empty Unix line followed by an
>> empty DOS line or is it a Unix line followed
>> by a Mac line and another Unix line?
By general practice it's a line-feed (go down one line
moving neither to right nor left) followed by a
carriage-return (go all the way to the left without moving
up or down) followed by a line-feed. By specific
practice, OTOH... we have a small mess.
> There's a very simple algorithm:
> 1) As you're parsing through a stream and see either \n
> or \r treat it an end of line and remember which you saw.
> 2) If the next character in the stream is the other, drop
> it.
> This handles any of \n \r \r\n or \n\r with a worst case
> failure of an extra blank line or dropped blank line in a
> file with mixed line endings which, for most things
> (including code) isn't an issue.
Why not treat them as line-feeds and carriage-returns?
But, given that we do have 3-5 conventions, your algorithm
fails to correctly figure out which is intended for this
particular file.
The Xcode editor does OK in giving us the chance to set how
we want the file to be treated, but perhaps the debugger's
line counting should pay better attention to the setting
for each file. Ahhh, yet another nitpicky complication for
it to deal with (like getting e-mail clients to deal with
the different date formats and display them in one's
preferred way :B-)
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden