[Issue 2201] Unescaped carriage return ('\r') in string is changed into different EOL.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 7 18:58:53 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2201





------- Comment #2 from business3 at twistedpairgaming.com  2008-07-07 20:58 -------
(In reply to comment #1)

Ok, I just looked it up. According to the documentation
(http://www.digitalmars.com/d/1.0/lex.html ) (The ver 2.0 docs say the same
thing too):

"All characters between the r" and " are part of the string except for
EndOfLine which is regarded as a single \n character."

And EndOfLine is defined as such:

EndOfLine:
        \u000D
        \u000A
        \u000D \u000A
        EndOfFile

So, strictly speaking, even the current behavior is still wrong according to
the docs (According to the docs, "\n", "\r", "\r\n" and EOF should all turn
into "\n").

Although I'm still not convinced that "\n", "\r", and "\r\n" shouldn't just be
left as-is.


-- 



More information about the Digitalmars-d-bugs mailing list