diff options
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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; |
