<Modifiers>const</Modifiers><Normal Text> std </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Builtin Functions>@import</Builtin Functions><Normal Text>(</Normal Text><String>"std"</String><Normal Text>);</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>/// This is a doc comment</Comment><br/>
<Comment>// This is a comment</Comment><br/>
<Keyword>fn</Keyword><Normal Text> getData() </Normal Text><Symbol>!</Symbol><Type>u32</Type><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>return</Control Flow><Normal Text> </Normal Text><Decimal>666</Decimal><Normal Text>;</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>// multiline string</Comment><br/>
<Modifiers>const</Modifiers><Normal Text> hello_world_in_c </Normal Text><Symbol>=</Symbol><br/>
<Normal Text>    </Normal Text><String>\\#include <stdio.h></String><br/>
<Normal Text>    </Normal Text><String>\\</String><br/>
<Normal Text>    </Normal Text><String>\\int main(int argc, char **argv) {</String><br/>
<Normal Text>    </Normal Text><String>\\    printf("hello world\n");</String><br/>
<Normal Text>    </Normal Text><String>\\    return 0;</String><br/>
<Normal Text>    </Normal Text><String>\\}</String><br/>
<Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>// Top-level declarations are order-independent:</Comment><br/>
<Modifiers>const</Modifiers><Normal Text> print </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Builtin Functions>@import</Builtin Functions><Normal Text>(</Normal Text><String>"std"</String><Normal Text>)</Normal Text><Symbol>.</Symbol><Normal Text>debug</Normal Text><Symbol>.</Symbol><Normal Text>print;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>pub</Keyword><Normal Text> </Normal Text><Keyword>fn</Keyword><Normal Text> main() </Normal Text><Symbol>!</Symbol><Type>void</Type><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>inline</Keyword><Normal Text> </Normal Text><Control Flow>for</Control Flow><Normal Text> (values) </Normal Text><Symbol>|</Symbol><Normal Text>v</Normal Text><Symbol>,</Symbol><Normal Text> i</Normal Text><Symbol>|</Symbol><Normal Text> {</Normal Text><br/>
<Normal Text>        </Normal Text><Control Flow>if</Control Flow><Normal Text> (i </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Normal Text>) </Normal Text><Control Flow>continue</Control Flow><Normal Text>;</Normal Text><br/>
<Normal Text>        </Normal Text><Control Flow>try</Control Flow><Normal Text> expect(v);</Normal Text><br/>
<Normal Text>    }</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Comment>// error union</Comment><br/>
<Normal Text>    </Normal Text><Modifiers>var</Modifiers><Normal Text> number_or_error</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>anyerror</Type><Symbol>!</Symbol><Type>i32</Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>error</Keyword><Symbol>.</Symbol><Normal Text>ArgNotFound;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    print(</Normal Text><String>"</String><String Char>\n</String Char><String>error union 2</String><String Char>\n</String Char><String>type: {}</String><String Char>\n</String Char><String>value: {!}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{</Normal Text><br/>
<Normal Text>        </Normal Text><Builtin Functions>@TypeOf</Builtin Functions><Normal Text>(number_or_error)</Normal Text><Symbol>,</Symbol><Normal Text> number_or_error</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>    });</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>const</Modifiers><Normal Text> stdout </Normal Text><Symbol>=</Symbol><Normal Text> std</Normal Text><Symbol>.</Symbol><Normal Text>io</Normal Text><Symbol>.</Symbol><Normal Text>getStdOut()</Normal Text><Symbol>.</Symbol><Normal Text>writer();</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>try</Control Flow><Normal Text> stdout</Normal Text><Symbol>.</Symbol><Normal Text>print(</Normal Text><String>"Hello, {s}!</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{</Normal Text><String>"world"</String><Normal Text>});</Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>const</Modifiers><Normal Text> bytes </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"hello"</String><Normal Text>;</Normal Text><br/>
<Normal Text>    print(</Normal Text><String>"{}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{</Normal Text><Builtin Functions>@TypeOf</Builtin Functions><Normal Text>(bytes)}); </Normal Text><Comment>// *const [5:0]u8</Comment><br/>
<Normal Text>    print(</Normal Text><String>"{d}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{bytes[</Normal Text><Decimal>5</Decimal><Normal Text>]}); </Normal Text><Comment>// 0</Comment><br/>
<Normal Text>    print(</Normal Text><String>"{}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{</Normal Text><Character>'e'</Character><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Character>'</Character><String Char>\x65</String Char><Character>'</Character><Normal Text>}); </Normal Text><Comment>// true</Comment><br/>
<Normal Text>    print(</Normal Text><String>"{d}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{</Normal Text><Character>'</Character><String Char>\u{1f4a9}</String Char><Character>'</Character><Normal Text>});                     </Normal Text><Comment>// 128169</Comment><br/>
<Normal Text>    print(</Normal Text><String>"{d}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{</Normal Text><Character>'💯'</Character><Normal Text>});                            </Normal Text><Comment>// 128175</Comment><br/>
<Normal Text>    print(</Normal Text><String>"{}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{mem</Normal Text><Symbol>.</Symbol><Normal Text>eql(</Normal Text><Type>u8</Type><Symbol>,</Symbol><Normal Text> </Normal Text><String>"hello"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"h</String><String Char>\x65</String Char><String>llo"</String><Normal Text>)}); </Normal Text><Comment>// true</Comment><br/>
<Normal Text>    print(</Normal Text><String>"0x{x}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{</Normal Text><String>"</String><String Char>\xff</String Char><String>"</String><Normal Text>[</Normal Text><Decimal>0</Decimal><Normal Text>]}); </Normal Text><Comment>// non-UTF-8 strings are possible with \xNN notation.</Comment><br/>
<Normal Text>    print(</Normal Text><String>"{u}</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{</Normal Text><Character>'⚡'</Character><Normal Text>});</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    _ </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Builtin Functions>@import</Builtin Functions><Normal Text>(</Normal Text><String>"introducing_zig_test.zig"</String><Normal Text>);</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>// Declare an enum.</Comment><br/>
<Modifiers>const</Modifiers><Normal Text> Type </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>enum</Keyword><Normal Text> {</Normal Text><br/>
<Normal Text>    ok</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>    not_ok</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>};</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>test</Keyword><Normal Text> </Normal Text><String>"async skip test"</String><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>var</Modifiers><Normal Text> frame </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Modifiers>async</Modifiers><Normal Text> func();</Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>const</Modifiers><Normal Text> result </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Modifiers>await</Modifiers><Normal Text> frame;</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>try</Control Flow><Normal Text> std</Normal Text><Symbol>.</Symbol><Normal Text>testing</Normal Text><Symbol>.</Symbol><Normal Text>expect(result </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text>);</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>fn</Keyword><Normal Text> func() </Normal Text><Type>i32</Type><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>suspend</Keyword><Normal Text> {</Normal Text><br/>
<Normal Text>        </Normal Text><Keyword>resume</Keyword><Normal Text> @frame();</Normal Text><br/>
<Normal Text>    }</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>return</Control Flow><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text>;</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>pub</Keyword><Normal Text> </Normal Text><Modifiers>extern</Modifiers><Normal Text> </Normal Text><String>"c"</String><Normal Text> </Normal Text><Keyword>fn</Keyword><Normal Text> @</Normal Text><String>"error"</String><Normal Text>() </Normal Text><Type>void</Type><Normal Text>;</Normal Text><br/>
<Keyword>pub</Keyword><Normal Text> </Normal Text><Modifiers>extern</Modifiers><Normal Text> </Normal Text><String>"c"</String><Normal Text> </Normal Text><Keyword>fn</Keyword><Normal Text> @</Normal Text><String>"fstat$INODE64"</String><Normal Text>(fd</Normal Text><Symbol>:</Symbol><Normal Text> c</Normal Text><Symbol>.</Symbol><Normal Text>fd_t</Normal Text><Symbol>,</Symbol><Normal Text> buf</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>*</Symbol><Normal Text>c</Normal Text><Symbol>.</Symbol><Normal Text>Stat) </Normal Text><Type>c_int</Type><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> Color </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>enum</Keyword><Normal Text> {</Normal Text><br/>
<Normal Text>  red</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>  @</Normal Text><String>"really red"</String><Symbol>,</Symbol><br/>
<Normal Text>};</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> color</Normal Text><Symbol>:</Symbol><Normal Text> Color </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>@</Normal Text><String>"really red"</String><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Modifiers>var</Modifiers><Normal Text> y</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>i32</Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> add(</Normal Text><Decimal>10</Decimal><Symbol>,</Symbol><Normal Text> x);</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> x</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>i32</Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> add(</Normal Text><Decimal>12</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>34</Decimal><Normal Text>);</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>test</Keyword><Normal Text> </Normal Text><String>"comptime vars"</String><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>var</Modifiers><Normal Text> x</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>i32</Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text>;</Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>comptime</Modifiers><Normal Text> </Normal Text><Modifiers>var</Modifiers><Normal Text> y</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>i32</Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    x </Normal Text><Symbol>+=</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text>;</Normal Text><br/>
<Normal Text>    y </Normal Text><Symbol>+=</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>try</Control Flow><Normal Text> expect(x </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Normal Text>);</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>try</Control Flow><Normal Text> expect(y </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Normal Text>);</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>if</Control Flow><Normal Text> (y </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Normal Text>) {</Normal Text><br/>
<Normal Text>        </Normal Text><Comment>// This compile error never triggers because y is a comptime variable,</Comment><br/>
<Normal Text>        </Normal Text><Comment>// and so `y != 2` is a comptime value, and this if is statically evaluated.</Comment><br/>
<Normal Text>        </Normal Text><Builtin Functions>@compileError</Builtin Functions><Normal Text>(</Normal Text><String>"wrong y value"</String><Normal Text>);</Normal Text><br/>
<Normal Text>    }</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> decimal_int </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>98222</Decimal><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> hex_int </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Hex>0xff</Hex><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> another_hex_int </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Hex>0xFF</Hex><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> octal_int </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Octal>0o755</Octal><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> binary_int </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Binary>0b11110000</Binary><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>// underscores may be placed between two digits as a visual separator</Comment><br/>
<Modifiers>const</Modifiers><Normal Text> one_billion </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>1_000_000_000</Decimal><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> binary_mask </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Binary>0b1_1111_1111</Binary><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> permissions </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Octal>0o7_5_5</Octal><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> big_address </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Hex>0xFF80_0000_0000_0000</Hex><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> floating_point </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Float>123.0E+77</Float><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> another_float </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Float>123.0</Float><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> yet_another </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Float>123.0e+77</Float><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> hex_floating_point </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Hex Float>0x103.70p-5</Hex Float><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> another_hex_float </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Hex Float>0x103.70</Hex Float><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> yet_another_hex_float </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Hex Float>0x103.70P-5</Hex Float><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>// underscores may be placed between two digits as a visual separator</Comment><br/>
<Modifiers>const</Modifiers><Normal Text> lightspeed </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Float>299_792_458.000_000</Float><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> nanosecond </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Float>0.000_000_001</Float><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> more_hex </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Hex Float>0x1234_5678.9ABC_CDEFp-10</Hex Float><Normal Text>;</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> A </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>error</Keyword><Normal Text>{One};</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> B </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>error</Keyword><Normal Text>{Two};</Normal Text><br/>
<Normal Text>(A </Normal Text><Symbol>||</Symbol><Normal Text> B) </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Keyword>error</Keyword><Normal Text>{One</Normal Text><Symbol>,</Symbol><Normal Text> Two}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> x</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>u32</Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>1234</Decimal><Normal Text>;</Normal Text><br/>
<Modifiers>const</Modifiers><Normal Text> ptr </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text>x;</Normal Text><br/>
<Normal Text>ptr</Normal Text><Symbol>.*</Symbol><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Decimal>1234</Decimal><br/>
<Normal Text></Normal Text><br/>
<Comment>// get the size of an array</Comment><br/>
<Modifiers>comptime</Modifiers><Normal Text> {</Normal Text><br/>
<Normal Text>    assert(message</Normal Text><Symbol>.</Symbol><Normal Text>len </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Decimal>5</Decimal><Normal Text>);</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>test</Keyword><Normal Text> </Normal Text><String>"iterate over an array"</String><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>var</Modifiers><Normal Text> sum</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>usize</Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>0</Decimal><Normal Text>;</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>for</Control Flow><Normal Text> (message) </Normal Text><Symbol>|</Symbol><Normal Text>byte</Normal Text><Symbol>|</Symbol><Normal Text> {</Normal Text><br/>
<Normal Text>        sum </Normal Text><Symbol>+=</Symbol><Normal Text> byte;</Normal Text><br/>
<Normal Text>    }</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>try</Control Flow><Normal Text> expect(sum </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Character>'h'</Character><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Character>'e'</Character><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Character>'l'</Character><Normal Text> </Normal Text><Symbol>*</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Character>'o'</Character><Normal Text>);</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Comment>// use compile-time code to initialize an array</Comment><br/>
<Modifiers>var</Modifiers><Normal Text> fancy_array </Normal Text><Symbol>=</Symbol><Normal Text> init</Normal Text><Symbol>:</Symbol><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>var</Modifiers><Normal Text> initial_value</Normal Text><Symbol>:</Symbol><Normal Text> [</Normal Text><Decimal>10</Decimal><Normal Text>]Point </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Constant>undefined</Constant><Normal Text>;</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>for</Control Flow><Normal Text> (initial_value) </Normal Text><Symbol>|*</Symbol><Normal Text>pt</Normal Text><Symbol>,</Symbol><Normal Text> i</Normal Text><Symbol>|</Symbol><Normal Text> {</Normal Text><br/>
<Normal Text>        pt</Normal Text><Symbol>.*</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Point{</Normal Text><br/>
<Normal Text>            </Normal Text><Symbol>.</Symbol><Normal Text>x </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Builtin Functions>@intCast</Builtin Functions><Normal Text>(</Normal Text><Type>i32</Type><Symbol>,</Symbol><Normal Text> i)</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>.</Symbol><Normal Text>y </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Builtin Functions>@intCast</Builtin Functions><Normal Text>(</Normal Text><Type>i32</Type><Symbol>,</Symbol><Normal Text> i) </Normal Text><Symbol>*</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>,</Symbol><br/>
<Normal Text>        };</Normal Text><br/>
<Normal Text>    }</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>break</Control Flow><Normal Text> </Normal Text><Symbol>:</Symbol><Normal Text>init initial_value;</Normal Text><br/>
<Normal Text>};</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>test</Keyword><Normal Text> </Normal Text><String>"switch on non-exhaustive enum"</String><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>try</Control Flow><Normal Text> expect(result);</Normal Text><br/>
<Normal Text>    </Normal Text><Modifiers>const</Modifiers><Normal Text> is_one </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Control Flow>switch</Control Flow><Normal Text> (number) {</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>one </Normal Text><Symbol>=></Symbol><Normal Text> </Normal Text><Constant>true</Constant><Symbol>,</Symbol><br/>
<Normal Text>        </Normal Text><Control Flow>else</Control Flow><Normal Text> </Normal Text><Symbol>=></Symbol><Normal Text> </Normal Text><Constant>false</Constant><Symbol>,</Symbol><br/>
<Normal Text>    };</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>try</Control Flow><Normal Text> expect(is_one);</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>if</Control Flow><Normal Text> (a </Normal Text><Symbol>!=</Symbol><Normal Text> b) {</Normal Text><br/>
<Normal Text>        </Normal Text><Control Flow>try</Control Flow><Normal Text> expect(</Normal Text><Constant>true</Constant><Normal Text>);</Normal Text><br/>
<Normal Text>    } </Normal Text><Control Flow>else</Control Flow><Normal Text> </Normal Text><Control Flow>if</Control Flow><Normal Text> (a </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><Decimal>9</Decimal><Normal Text>) {</Normal Text><br/>
<Normal Text>        </Normal Text><Keyword>unreachable</Keyword><Normal Text>;</Normal Text><br/>
<Normal Text>    } </Normal Text><Control Flow>else</Control Flow><Normal Text> {</Normal Text><br/>
<Normal Text>        </Normal Text><Keyword>unreachable</Keyword><Normal Text>;</Normal Text><br/>
<Normal Text>    }</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>fn</Keyword><Normal Text> deferErrorExample(is_error</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>bool</Type><Normal Text>) </Normal Text><Symbol>!</Symbol><Type>void</Type><Normal Text> {</Normal Text><br/>
<Normal Text>    print(</Normal Text><String>"</String><String Char>\n</String Char><String>start of function</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{});</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Comment>// This will always be executed on exit</Comment><br/>
<Normal Text>    </Normal Text><Control Flow>defer</Control Flow><Normal Text> {</Normal Text><br/>
<Normal Text>        print(</Normal Text><String>"end of function</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{});</Normal Text><br/>
<Normal Text>    }</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>errdefer</Control Flow><Normal Text> {</Normal Text><br/>
<Normal Text>        print(</Normal Text><String>"encountered an error!</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>{});</Normal Text><br/>
<Normal Text>    }</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>pub</Keyword><Normal Text> </Normal Text><Keyword>fn</Keyword><Normal Text> syscall3(number</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>usize</Type><Symbol>,</Symbol><Normal Text> arg1</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>usize</Type><Symbol>,</Symbol><Normal Text> arg2</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>usize</Type><Symbol>,</Symbol><Normal Text> arg3</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Type>usize</Type><Normal Text>) </Normal Text><Type>usize</Type><Normal Text> {</Normal Text><br/>
<Normal Text>    </Normal Text><Control Flow>return</Control Flow><Normal Text> </Normal Text><Keyword>asm</Keyword><Normal Text> </Normal Text><Modifiers>volatile</Modifiers><Normal Text> (</Normal Text><String>"syscall"</String><br/>
<Normal Text>        </Normal Text><Symbol>:</Symbol><Normal Text> [ret] </Normal Text><String>"={rax}"</String><Normal Text> (</Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Type>usize</Type><Normal Text>)</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>:</Symbol><Normal Text> [number] </Normal Text><String>"{rax}"</String><Normal Text> (number)</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>          [arg1] </Normal Text><String>"{rdi}"</String><Normal Text> (arg1)</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>          [arg2] </Normal Text><String>"{rsi}"</String><Normal Text> (arg2)</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>          [arg3] </Normal Text><String>"{rdx}"</String><Normal Text> (arg3)</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>"rcx"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"r11"</String><br/>
<Normal Text>    );</Normal Text><br/>
<Normal Text>}</Normal Text><br/>
