github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/cue/format/testdata/comments.input (about) 1 // Package line 1 group 1 2 // Package line 2 group 1 3 4 // Package line 1 - group 2 5 // Package line 2 - group 2 6 package comments 7 8 // Emit line 1 group 1 9 10 // Emit line 1 group 2 11 // Emit line 2 group 2 12 { 13 // Inside Emit 14 } 15 16 a: 3 // a line comment 17 18 b: 4 // line comment that is last in the file. 19 cc: 555 // align comments 20 21 // don't simplify 22 a: { 23 b: 2 24 } 25 26 // simplify 27 a: { 28 b: c: { 29 d: 1 30 } 31 } 32 33 // unchanged 34 a: b: [1] 35 36 // don't simplify 37 a: b: { 38 c: 2 39 } 40 41 // rewrite okay 42 a: b: c: { 43 d: 2 44 } 45 46 m: { 47 } 48 m: { 49 // empty with comment 50 } 51 52 // Issue #478 53 struct1: { 54 // This is a comment 55 56 // This is a comment 57 58 // Another comment 59 60 something: { 61 } 62 // extra comment 63 } 64 65 struct2: { 66 // This is a comment 67 68 // This is a comment 69 70 // Another comment 71 something: { 72 } 73 74 // extra comment 75 } 76 77 list1: [ 78 // Comment1 79 80 // Comment2 81 82 // Another comment 83 { 84 }, 85 86 // Comment 3 87 ] 88 89 list2: [ 90 // foo 91 ] 92 93 list3: [ 94 // foo 95 96 // bar 97 ] 98 99 funcArg1: foo( 100 // Comment1 101 102 // Comment2 103 3 104 105 // Comment3 106 ) 107 108 funcArg2: foo( 109 // Comment1 110 111 // Comment2 112 113 3 114 // Comment3 115 ) 116 117 funcArg3: foo( 118 2, 119 120 // Comment1 121 122 // Comment2 123 3 124 125 // Comment3 126 )