summaryrefslogtreecommitdiffstats
path: root/jv_aux.c
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2014-06-08 02:01:44 -0500
committerNicolas Williams <nico@cryptonector.com>2014-06-08 02:01:44 -0500
commit1dbe9317bce859e9beaa2d7e0ceaad5d561eb48e (patch)
tree8a4319b06b8ed63be88e6163238819385ea485c5 /jv_aux.c
parentef4f3a54feaa9ebf967dd944bb8da5108a351d07 (diff)
Add `indices(s)`, improve `index(s)`, `rindex(s)`
Now these deal with arrays as input and `s` being an array or a scalar.
Diffstat (limited to 'jv_aux.c')
-rw-r--r--jv_aux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/jv_aux.c b/jv_aux.c
index ec2aaa18..3c5750bd 100644
--- a/jv_aux.c
+++ b/jv_aux.c
@@ -85,6 +85,8 @@ jv jv_get(jv t, jv k) {
}
} else if (jv_get_kind(t) == JV_KIND_STRING && jv_get_kind(k) == JV_KIND_STRING) {
v = jv_string_indexes(t, k);
+ } else if (jv_get_kind(t) == JV_KIND_ARRAY && jv_get_kind(k) == JV_KIND_ARRAY) {
+ v = jv_array_indexes(t, k);
} else if (jv_get_kind(t) == JV_KIND_NULL &&
(jv_get_kind(k) == JV_KIND_STRING ||
jv_get_kind(k) == JV_KIND_NUMBER ||