mirror of
https://github.com/golang/go
synced 2024-09-06 00:19:45 +00:00
octal over 255 illegal example
I was curious of the behavior referring to octal values over 255. It wasn't clear if the expected behavior was a compile error, if value would be encoded as two characters, or if it would be capped at 255. This example explicitly show that octal values over 255 are illegal.
This commit is contained in:
parent
67d6a51065
commit
f6bef0379f
|
@ -529,6 +529,7 @@ escaped_char = `\` ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | `\` | "'" | `
|
|||
'aa' // illegal: too many characters
|
||||
'\xa' // illegal: too few hexadecimal digits
|
||||
'\0' // illegal: too few octal digits
|
||||
'\400' // illegal: octal value over 255
|
||||
'\uDFFF' // illegal: surrogate half
|
||||
'\U00110000' // illegal: invalid Unicode code point
|
||||
</pre>
|
||||
|
|
Loading…
Reference in a new issue