summaryrefslogtreecommitdiff
path: root/src/zisp/value/array.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/zisp/value/array.zig')
-rw-r--r--src/zisp/value/array.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/zisp/value/array.zig b/src/zisp/value/array.zig
index 67a5f37..629d31c 100644
--- a/src/zisp/value/array.zig
+++ b/src/zisp/value/array.zig
@@ -54,23 +54,23 @@ pub const ArrayHeader = packed struct(u64) {
len_or_ptr: u48,
is_slice: bool = false,
is_ptr: bool = false,
- type: enum(u2) { int, float, value, string },
+ type: enum(u2) { int, flt, val, str },
info: packed union {
int: packed struct(u12) {
size: u10,
signed: bool,
endian: Endian = .native,
},
- float: packed struct(u12) {
+ flt: packed struct(u12) {
size: u10,
_: bool,
endian: Endian = .native,
},
- value: packed struct(u12) {
+ val: packed struct(u12) {
weak: bool,
_: u11,
},
- string: packed struct(u12) {
+ str: packed struct(u12) {
encoding: enum(u11) {
utf8,
utf16,
@@ -99,7 +99,7 @@ pub const ArrayHeader = packed struct(u64) {
fn eltSize(self: *@This()) u16 {
std.debug.assert(!self.is_ptr);
return switch (self.type) {
- .string => 1,
+ .str => 1,
else => @panic("not implemented"),
};
}
@@ -172,8 +172,8 @@ pub fn newString(alloc: Alloc, s: []const u8) !Value {
const arr: ArrayPtr = @ptrCast(ptr);
arr.* = .{
.len_or_ptr = @intCast(s.len),
- .type = .string,
- .info = .{ .string = .{} },
+ .type = .str,
+ .info = .{ .str = .{} },
};
const buf = arr.bufContent();
@memcpy(buf[0..s.len], s);