github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/encoding/protobuf/textproto/testdata/decoder/comments.txtar (about) 1 // TODO: there are many missing comments, but these really are consequences 2 // of the buggy textpbfmt library. 3 4 -- foo.cue -- 5 a: string 6 b: [...int] 7 c: [...int32] 8 m: [...#Msg] 9 #Msg: { 10 x: string 11 y: string 12 } 13 -- input.textproto -- 14 # file comment 15 16 # doc comment a 17 a: "dsfadsafsaf" # line comment 18 19 # floating comment a-b 20 21 # doc comment b 22 b: [ 23 # pre-elem comment 24 25 # doc elem 0 26 123, # elem 0 line comment 27 # trailing elem 0 28 29 # inbetween comment 1 30 31 # inbetween comment 2 32 33 # doc elem 1 34 456 # elem 1 line comment 35 # trailing elem 1 36 37 # final floating 1 38 39 # final floating 2 40 ] 41 # floating end 42 43 c: 2342134 # line elem 0 44 c: 2342135 # line elem 1 45 # inbetween elems 46 c: 2342136 # line elem 2 47 # after list c 48 49 # floating 50 51 m { 52 x: "sdfff" # inner line comment 53 y: "q\"qq\\q\n" 54 # after last value 55 } # after elem line 56 # after elem separate 57 m { 58 x: " sdfff2 \321\202\320\265\321\201\321\202 " 59 y: "q\tqq<>q2&\001\377" 60 } # after list line 61 # after list 62 63 # floating end 64 65 -- out/decode -- 66 // file comment 67 68 // doc comment a 69 a: "dsfadsafsaf" // line comment 70 71 // floating comment a-b 72 73 // doc comment b 74 b: [ 75 // pre-elem comment 76 123, // elem 0 line comment 77 78 // trailing elem 0 79 // inbetween comment 2 80 456, // elem 1 line comment 81 82 // trailing elem 1 83 84 // final floating 2 85 ] 86 87 // floating end 88 89 c: [2342134, // line elem 0 90 2342135, // line elem 1 91 // inbetween elems 92 2342136, // line elem 2 93 ] 94 95 // after list c 96 97 // floating 98 99 m: [{ 100 x: "sdfff" // inner line comment 101 y: "q\"qq\\q\n" 102 103 // after last value 104 105 }, // after elem line 106 // after elem separate 107 { 108 x: " sdfff2 тест " 109 y: "q\tqq<>q2&\u0001�" 110 }, // after list line 111 ] 112 113 // after list 114 115 // floating end