1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-02 00:23:02 +00:00

Allow expressions as keys in destructuring.

This commit is contained in:
bakpakin
2018-06-25 15:34:06 -04:00
parent 5e9d1d07b9
commit 23dcfb986e
2 changed files with 14 additions and 1 deletions

View File

@@ -107,7 +107,7 @@ static void destructure(DstCompiler *c, Dst left, DstSlot right,
const DstKV *kv = NULL;
while ((kv = dstc_next(left, kv))) {
DstSlot newright;
DstSlot kslot = dstc_cslot(dst_ast_unwrap(kv->key));
DstSlot kslot = dstc_value(dstc_fopts_default(c), kv->key);
Dst subval = kv->value;
localright = dstc_preread(c, ast, 0xFF, 1, right);
localsub = dstc_lslotn(c, 0xFF, 3);