“escape-sequence” in documentation

In the swift official documentation: "the swift programming language"-"LANGUAGE REFERENCE"-"Lexical Structure"-"String Literals"-"GRAMMAR OF A STRING LITERAL".

It says:
escape-sequence → \ extended-string-literal-delimiter

and

"extended-string-literal-delimiter → 

extended-string-literal-delimiter opt"


I think:
escape-sequence SHOULD → \  NOT → \ extended-string-literal-delimiter

Am I right? Thanks in advance.



Answered by OOPer in 625229022
As far as I checked, there are many incorrect parts in the Lexical Structure section, and I think escape-sequence should be:

escape-sequence → \ extended-string-literal-delimiter opt

When you write a String literal like ###"..."###, \### is a valid escape sequence.
Code Block
let str = ###"abc\r\n\###r\###n"###

is equivalent to:
Code Block
let str = "abc\\r\\n\r\n"


You should better check this article:
Behind the Proposal — SE-0200 Enhancing String Literals Delimiters to Support Raw Text

Accepted Answer
As far as I checked, there are many incorrect parts in the Lexical Structure section, and I think escape-sequence should be:

escape-sequence → \ extended-string-literal-delimiter opt

When you write a String literal like ###"..."###, \### is a valid escape sequence.
Code Block
let str = ###"abc\r\n\###r\###n"###

is equivalent to:
Code Block
let str = "abc\\r\\n\r\n"


You should better check this article:
Behind the Proposal — SE-0200 Enhancing String Literals Delimiters to Support Raw Text

I get it, thank you very much.
“escape-sequence” in documentation
 
 
Q