From 2a610da2d14583a08f016d0f985db65203d1f76f Mon Sep 17 00:00:00 2001 From: Stephen Dolan Date: Mon, 22 Oct 2012 23:31:07 +0100 Subject: [PATCH] Allow the 'keys' function to take arrays. --- builtin.c | 6 ++++++ docs/content/3.manual/manual.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/builtin.c b/builtin.c index c3d6af1..f184ff7 100644 --- a/builtin.c +++ b/builtin.c @@ -228,6 +228,12 @@ static void f_keys(jv input[], jv output[]) { } free(keys); jv_free(input[0]); + } else if (jv_get_kind(input[0]) == JV_KIND_ARRAY) { + int n = jv_array_length(input[0]); + output[0] = jv_array(); + for (int i=0; i