Skip to content
Myr

Add `debug` and `stderr` builtins

Before adoption: this commit came in with the history the project adopted, so no landing records it.

And refactor setup of jv dump flags.

authored by Nicolas Williams · committed by Nicolas Williams · parent 9760245 · Browse files · 1 file+7 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−0 removed

  • other:+7 added−0 removed

1 file+7 added−0 removed

modified:builtin.c+7 added
901 unmodified lines
902 cb(jq, data, jv_copy(input));903 return input;904}905906static jv f_stderr(jq_state *jq, jv input) {907 jv_dumpf(jv_copy(input), stderr, 0);908 fprintf(stderr, "\n");909 return input;910}911912913#define LIBM_DD(name) \914 {(cfunction_ptr)f_ ## name, "_" #name, 1},915 916static const struct cfunction function_list[] = {
47 unmodified lines
964 {(cfunction_ptr)f_match, "_match_impl", 4},965 {(cfunction_ptr)f_modulemeta, "modulemeta", 1},966 {(cfunction_ptr)f_input, "_input", 1},967 {(cfunction_ptr)f_debug, "debug", 1},968 {(cfunction_ptr)f_stderr, "stderr", 1},969};970#undef LIBM_DD971972struct bytecoded_builtin { const char* name; block code; };
299 unmodified lines