...
1# DO NOT EDIT; generated by go run testdata/gen.go
2#
3#name: field comprehensions with templates
4#evalFull
5-- in.cue --
6num: 1
7a: {
8 if num < 5 {
9 [A=string]: [B=string]: {
10 name: A
11 kind: B
12 }
13 }
14}
15a: b: c: d: "bar"
16-- out/def --
17num: 1
18a: {
19 {[A=string]: {
20 [B=string]: {
21 name: A, kind: B
22 }
23 }}
24 b: {
25 {[B=string]: {
26 name: "b", kind: B
27 }}
28 c: {
29 name: "b"
30 kind: "c"
31 d: "bar"
32 }
33 }
34}
35-- out/export --
36num: 1
37a: {
38 b: {
39 c: {
40 name: "b"
41 kind: "c"
42 d: "bar"
43 }
44 }
45}
46-- out/yaml --
47num: 1
48a:
49 b:
50 c:
51 name: b
52 kind: c
53 d: bar
54-- out/json --
55{"num":1,"a":{"b":{"c":{"name":"b","kind":"c","d":"bar"}}}}
56-- out/legacy-debug --
57<0>{num: 1, a: <1>{[]: <2>(A: string)-><3>{[]: <4>(B: string)-><5>{name: <2>.A, kind: <4>.B}, }, b: <6>{[]: <7>(B: string)-><8>{name: <9>.A, kind: <7>.B}, c: <10>{name: "b", kind: "c", d: "bar"}}}}
58-- out/compile --
59--- in.cue
60{
61 num: 1
62 a: {
63 if (〈1;num〉 < 5) {
64 [string]: {
65 [string]: {
66 name: 〈2;-〉
67 kind: 〈1;-〉
68 }
69 }
70 }
71 }
72 a: {
73 b: {
74 c: {
75 d: "bar"
76 }
77 }
78 }
79}
80-- out/eval/stats --
81Leaks: 0
82Freed: 8
83Reused: 3
84Allocs: 5
85Retain: 0
86
87Unifications: 8
88Conjuncts: 12
89Disjuncts: 8
90-- out/eval --
91(struct){
92 num: (int){ 1 }
93 a: (struct){
94 b: (struct){
95 c: (struct){
96 d: (string){ "bar" }
97 name: (string){ "b" }
98 kind: (string){ "c" }
99 }
100 }
101 }
102}
View as plain text