github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/cue/testdata/compile/json.txtar (about)

     1  #noformat
     2  Issue #721
     3  
     4  -- in.cue --
     5  // allow front-style commas
     6  a
     7  : { "key": "value"
     8  , "key2"
     9  : "value2"
    10  }
    11  
    12  , b: [
    13      0
    14  ,   1
    15  ,       2
    16          ,3,
    17      4
    18  
    19      , 5
    20  ]
    21  -- out/compile --
    22  --- in.cue
    23  {
    24    a: {
    25      key: "value"
    26      key2: "value2"
    27    }
    28    b: [
    29      0,
    30      1,
    31      2,
    32      3,
    33      4,
    34      5,
    35    ]
    36  }
    37  -- out/eval --
    38  (struct){
    39    a: (struct){
    40      key: (string){ "value" }
    41      key2: (string){ "value2" }
    42    }
    43    b: (#list){
    44      0: (int){ 0 }
    45      1: (int){ 1 }
    46      2: (int){ 2 }
    47      3: (int){ 3 }
    48      4: (int){ 4 }
    49      5: (int){ 5 }
    50    }
    51  }