Allow C-coded functions to empty
Just return a jv_invalid() without a message.
This commit is contained in:
1 parent
bbb287f54b
commit
906d2537b9
1 file changed
+5
-1
@@ -703,9 +703,13 @@ jv jq_next(jq_state *jq) {
|
|||||||
|
|
||||||
if (jv_is_valid(top)) {
|
if (jv_is_valid(top)) {
|
||||||
stack_push(jq, top);
|
stack_push(jq, top);
|
||||||
} else {
|
} else if (jv_invalid_has_msg(jv_copy(top))) {
|
||||||
set_error(jq, top);
|
set_error(jq, top);
|
||||||
goto do_backtrack;
|
goto do_backtrack;
|
||||||
|
} else {
|
||||||
|
// C-coded function returns invalid w/o msg? -> backtrack, as if
|
||||||
|
// it had returned `empty`
|
||||||
|
goto do_backtrack;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user