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
|
-- in.cue --
import "encoding/yaml"
issue3972: {
// yaml uses Syntax to convert CUE to YAML. Ensure that unresolved values
// are properly handled.
output: out0: "static" // has to go first
input: inputStatic: "static"
if false {
input: inputNever: "never"
}
derived: derivedStatic: "static"
if false {
derived: derivedNever: input.inputNever
}
_out1: [for svc, _ in derived {svc}]
output: out1: yaml.Marshal(_out1)
}
-- out/eval/stats --
Leaks: 0
Freed: 10
Reused: 3
Allocs: 7
Retain: 2
Unifications: 10
Conjuncts: 12
Disjuncts: 12
NumCloseIDs: 2
-- out/eval --
(struct){
issue3972: (struct){
output: (struct){
out0: (string){ "static" }
out1: (string){ "- derivedStatic\n" }
}
input: (struct){
inputStatic: (string){ "static" }
}
derived: (struct){
derivedStatic: (string){ "static" }
}
_out1: (#list){
0: (string){ "derivedStatic" }
}
}
}
-- out/compile --
--- in.cue
{
issue3972: {
output: {
out0: "static"
}
input: {
inputStatic: "static"
}
if false {
input: {
inputNever: "never"
}
}
derived: {
derivedStatic: "static"
}
if false {
derived: {
derivedNever: 〈2;input〉.inputNever
}
}
_out1: [
for svc, _ in 〈1;derived〉 {
〈1;svc〉
},
]
output: {
out1: 〈import;"encoding/yaml"〉.Marshal(〈1;_out1〉)
}
}
}
|