...

Text file src/cuelang.org/go/cue/testdata/eval/issue494.txtar

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

     1-- in.cue --
     2_Q: [{pos: 0}, {pos: 1}]
     3
     4a: [rn=string]: _Q[0:len(a[rn])]
     5a: ben: [{}]
     6
     7b: [rn=string]: _Q[0:1]
     8b: ben: [{}]
     9
    10c: [rn=string]: [...{l: len(a[rn])}]
    11c: ben: [{}]
    12
    13#d: [rn=string]: [...{pos: uint}] & _Q[0:len(#d[rn])]
    14#d: ben: [{}]
    15
    16d: #d
    17-- out/eval/stats --
    18Leaks:  0
    19Freed:  26
    20Reused: 21
    21Allocs: 5
    22Retain: 0
    23
    24Unifications: 26
    25Conjuncts:    56
    26Disjuncts:    28
    27-- out/eval --
    28(struct){
    29  _Q: (#list){
    30    0: (struct){
    31      pos: (int){ 0 }
    32    }
    33    1: (struct){
    34      pos: (int){ 1 }
    35    }
    36  }
    37  a: (struct){
    38    ben: (#list){
    39      0: (struct){
    40        pos: (int){ 0 }
    41      }
    42    }
    43  }
    44  b: (struct){
    45    ben: (#list){
    46      0: (struct){
    47        pos: (int){ 0 }
    48      }
    49    }
    50  }
    51  c: (struct){
    52    ben: (#list){
    53      0: (struct){
    54        l: (int){ 1 }
    55      }
    56    }
    57  }
    58  #d: (#struct){
    59    ben: (#list){
    60      0: (#struct){
    61        pos: (int){ 0 }
    62      }
    63    }
    64  }
    65  d: (#struct){
    66    ben: (#list){
    67      0: (#struct){
    68        pos: (int){ 0 }
    69      }
    70    }
    71  }
    72}
    73-- out/compile --
    74--- in.cue
    75{
    76  _Q: [
    77    {
    78      pos: 0
    79    },
    80    {
    81      pos: 1
    82    },
    83  ]
    84  a: {
    85    [string]: 〈1;_Q〉[0:len(〈1;a〉[〈0;-〉])]
    86  }
    87  a: {
    88    ben: [
    89      {},
    90    ]
    91  }
    92  b: {
    93    [string]: 〈1;_Q〉[0:1]
    94  }
    95  b: {
    96    ben: [
    97      {},
    98    ]
    99  }
   100  c: {
   101    [string]: [
   102      ...{
   103        l: len(〈3;a〉[〈2;-〉])
   104      },
   105    ]
   106  }
   107  c: {
   108    ben: [
   109      {},
   110    ]
   111  }
   112  #d: {
   113    [string]: ([
   114      ...{
   115        pos: &(int, >=0)
   116      },
   117    ] & 〈1;_Q〉[0:len(〈1;#d〉[〈0;-〉])])
   118  }
   119  #d: {
   120    ben: [
   121      {},
   122    ]
   123  }
   124  d: 〈0;#d〉
   125}

View as plain text