1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:57:57 -07:00

spec: skip carriage returns in raw literals

This change guarantees that whether the line ending convention
when the source is created includes carriage returns is irrelevant
to the value of the string. See issue 680.

The compilers do not yet implement this.

R=golang-dev, adg, r, gri, rsc, iant
CC=golang-dev
https://golang.org/cl/5491043
This commit is contained in:
Rob Pike 2011-12-14 21:52:41 -08:00
parent 2ad8a9c507
commit c26ca912e5

View File

@ -1,5 +1,5 @@
<!-- title The Go Programming Language Specification --> <!-- title The Go Programming Language Specification -->
<!-- subtitle Version of December 13, 2011 --> <!-- subtitle Version of December 14, 2011 -->
<!-- <!--
TODO TODO
@ -454,6 +454,8 @@ back quote. The value of a raw string literal is the
string composed of the uninterpreted characters between the quotes; string composed of the uninterpreted characters between the quotes;
in particular, backslashes have no special meaning and the string may in particular, backslashes have no special meaning and the string may
span multiple lines. span multiple lines.
Carriage returns inside raw string literals
are discarded from the raw string value.
</p> </p>
<p> <p>
Interpreted string literals are character sequences between double Interpreted string literals are character sequences between double