diff --git a/c/mapping/mapper_put.c b/c/mapping/mapper_put.c index e49075bed..684229631 100644 --- a/c/mapping/mapper_put.c +++ b/c/mapping/mapper_put.c @@ -117,7 +117,7 @@ static mapper_t* mapper_put_parse_cli(int* pargi, int argc, char** argv) { int print_ast = FALSE; int trace_parse = FALSE; char* oosvar_flatten_separator = DEFAULT_OOSVAR_FLATTEN_SEPARATOR; - int flush_every_record = FALSE; + int flush_every_record = TRUE; ap_state_t* pstate = ap_alloc(); ap_define_string_flag(pstate, "-f", &expression_filename); @@ -172,15 +172,15 @@ static mapper_t* mapper_put_alloc(ap_state_t* pargp, char* mlr_dsl_expression, // Retain the string contents along with any in-pointers from the AST/CST pstate->mlr_dsl_expression = mlr_dsl_expression; pstate->comment_stripped_mlr_dsl_expression = comment_stripped_mlr_dsl_expression; - pstate->past = past; - pstate->pcst = mlr_dsl_cst_alloc(past, type_inferencing); - pstate->at_begin = TRUE; - pstate->outer_filter = outer_filter; - pstate->poosvars = mlhmmv_alloc(); + pstate->past = past; + pstate->pcst = mlr_dsl_cst_alloc(past, type_inferencing); + pstate->at_begin = TRUE; + pstate->outer_filter = outer_filter; + pstate->poosvars = mlhmmv_alloc(); pstate->oosvar_flatten_separator = oosvar_flatten_separator; - pstate->flush_every_record = flush_every_record; - pstate->pbind_stack = bind_stack_alloc(); - pstate->ploop_stack = loop_stack_alloc(); + pstate->flush_every_record = flush_every_record; + pstate->pbind_stack = bind_stack_alloc(); + pstate->ploop_stack = loop_stack_alloc(); mapper_t* pmapper = mlr_malloc_or_die(sizeof(mapper_t)); pmapper->pvstate = (void*)pstate; diff --git a/c/reg_test/expected/out b/c/reg_test/expected/out index a20297649..f41486f00 100644 --- a/c/reg_test/expected/out +++ b/c/reg_test/expected/out @@ -27334,6 +27334,62 @@ hat cat 44.325655 88 0.503701 hat dog 37.114244 78 0.475824 +================================================================ +MAPPER TEE + +mlr --from ./reg_test/input/abixy tee ./output/tee1/out then nothing + +mlr cat -n ./output/tee1/out +n=1,a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 +n=2,a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +n=3,a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +n=4,a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +n=5,a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729 +n=6,a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +n=7,a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694 +n=8,a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006 +n=9,a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +n=10,a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 + +mlr --from ./reg_test/input/abixy tee --no-fflush ./output/tee1/out then nothing + +mlr cat -n ./output/tee1/out +n=1,a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 +n=2,a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +n=3,a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +n=4,a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +n=5,a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729 +n=6,a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +n=7,a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694 +n=8,a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006 +n=9,a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +n=10,a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 + +mlr --from ./reg_test/input/abixy tee -a ./output/tee1/out then nothing + +mlr cat -n ./output/tee1/out +n=1,a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 +n=2,a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +n=3,a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +n=4,a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +n=5,a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729 +n=6,a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +n=7,a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694 +n=8,a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006 +n=9,a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +n=10,a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +n=11,a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 +n=12,a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +n=13,a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +n=14,a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +n=15,a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729 +n=16,a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +n=17,a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694 +n=18,a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006 +n=19,a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +n=20,a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 + + ================================================================ OOSVAR-FROM-SREC ASSIGNMENT diff --git a/c/reg_test/run b/c/reg_test/run index a07621f0b..3a14498e9 100755 --- a/c/reg_test/run +++ b/c/reg_test/run @@ -3467,7 +3467,7 @@ run_mlr cat -n $tee1/out #run_mlr cat -n $tee2/out.pan #run_mlr cat -n $tee2/out.wye #run_mlr cat -n $tee2/out.zee -# + ## ---------------------------------------------------------------- #announce DSL PRINT #