summaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-29 16:13:06 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-29 16:13:06 +0000
commit465a4ec565a106e0e4cc1d64214fb2d6d791c8dc (patch)
treeee18274667b431f725954e8be9b3cdf97e1a6a87 /builtin.c
parent3a5377e183976cc6dafa16a17f608e091dfa96b9 (diff)
Improvements to del(foo).
del(foo,bar) is now very different from del(foo),del(bar). See #37.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin.c b/builtin.c
index bb704bb8..dca3d6ff 100644
--- a/builtin.c
+++ b/builtin.c
@@ -475,7 +475,6 @@ static jv f_error(jv input, jv msg) {
return jv_invalid_with_msg(msg);
}
-
static struct cfunction function_list[] = {
{(cfunction_ptr)f_plus, "_plus", 3},
{(cfunction_ptr)f_minus, "_minus", 3},
@@ -486,7 +485,7 @@ static struct cfunction function_list[] = {
{(cfunction_ptr)f_keys, "keys", 1},
{(cfunction_ptr)jv_setpath, "setpath", 3}, // FIXME typechecking
{(cfunction_ptr)jv_getpath, "getpath", 2},
- {(cfunction_ptr)jv_delpath, "delpath", 2},
+ {(cfunction_ptr)jv_delpaths, "delpaths", 2},
{(cfunction_ptr)f_equal, "_equal", 3},
{(cfunction_ptr)f_notequal, "_notequal", 3},
{(cfunction_ptr)f_less, "_less", 3},
@@ -552,7 +551,7 @@ static const char* jq_builtins[] = {
"def unique: group_by(.) | map(.[0]);",
"def max_by(f): _max_by_impl(map([f]));",
"def min_by(f): _min_by_impl(map([f]));",
- "def del(f): delpath(path(f));",
+ "def del(f): delpaths([path(f)]);",
};