hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index c872c90..aeae982 100644
--- a/eval.c
+++ b/eval.c
@@ -121,6 +121,15 @@ static int evaluate_value(struct Machine* machine, const struct Node* node, int6
*out = variable->value;
return 0;
+ case VALUE_DECLVAL:
+ if (evaluate_type(machine, node->first, &type))
+ return 1;
+
+ if (type.kind != KIND_VALUE)
+ return complain(node, "declval of a type with no value in it, what did you expect");
+
+ *out = type.number;
+ return 0;
case VALUE_CONDITIONAL:
if (evaluate_condition(machine, node->first, &truth))
return 1;