2025-03-30 15:15:38 +02:00
|
|
|
const std = @import("std");
|
|
|
|
|
|
2025-03-30 15:38:22 +02:00
|
|
|
const Raw = union(enum) {
|
|
|
|
|
string: []u8,
|
|
|
|
|
binary: []u8,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Object = union(enum) {
|
|
|
|
|
nil,
|
|
|
|
|
bool: bool,
|
|
|
|
|
integer: i64,
|
|
|
|
|
float: f64,
|
|
|
|
|
raw: Raw,
|
|
|
|
|
array: []Object,
|
|
|
|
|
map: []struct { key: Object, value: Object },
|
|
|
|
|
extension: struct { type: u8, bytes: []u8 },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
test {
|
|
|
|
|
const o: Object = .nil;
|
2025-03-30 15:15:38 +02:00
|
|
|
|
2025-03-30 15:38:22 +02:00
|
|
|
_ = o;
|
2025-03-30 15:15:38 +02:00
|
|
|
}
|