aboutsummaryrefslogtreecommitdiff
path: root/src/zilch/Env/value.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/zilch/Env/value.zig')
-rw-r--r--src/zilch/Env/value.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/zilch/Env/value.zig b/src/zilch/Env/value.zig
index 59b788f..cedaa89 100644
--- a/src/zilch/Env/value.zig
+++ b/src/zilch/Env/value.zig
@@ -1,5 +1,6 @@
const std = @import("std");
const Object = @import("../Object.zig");
+const AnyFuture = @import("future.zig").AnyFuture;
pub fn isString(comptime T: type) bool {
return comptime blk: {
@@ -37,6 +38,7 @@ pub const Value = extern struct {
uint: usize,
float: f64,
undefined: void,
+ future: usize,
},
pub fn from(value: anytype) Value {
@@ -70,6 +72,10 @@ pub const Value = extern struct {
.kind = .undefined,
.value = .{ .undefined = {} },
},
+ AnyFuture => .{
+ .kind = .future,
+ .value = .{ .future = value.unresolved.id },
+ },
else => str: {
if (comptime isString(T)) {
break :str .{
@@ -92,13 +98,13 @@ pub const Value = extern struct {
}
pub const Kind = enum(u8) {
- uninit = 0,
object = 1,
string = 2,
int = 3,
uint = 4,
float = 5,
undefined = 6,
+ future = 7,
pub fn asType(comptime self: Kind) type {
return switch (self) {
@@ -108,7 +114,7 @@ pub const Value = extern struct {
.uint => return usize,
.float => f64,
.undefined => return void,
- .uninit => @compileError("uninit has no associated type."),
+ .future => AnyFuture,
};
}
};