...

Text file src/cuelang.org/go/cue/testdata/export/007.txtar

Documentation: cuelang.org/go/cue/testdata/export

     1-- in.cue --
     2{
     3	#a: {b: 2.0, s: "abc"}
     4	b: #a.b
     5	c: #a.c
     6	d: #a["d"]
     7	e: #a.t[2:3]
     8}
     9-- out/def --
    10#a: {
    11	b: 2.0
    12	s: "abc"
    13}
    14b: 2.0
    15c: _|_ // undefined field "c"
    16d: _|_ // undefined field "d"
    17e: _|_ // undefined field "t"
    18-- out/compile --
    19--- in.cue
    20{
    21  {
    22    #a: {
    23      b: 2.0
    24      s: "abc"
    25    }
    26    b: 〈0;#a〉.b
    27    c: 〈0;#a〉.c
    28    d: 〈0;#a〉["d"]
    29    e: 〈0;#a〉.t[2:3]
    30  }
    31}
    32-- out/eval/stats --
    33Leaks:  0
    34Freed:  8
    35Reused: 5
    36Allocs: 3
    37Retain: 0
    38
    39Unifications: 8
    40Conjuncts:    10
    41Disjuncts:    8
    42-- out/eval --
    43Errors:
    44c: undefined field: c:
    45    ./in.cue:4:8
    46d: undefined field: d:
    47    ./in.cue:5:8
    48e: undefined field: t:
    49    ./in.cue:6:8
    50
    51Result:
    52(_|_){
    53  // [eval]
    54  #a: (#struct){
    55    b: (float){ 2.0 }
    56    s: (string){ "abc" }
    57  }
    58  b: (float){ 2.0 }
    59  c: (_|_){
    60    // [eval] c: undefined field: c:
    61    //     ./in.cue:4:8
    62  }
    63  d: (_|_){
    64    // [eval] d: undefined field: d:
    65    //     ./in.cue:5:8
    66  }
    67  e: (_|_){
    68    // [eval] e: undefined field: t:
    69    //     ./in.cue:6:8
    70  }
    71}

View as plain text