]> Cypherpunks repositories - gostls13.git/commitdiff
spec: adjust incorrect sentence in section on rune literals
authorRobert Griesemer <gri@golang.org>
Wed, 15 Jun 2022 05:08:31 +0000 (22:08 -0700)
committerRobert Griesemer <gri@google.com>
Thu, 16 Jun 2022 16:22:37 +0000 (16:22 +0000)
Add an additional example.

Fixes #53217.

Change-Id: I899376b9c1fa8dc5d475d8d3d6c8788ab79b0847
Reviewed-on: https://go-review.googlesource.com/c/go/+/412238
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
doc/go_spec.html

index cc77fd12a9470d228b06a034ed6b01030e9636d1..ab172ac40e0dfe99d840cd7f0554987e5f77d3c8 100644 (file)
@@ -502,8 +502,9 @@ After a backslash, certain single-character escapes represent special values:
 </pre>
 
 <p>
-All other sequences starting with a backslash are illegal inside rune literals.
+An unrecognized character following a backslash in a rune literal is illegal.
 </p>
+
 <pre class="ebnf">
 rune_lit         = "'" ( unicode_value | byte_value ) "'" .
 unicode_value    = unicode_char | little_u_value | big_u_value | escaped_char .
@@ -530,6 +531,7 @@ escaped_char     = `\` ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | `\` | "'" | `
 '\U00101234'
 '\''         // rune literal containing single quote character
 'aa'         // illegal: too many characters
+'\k'         // illegal: k is not recognized after a backslash
 '\xa'        // illegal: too few hexadecimal digits
 '\0'         // illegal: too few octal digits
 '\400'       // illegal: octal value over 255