| # DO NOT EDIT; generated by go run testdata/gen.go |
| # |
| #name: field templates |
| #evalFull |
| -- in.cue -- |
| a: { |
| {[name=_]: int} |
| k: 1 |
| } |
| b: { |
| {[X=_]: {x: 0, y: *1 | int}} |
| v: {} |
| w: {y: 0} |
| } |
| b: {[y=_]: {}} // TODO: allow different name |
| c: { |
| {[Name=_]: {name: Name, y: 1}} |
| foo: {} |
| bar: _ |
| } |
| -- out/def -- |
| a: { |
| {[name=string]: int} |
| k: 1 |
| } |
| b: { |
| {[X=string]: { |
| x: 0, y: *1 | int |
| }} |
| v: { |
| x: 0 |
| y: *1 | int |
| } |
| w: { |
| x: 0 |
| y: 0 |
| } |
| } |
| c: { |
| {[Name=string]: { |
| y: 1, name: Name |
| }} |
| foo: { |
| y: 1 |
| name: "foo" |
| } |
| bar: { |
| y: 1 |
| name: "bar" |
| } |
| } |
| -- out/export -- |
| 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" |
| } |
| } |
| -- out/yaml -- |
| 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 |
| -- out/json -- |
| {"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"}}} |
| -- out/legacy-debug -- |
| <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"}}} |
| -- out/compile -- |
| --- in.cue |
| { |
| a: { |
| { |
| [_]: int |
| } |
| k: 1 |
| } |
| b: { |
| { |
| [_]: { |
| x: 0 |
| y: (*1|int) |
| } |
| } |
| v: {} |
| w: { |
| y: 0 |
| } |
| } |
| b: { |
| [_]: {} |
| } |
| c: { |
| { |
| [_]: { |
| name: 〈1;-〉 |
| y: 1 |
| } |
| } |
| foo: {} |
| bar: _ |
| } |
| } |
| -- out/eval -- |
| (struct){ |
| a: (struct){ |
| k: (int){ 1 } |
| } |
| b: (struct){ |
| v: (struct){ |
| x: (int){ 0 } |
| y: (int){ |(*(int){ 1 }, (int){ int }) } |
| } |
| w: (struct){ |
| y: (int){ 0 } |
| x: (int){ 0 } |
| } |
| } |
| c: (struct){ |
| foo: (struct){ |
| name: (string){ "foo" } |
| y: (int){ 1 } |
| } |
| bar: (struct){ |
| name: (string){ "bar" } |
| y: (int){ 1 } |
| } |
| } |
| } |