Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const std = @import("std");

const Point = struct {
    x: i32,
    y: i32,
};

const Color = enum {
    red,
    green,
};

const Value = union(enum) {
    int: i32,
    float: f64,
};

fn classify(x: u32) u32 {
    const result = switch (x) {
        0 => 1,
        1, 2 => 2,
        else => 0,
    };
    var i: usize = 0;
    while (i < 10) : (i += 1) {
        if (i > 5) {
            process(i);
        } else {
            other(i);
        }
    }
    const data = [_]u32{
        1,
        2,
    };
    const point = .{
        .x = 1,
        .y = 2,
    };
    return result;
}