mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-22 15:37:59 +00:00
nested-for-srec UTs
This commit is contained in:
parent
d77419127b
commit
60bbefabe3
3 changed files with 2361 additions and 3 deletions
File diff suppressed because it is too large
Load diff
298
c/reg_test/run
298
c/reg_test/run
|
|
@ -1902,7 +1902,303 @@ run_mlr --opprint --from $indir/abixy put -q '
|
|||
# ----------------------------------------------------------------
|
||||
announce DSL BREAK/CONTINUE IN NESTED FOR-SREC
|
||||
|
||||
mention xxx to do after bcstack impl
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
break;
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
continue;
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
break;
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
continue;
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
break;
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
break;
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
continue;
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
break;
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
break;
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
continue;
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
continue;
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
continue;
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
if (k1 == "b") {
|
||||
break
|
||||
}
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
if (k1 == "b") {
|
||||
continue
|
||||
}
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
if (k2 == "a") {
|
||||
break
|
||||
}
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
if (k2 == "b") {
|
||||
continue
|
||||
}
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
if (k1 == "b") {
|
||||
break
|
||||
}
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
if (k2 == "a") {
|
||||
break
|
||||
}
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
if (k1 == "b") {
|
||||
continue
|
||||
}
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
if (k2 == "a") {
|
||||
break
|
||||
}
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
if (k1 == "b") {
|
||||
break
|
||||
}
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
if (k2 == "a") {
|
||||
continue
|
||||
}
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
for (k1, v1 in $*) {
|
||||
@output1[NR][k1] = "before";
|
||||
if (k1 == "b") {
|
||||
continue
|
||||
}
|
||||
@output1[NR][k1] = v1;
|
||||
for (k2, v2 in $*) {
|
||||
@output2[NR][k1."_".k2] = "before";
|
||||
if (k2 == "a") {
|
||||
continue
|
||||
}
|
||||
@output2[NR][k1."_".k2] = v2;
|
||||
}
|
||||
}
|
||||
end {
|
||||
emit @output1, "NR", "name";
|
||||
emit @output2, "NR", "names";
|
||||
}
|
||||
'
|
||||
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
announce FOR-OOSVAR DEPTH TESTS
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ TOP-OF-LIST SUMMARY
|
|||
- in-loop stack flags for handlers (at pvars?)
|
||||
- test break & continue both set
|
||||
! bcstack! push at entry to each loop. test w/ nested break out of nested loops.
|
||||
? do-while: continue -- execute expr-test?
|
||||
! cst_statement_free bring up to date with blank_alloc
|
||||
|
||||
! xxxes
|
||||
|
|
@ -31,6 +30,7 @@ TOP-OF-LIST SUMMARY
|
|||
! extend mld:ref:put, and cookbook
|
||||
! cmt ast/cst stuff re (1) .y; (2) reg_test/expected/out
|
||||
* readme note re head dev: announced features ok if build passing (and it is); unannounced features may change
|
||||
! clear in doc re semicolon as statement separator, not terminator; blank line doesn't terminate. in its own subsubsection.
|
||||
* lemon note/message-wording re resolvable conflicts
|
||||
|
||||
? triple-for with boundvars? or at least faqent re oosvars & while-loops
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue