cuelang.org/go@v0.13.0/cue/testdata/definitions/defembed.txtar (about)

     1  -- in.cue --
     2  a: {
     3  	#A
     4  }
     5  
     6  a: c: 1
     7  
     8  #A: b: 1
     9  
    10  b: {
    11  	#A
    12      leaf: "leaf value"
    13      interpolation: "more \(leaf_ref)"
    14      leaf_ref: leaf
    15  }
    16  -- out/eval/stats --
    17  Leaks:  0
    18  Freed:  11
    19  Reused: 7
    20  Allocs: 4
    21  Retain: 2
    22  
    23  Unifications: 11
    24  Conjuncts:    17
    25  Disjuncts:    13
    26  -- out/evalalpha --
    27  Errors:
    28  a.c: field not allowed:
    29      ./in.cue:5:4
    30  
    31  Result:
    32  (_|_){
    33    // [eval]
    34    a: (_|_){
    35      // [eval]
    36      c: (_|_){
    37        // [eval] a.c: field not allowed:
    38        //     ./in.cue:5:4
    39      }
    40      b: (int){ 1 }
    41    }
    42    #A: (#struct){
    43      b: (int){ 1 }
    44    }
    45    b: (#struct){
    46      leaf: (string){ "leaf value" }
    47      interpolation: (string){ "more leaf value" }
    48      leaf_ref: (string){ "leaf value" }
    49      b: (int){ 1 }
    50    }
    51  }
    52  -- diff/-out/evalalpha<==>+out/eval --
    53  diff old new
    54  --- old
    55  +++ new
    56  @@ -1,9 +1,6 @@
    57   Errors:
    58   a.c: field not allowed:
    59  -    ./in.cue:1:4
    60  -    ./in.cue:2:2
    61       ./in.cue:5:4
    62  -    ./in.cue:7:5
    63   
    64   Result:
    65   (_|_){
    66  @@ -10,22 +7,19 @@
    67     // [eval]
    68     a: (_|_){
    69       // [eval]
    70  -    b: (int){ 1 }
    71       c: (_|_){
    72         // [eval] a.c: field not allowed:
    73  -      //     ./in.cue:1:4
    74  -      //     ./in.cue:2:2
    75         //     ./in.cue:5:4
    76  -      //     ./in.cue:7:5
    77       }
    78  +    b: (int){ 1 }
    79     }
    80     #A: (#struct){
    81       b: (int){ 1 }
    82     }
    83     b: (#struct){
    84  -    b: (int){ 1 }
    85       leaf: (string){ "leaf value" }
    86       interpolation: (string){ "more leaf value" }
    87       leaf_ref: (string){ "leaf value" }
    88  +    b: (int){ 1 }
    89     }
    90   }
    91  -- diff/todo/p2 --
    92  Missing positions / reordering.
    93  -- out/eval --
    94  Errors:
    95  a.c: field not allowed:
    96      ./in.cue:1:4
    97      ./in.cue:2:2
    98      ./in.cue:5:4
    99      ./in.cue:7:5
   100  
   101  Result:
   102  (_|_){
   103    // [eval]
   104    a: (_|_){
   105      // [eval]
   106      b: (int){ 1 }
   107      c: (_|_){
   108        // [eval] a.c: field not allowed:
   109        //     ./in.cue:1:4
   110        //     ./in.cue:2:2
   111        //     ./in.cue:5:4
   112        //     ./in.cue:7:5
   113      }
   114    }
   115    #A: (#struct){
   116      b: (int){ 1 }
   117    }
   118    b: (#struct){
   119      b: (int){ 1 }
   120      leaf: (string){ "leaf value" }
   121      interpolation: (string){ "more leaf value" }
   122      leaf_ref: (string){ "leaf value" }
   123    }
   124  }
   125  -- out/compile --
   126  --- in.cue
   127  {
   128    a: {
   129      〈1;#A〉
   130    }
   131    a: {
   132      c: 1
   133    }
   134    #A: {
   135      b: 1
   136    }
   137    b: {
   138      〈1;#A〉
   139      leaf: "leaf value"
   140      interpolation: "more \(〈0;leaf_ref〉)"
   141      leaf_ref: 〈0;leaf〉
   142    }
   143  }