mirror of
https://github.com/helix-editor/helix
synced 2026-07-31 12:57:07 +02:00
This will be used by the cargo indent-check xtask to validate queries, similar to the existing indent tests in helix-core.
42 lines
595 B
Zig
42 lines
595 B
Zig
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;
|
|
}
|