cuelang.org/go@v0.13.0/cue/testdata/basicrewrite/020_resolved_self-reference_cycles__Issue_19.txtar (about)

     1  #name: resolved self-reference cycles: Issue 19
     2  #evalPartial
     3  -- in.cue --
     4  // CUE knows how to resolve the following:
     5  x: y + 100
     6  y: x - 100
     7  x: 200
     8  
     9  z1: z2 + 1
    10  z2: z3 + 2
    11  z3: z1 - 3
    12  z3: 8
    13  
    14  // TODO: extensive tests with disjunctions.
    15  -- out/def --
    16  // CUE knows how to resolve the following:
    17  x:  200
    18  y:  100
    19  z1: 11
    20  z2: 10
    21  z3: 8
    22  -- out/export --
    23  // CUE knows how to resolve the following:
    24  x:  200
    25  y:  100
    26  z1: 11
    27  z2: 10
    28  z3: 8
    29  -- out/yaml --
    30  x: 200
    31  y: 100
    32  z1: 11
    33  z2: 10
    34  z3: 8
    35  -- out/json --
    36  {"x":200,"y":100,"z1":11,"z2":10,"z3":8}
    37  -- out/legacy-debug --
    38  <0>{x: 200, y: 100, z1: 11, z2: 10, z3: 8}
    39  -- out/compile --
    40  --- in.cue
    41  {
    42    x: (〈0;y〉 + 100)
    43    y: (〈0;x〉 - 100)
    44    x: 200
    45    z1: (〈0;z2〉 + 1)
    46    z2: (〈0;z3〉 + 2)
    47    z3: (〈0;z1〉 - 3)
    48    z3: 8
    49  }
    50  -- out/eval/stats --
    51  Leaks:  0
    52  Freed:  6
    53  Reused: 2
    54  Allocs: 4
    55  Retain: 3
    56  
    57  Unifications: 6
    58  Conjuncts:    6
    59  Disjuncts:    8
    60  -- out/eval --
    61  (struct){
    62    x: (int){ 200 }
    63    y: (int){ 100 }
    64    z1: (int){ 11 }
    65    z2: (int){ 10 }
    66    z3: (int){ 8 }
    67  }