1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
#IgnoreConcrete: true
#InferTasks: true
-- in.cue --
package p
import (
"list"
"tool/cli"
)
root: test: cli.Print & { text: "\(len(list.FlattenN(indir1, 10)))" }
indir1: [if len(indir2) > 0 { indir2 }]
indir2: [if len(indir3) > 0 { indir3 }]
indir3: [if len(indir4) > 0 { indir4 }]
indir4: indir5
indir5: indir6
indir6: indir7
indir7: [for i in list.Range(1,20,4) {
#pair & {
one: n: 0
two: n: i
}
}]
#pair: {
one: #unit & {
n: <25
}
two: #unit & {
n: >=one.n
if n == one.n {
n: <= one.n
}
}
if two.n > one.n {
one: n: 0
}
}
#unit: {
n: int
#padding: {in: <10, out: "0\(in)"} | {in: >=10, out: "\(in)"}
str: (#padding & {in: n}).out
}
-- out/run/errors --
-- out/run/t0 --
graph TD
t0("root.test [Ready]")
-- out/run/t1 --
graph TD
t0("root.test [Terminated]")
-- out/run/t1/value --
{
$id: "tool/cli.Print"
stdout: "foo"
text: "5"
}
-- out/run/t1/stats --
Leaks: 0
Freed: 25574
Reused: 25554
Allocs: 20
Retain: 337
Unifications: 18344
Conjuncts: 76391
Disjuncts: 25823
-- out/run/stats/totals --
Leaks: 0
Freed: 25574
Reused: 25554
Allocs: 20
Retain: 337
Unifications: 18344
Conjuncts: 76391
Disjuncts: 25823
-- out/run/t2 --
graph TD
t0("root.prepare [Terminated]")
t1("root.run [Terminated]")
t1-->t0
-- out/run/t2/value --
{
$id: "run"
stdout: "foo"
env: {
input: "foo"
}
}
-- out/run/t2/stats --
Leaks: 0
Freed: 12
Reused: 12
Allocs: 0
Retain: 0
Unifications: 12
Conjuncts: 20
Disjuncts: 12
|