...

Text file src/cuelang.org/go/cue/format/testdata/simplify.golden

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

     1import "time"
     2
     3foo: bar: "str"
     4
     5a: B: 42
     6
     7"a.b": "foo-": cc_dd: x
     8
     9@attr(3)
    10
    11a: b: c: 3
    12
    13// references to bar are all shadowed and this can be safely turned into
    14// an identifier.
    15bar: "str"
    16
    17// These references would be directly referred to if turned into an identifier.
    18// The quotes should therefore not be removed.
    19"baz1": 3
    20"baz2": 3
    21"baz3": 3 // TODO: could be simplified.
    22
    23// These string labels may be turned into an identifier.
    24qux:  4
    25quux: 5
    26
    27// TODO(legacy): Don't simplify "hidden" fields for now.
    28"_foo": 3
    29
    30// Issue #294
    31"\("x")": "x"
    32
    33(x):  "foo"
    34(x)?: "foo"
    35(x)!: "foo"
    36
    37a: {
    38	foo: 2
    39	...
    40}
    41
    42"#A": dontSimplify
    43
    44x: {
    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}

View as plain text