mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
doc: add illegal octal over 255 example
Octal values over 255, like \400 or \777, are illegal. It wasn't clear if the expected behavior was a compile error, encoding the value as two characters, or if the value would be capped at 255.
This example explicitly shows that octal values over 255 are illegal.
Change-Id: I45d94680107029c5f083e5d434e6270cc5b258c1
GitHub-Last-Rev: f6bef0379f
GitHub-Pull-Request: golang/go#52111
Reviewed-on: https://go-review.googlesource.com/c/go/+/397555
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
parent
8a816d5efc
commit
01c83be793
|
@ -529,6 +529,7 @@ escaped_char = `\` ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | `\` | "'" | `
|
||||||
'aa' // illegal: too many characters
|
'aa' // illegal: too many characters
|
||||||
'\xa' // illegal: too few hexadecimal digits
|
'\xa' // illegal: too few hexadecimal digits
|
||||||
'\0' // illegal: too few octal digits
|
'\0' // illegal: too few octal digits
|
||||||
|
'\400' // illegal: octal value over 255
|
||||||
'\uDFFF' // illegal: surrogate half
|
'\uDFFF' // illegal: surrogate half
|
||||||
'\U00110000' // illegal: invalid Unicode code point
|
'\U00110000' // illegal: invalid Unicode code point
|
||||||
</pre>
|
</pre>
|
||||||
|
|
Loading…
Reference in a new issue