diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-09-03 16:14:52 +0100 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-09-03 16:14:52 +0100 |
commit | d895d39ba973f7296429aac77c1ad6bc8d7341b4 (patch) | |
tree | e5564c943b4c03409a1cb286b3c6dded13674cb5 | |
parent | 8fe9c8a22a0f43c8e34df5bc92df98c498c9a3f4 (diff) |
Support "null" in JQ programs
-rw-r--r-- | c/builtin.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/c/builtin.c b/c/builtin.c index d468e7b7..35e15471 100644 --- a/c/builtin.c +++ b/c/builtin.c @@ -10,6 +10,10 @@ static void f_true(jv input[], jv output[]) { output[0] = jv_true(); } +static void f_null(jv input[], jv output[]) { + jv_free(input[0]); + output[0] = jv_null(); +} static void f_plus(jv input[], jv output[]) { jv_free(input[0]); @@ -30,6 +34,7 @@ static void f_plus(jv input[], jv output[]) { struct cfunction function_list[] = { {f_true, "true", CALL_BUILTIN_1_1}, {f_false, "false", CALL_BUILTIN_1_1}, + {f_null, "null", CALL_BUILTIN_1_1}, {f_plus, "_plus", CALL_BUILTIN_3_1}, }; struct symbol_table builtins = {function_list, sizeof(function_list)/sizeof(function_list[0])}; |