Em 2/3/2010 13:53, Russell McMahon escreveu: >> end-of-line needs to be well defined and strictly observed. What >> combination of CR/LF is treated as a end-of-line? If the compiler >> encounters CR on its own should it be treated as end-of-line? Should CR/= LF >> be treated the same as LF/CR? Should CR/CR/LF be treated as 1 end-of-line >> or 2? What about LF/LF/CR? what happens when you mix and match LF and CR >> as end-of-line in the same source? How many end-of-line is one "vertical >> tab" or "form feed" equivalent too? >> = > > Your pint is well taken but, seing you asked ;-), a wrokable rulle seems = to be. > > - Any contiguous group of CR or LF caharcters is taken a s single EOL. > > This may break some visual formatting but seems liable to work for > code compilation. > > Vertical tab or form feed can be given rules which also do not "break" > compilation. > > The present problems seemed to arose froman isolated CR NOT being > ddemd to be an EOL at all. > Some systems may allow it as of right, but I'd consider that strange. > > > > RM > = When I write code for parsers, I use something like this: if( *p =3D=3D '\r' ) { p++; if( *p =3D=3D '\n' ) p++; return EOL; } else if( *p =3D=3D '\n' ) { p++; if( *p =3D=3D '\r' ) p++; return EOL; } else ... This give good results independently of how the line endings are configured. Regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist