From ch|r|com @end|ng |rom goog|e@com  Sun Feb 12 06:07:39 2023
From: ch|r|com @end|ng |rom goog|e@com (Michael Chirico)
Date: Sat, 11 Feb 2023 21:07:39 -0800
Subject: [Rd] Line-terminal \ in character consants -- missing from ?Quotes ?
Message-ID: <CAD7Bkx91sEPFAwSc_od5UgOZ7tW9=k43hRgWVi8srv2nnLgh9w@mail.gmail.com>

I'm coming across some code that uses the fact the parser ignores a
line-terminal '\', e.g.

identical("\
", "\n")
# [1] TRUE

x = "abc \
def"
y = "abc \ndef"
identical(x, y)
# [1] TRUE

However:
identical("\\n", "\n")
# [1] FALSE

This appears to be undocumented behavior; the closest thing I see in
?Quotes suggests it should be an error:

> Escaping a character not in the following table is an error.

('\n' is in the table, but my understanding is the 'n' is what's being
escaped v-a-v the "error", which seems confirmed by the third, FALSE,
example above)

Is this a bug, is the omission from ?Quotes a bug, or is this just
undocumented behavior?

Mike C



[Rd] Line-terminal \ in character consants -- missing from ?Quotes ?
Michael Chirico