cuelang.org/go@v0.13.0/cue/testdata/fulleval/008_nested_templates_in_one_field.txtar (about) 1 #name: nested templates in one field 2 #evalFull 3 -- in.cue -- 4 a: [A=string]: b: [B=string]: { 5 name: A 6 kind: B 7 } 8 a: "A": b: "B": _ 9 a: "C": b: "D": _ 10 a: "EE": b: "FF": {c: "bar"} 11 -- out/def -- 12 a: { 13 {[A=string]: { 14 b: { 15 [B=string]: { 16 name: A, kind: B 17 } 18 } 19 }} 20 A: { 21 b: { 22 {[B=string]: { 23 name: "A", kind: B 24 }} 25 B: { 26 name: "A" 27 kind: "B" 28 } 29 } 30 } 31 C: { 32 b: { 33 {[B=string]: { 34 name: "C", kind: B 35 }} 36 D: { 37 name: "C" 38 kind: "D" 39 } 40 } 41 } 42 EE: { 43 b: { 44 {[B=string]: { 45 name: "EE", kind: B 46 }} 47 FF: { 48 name: "EE" 49 kind: "FF" 50 c: "bar" 51 } 52 } 53 } 54 } 55 -- out/export -- 56 a: { 57 A: { 58 b: { 59 B: { 60 name: "A" 61 kind: "B" 62 } 63 } 64 } 65 C: { 66 b: { 67 D: { 68 name: "C" 69 kind: "D" 70 } 71 } 72 } 73 EE: { 74 b: { 75 FF: { 76 name: "EE" 77 kind: "FF" 78 c: "bar" 79 } 80 } 81 } 82 } 83 -- out/yaml -- 84 a: 85 A: 86 b: 87 B: 88 name: A 89 kind: B 90 C: 91 b: 92 D: 93 name: C 94 kind: D 95 EE: 96 b: 97 FF: 98 name: EE 99 kind: FF 100 c: bar 101 -- out/json -- 102 {"a":{"A":{"b":{"B":{"name":"A","kind":"B"}}},"C":{"b":{"D":{"name":"C","kind":"D"}}},"EE":{"b":{"FF":{"name":"EE","kind":"FF","c":"bar"}}}}} 103 -- out/legacy-debug -- 104 <0>{a: <1>{[]: <2>(A: string)-><3>{b: <4>{[]: <5>(B: string)-><6>{name: <2>.A, kind: <5>.B}, }}, A: <7>{b: <8>{[]: <9>(B: string)-><10>{name: <11>.A, kind: <9>.B}, B: <12>{name: "A", kind: "B"}}}, C: <13>{b: <14>{[]: <15>(B: string)-><16>{name: <17>.A, kind: <15>.B}, D: <18>{name: "C", kind: "D"}}}, EE: <19>{b: <20>{[]: <21>(B: string)-><22>{name: <23>.A, kind: <21>.B}, FF: <24>{name: "EE", kind: "FF", c: "bar"}}}}} 105 -- out/compile -- 106 --- in.cue 107 { 108 a: { 109 [string]: { 110 b: { 111 [string]: { 112 name: 〈3;-〉 113 kind: 〈1;-〉 114 } 115 } 116 } 117 } 118 a: { 119 A: { 120 b: { 121 B: _ 122 } 123 } 124 } 125 a: { 126 C: { 127 b: { 128 D: _ 129 } 130 } 131 } 132 a: { 133 EE: { 134 b: { 135 FF: { 136 c: "bar" 137 } 138 } 139 } 140 } 141 } 142 -- out/eval/stats -- 143 Leaks: 0 144 Freed: 18 145 Reused: 12 146 Allocs: 6 147 Retain: 0 148 149 Unifications: 18 150 Conjuncts: 30 151 Disjuncts: 18 152 -- out/eval -- 153 (struct){ 154 a: (struct){ 155 A: (struct){ 156 b: (struct){ 157 B: (struct){ 158 name: (string){ "A" } 159 kind: (string){ "B" } 160 } 161 } 162 } 163 C: (struct){ 164 b: (struct){ 165 D: (struct){ 166 name: (string){ "C" } 167 kind: (string){ "D" } 168 } 169 } 170 } 171 EE: (struct){ 172 b: (struct){ 173 FF: (struct){ 174 c: (string){ "bar" } 175 name: (string){ "EE" } 176 kind: (string){ "FF" } 177 } 178 } 179 } 180 } 181 }