| ... | @@ -134,16 +134,6 @@ pub fn main() void { | ... | @@ -134,16 +134,6 @@ pub fn main() void { |
| 134 | </p> | 134 | </p> |
| 135 | {#see_also|Values|@import|Errors|Root Source File#} | 135 | {#see_also|Values|@import|Errors|Root Source File#} |
| 136 | {#header_close#} | 136 | {#header_close#} |
| 137 | {#header_open|Source Encoding#} | | |
| 138 | <p>Zig source code is encoded in UTF-8. An invalid UTF-8 byte sequence results in a compile error.</p> | | |
| 139 | <p>Throughout all zig source code (including in comments), some codepoints are never allowed:</p> | | |
| 140 | <ul> | | |
| 141 | <li>Ascii control characters, except for U+000a (LF): U+0000 - U+0009, U+000b - U+0001f, U+007f. (Note that Windows line endings (CRLF) are not allowed, and hard tabs are not allowed.)</li> | | |
| 142 | <li>Non-Ascii Unicode line endings: U+0085 (NEL), U+2028 (LS), U+2029 (PS).</li> | | |
| 143 | </ul> | | |
| 144 | <p>The codepoint U+000a (LF) (which is encoded as the single-byte value 0x0a) is the line terminator character. This character always terminates a line of zig source code (except possbly the last line of the file).</p> | | |
| 145 | <p>For some discussion on the rationale behind these design decisions, see <a href="https://github.com/zig-lang/zig/issues/663">issue #663</a></p> | | |
| 146 | {#header_close#} | | |
| 147 | {#header_open|Values#} | 137 | {#header_open|Values#} |
| 148 | {#code_begin|exe|values#} | 138 | {#code_begin|exe|values#} |
| 149 | const std = @import("std"); | 139 | const std = @import("std"); |
| ... | @@ -5627,6 +5617,16 @@ fn readU32Be() u32 {} | ... | @@ -5627,6 +5617,16 @@ fn readU32Be() u32 {} |
| 5627 | </p> | 5617 | </p> |
| 5628 | {#header_close#} | 5618 | {#header_close#} |
| 5629 | {#header_close#} | 5619 | {#header_close#} |
| | 5620 | {#header_open|Source Encoding#} |
| | 5621 | <p>Zig source code is encoded in UTF-8. An invalid UTF-8 byte sequence results in a compile error.</p> |
| | 5622 | <p>Throughout all zig source code (including in comments), some codepoints are never allowed:</p> |
| | 5623 | <ul> |
| | 5624 | <li>Ascii control characters, except for U+000a (LF): U+0000 - U+0009, U+000b - U+0001f, U+007f. (Note that Windows line endings (CRLF) are not allowed, and hard tabs are not allowed.)</li> |
| | 5625 | <li>Non-Ascii Unicode line endings: U+0085 (NEL), U+2028 (LS), U+2029 (PS).</li> |
| | 5626 | </ul> |
| | 5627 | <p>The codepoint U+000a (LF) (which is encoded as the single-byte value 0x0a) is the line terminator character. This character always terminates a line of zig source code (except possbly the last line of the file).</p> |
| | 5628 | <p>For some discussion on the rationale behind these design decisions, see <a href="https://github.com/zig-lang/zig/issues/663">issue #663</a></p> |
| | 5629 | {#header_close#} |
| 5630 | {#header_open|Grammar#} | 5630 | {#header_open|Grammar#} |
| 5631 | <pre><code class="nohighlight">Root = many(TopLevelItem) EOF | 5631 | <pre><code class="nohighlight">Root = many(TopLevelItem) EOF |
| 5632 | | 5632 | |