ww source: reject raw NUL characters
This commit is contained in:
10
docs/spec.md
10
docs/spec.md
@@ -60,6 +60,16 @@ every other source position, including inside string and rune literals and
|
||||
comments. Apart from that marker rule, the lexer operates on bytes and
|
||||
non-ASCII bytes are legal only inside string and rune literals and comments.
|
||||
|
||||
Each raw byte `00` (U+0000) is invalid at every physical source position,
|
||||
including in comments and string or rune literal text. It produces one
|
||||
positioned `invalid NUL character` error at that byte's source position and
|
||||
is omitted from the lexer's logical character stream before token recovery.
|
||||
It therefore cannot split an identifier, number, operator, escape, or comment
|
||||
boundary into different tokens. This is a source-representation rule, before
|
||||
package/import interpretation; it does not make U+0000 a package, import, or
|
||||
artifact identity component. An escape spelling such as `"\\x00"` is not a
|
||||
raw source byte and remains a legal literal value.
|
||||
|
||||
### 2.2 Comments
|
||||
|
||||
Line comments only, introduced by `//` and running to end of line. There
|
||||
|
||||
Reference in New Issue
Block a user