[Pharo-project] how to deal with string position in relation to cr/crlf
toon.verwaest at gmail.com
Thu Apr 28 10:55:11 CEST 2011
What is the problem exactly? Do you somewhere rely on exact position in the
What you could do is just keep line + column number since that stays fixed.
Just increment newline on the systems newline sequence, and set column back
On Apr 28, 2011 10:48 AM, "Tudor Girba" <tudor.girba at gmail.com> wrote:
> I have a small problem related to file line endings and storing the token
information of PetitParser.
> Sometimes, we parse the sources on Windows and then manipulate the model
on Linux or Mac. In this context, if I store the token positions in a
string, I encounter problems because CR and LF are considered characters,
but the line endings can vary.
> ('abc', Character cr asString , 'd') findString: 'd'.
> ==> 5
> ('abc', Character cr asString , Character lf asString, 'd') findString:
> ==> 6
> How would you approach this problem?
> "Every thing has its own flow."
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-project