[Pharo-project] how to deal with string position in relation to cr/crlf

2011-04-28 Thread Tudor Girba
Hi, 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

Re: [Pharo-project] how to deal with string position in relation to cr/crlf

2011-04-28 Thread Toon Verwaest
What is the problem exactly? Do you somewhere rely on exact position in the complete string? 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 to 0. On Apr 28, 2011 10:48 AM, Tudor Girba

Re: [Pharo-project] how to deal with string position in relation to cr/crlf

2011-04-28 Thread Alexandre Bergel
I experienced a similar problem when I worked on CAnalyzer. What I did is simply to remove all lf characters before doing anything. Alexandre Le 28 avr. 2011 à 04:47, Tudor Girba tudor.gi...@gmail.com a écrit : Hi, I have a small problem related to file line endings and storing the

Re: [Pharo-project] how to deal with string position in relation to cr/crlf

2011-04-28 Thread Nicolas Cellier
I would say you'll have problems if an only if you mix pointers - on transformed streams - and on OS-native line-end transparent streams... You'll have to arrange to either: - always used a transformed stream - or always use a native line-end transparent stream. New utilities in Pharo and Squeak