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