github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/cue/format/testdata/simplify.input (about)

     1  import "time"
     2  
     3  "foo": "bar": "str"
     4  
     5  a: "B": 42
     6  
     7  "a.b": "foo-": "cc_dd": x
     8  
     9  @attr(3)
    10  
    11  a:
    12      b:
    13          c: 3
    14  
    15  // references to bar are all shadowed and this can be safely turned into
    16  // an identifier.
    17  "bar": "str"
    18  
    19  // These references would be directly referred to if turned into an identifier.
    20  // The quotes should therefore not be removed.
    21  "baz1": 3
    22  "baz2": 3
    23  "baz3": 3 // TODO: could be simplified.
    24  
    25  // These string labels may be turned into an identifier.
    26  "qux": 4
    27  "quux": 5
    28  
    29  // TODO(legacy): Don't simplify "hidden" fields for now.
    30  "_foo": 3
    31  
    32  // Issue #294
    33  "\("x")": "x"
    34  
    35  (x): "foo"
    36  
    37  a :: {
    38      [string]: _
    39      foo: 2
    40  }
    41  
    42  "#A": dontSimplify
    43  
    44  x: {
    45  @tag0(foo)
    46      r1: baz1
    47      bar: r2: bar
    48      r3: bar
    49      E=quux: 3
    50  
    51          @tag1(bar)
    52      r4: quux
    53      [baz2="str"]: 4
    54      r5: baz2
    55      [baz3="bar"]: name: baz3
    56      "Time": time.Time
    57  }