diff --git a/c/output/lrec_writer_json.c b/c/output/lrec_writer_json.c index 71acd503c..0c9125463 100644 --- a/c/output/lrec_writer_json.c +++ b/c/output/lrec_writer_json.c @@ -9,6 +9,7 @@ typedef struct _lrec_writer_json_state_t { char* output_json_flatten_separator; int quote_json_values_always; + char* line_indent; char* before_records_at_start_of_stream; char* between_records_after_start_of_stream; char* after_records_at_end_of_stream; @@ -30,6 +31,7 @@ lrec_writer_t* lrec_writer_json_alloc(int stack_vertically, int wrap_json_output pstate->counter = 0; pstate->output_json_flatten_separator = output_json_flatten_separator; + pstate->line_indent = wrap_json_output_in_outer_list ? " " : ""; pstate->before_records_at_start_of_stream = wrap_json_output_in_outer_list ? "[\n" : ""; pstate->between_records_after_start_of_stream = wrap_json_output_in_outer_list ? "," : ""; pstate->after_records_at_end_of_stream = wrap_json_output_in_outer_list ? "]\n" : ""; diff --git a/c/reg_test/expected/out b/c/reg_test/expected/out index 2bbae4ced..443611213 100644 --- a/c/reg_test/expected/out +++ b/c/reg_test/expected/out @@ -33244,6 +33244,31 @@ zee wye 8 0.5985540091064224 0.976181385699006 9.574735 8 hat wye 9 0.03144187646093577 0.7495507603507059 9.780993 9 pan wye 10 0.5026260055412137 0.9526183602969864 11.455244 10 +mlr --from ./reg_test/input/abixy put + func f(x,y,z) { + return x + y + z + } + subr s(a,b) { + $[a] = b; + return 1 # subr must not return value + } + $o = f($x, $y, $i); + call s("W", NR); + +mlr: return statements within user-defined subroutines must not return a value. + +mlr --from ./reg_test/input/abixy put + func f(x,y,z) { + return # func must return value + } + subr s(a,b) { + $[a] = b; + } + $o = f($x, $y, $i); + call s("W", NR); + +mlr: return statements within user-defined functions must return a value. + ================================================================ MULTI-PART SCRIPTS