github.com/syumai/protoreflect@v1.7.1-0.20200810020253-2ac7e3b3a321/desc/protoprint/testfiles/test-non-files-full.txt (about) 1 -------- desc_test_comments.proto (*desc.FileDescriptor) -------- 2 // This is the first detached comment for the syntax. 3 4 // This is a second detached comment. 5 6 // This is a third. 7 8 // Syntax comment... 9 syntax = "proto2"; // Syntax trailer. 10 11 // And now the package declaration 12 package foo.bar; 13 14 // option comments FTW!!! 15 option go_package = "github.com/syumai/protoreflect/internal/testprotos"; 16 17 import "google/protobuf/empty.proto"; 18 19 import "desc_test_options.proto"; 20 21 // Multiple white space lines (like above) cannot 22 // be preserved... 23 24 // We need a request for our RPC service below. 25 message /* detached message name */ /* request with a capital R */ Request /* trailer */ { 26 option deprecated = true; // deprecated! 27 28 // A field comment 29 repeated int32 ids = /* detached tag */ /* tag numero uno */ 1 /* 30 * tag trailer 31 * that spans multiple lines... 32 * more than two. 33 */ [packed = true /* packed! */, json_name = "|foo|" /* custom JSON! */, (testprotos.ffubar) = "abc", (testprotos.ffubarb) = "xyz"]; // field trailer #1... 34 35 // lead mfubar 36 option (testprotos.mfubar) = true; // trailing mfubar 37 38 // some detached comments 39 40 // some detached comments 41 42 // Another field comment 43 44 // label comment 45 optional /* type comment */ string /* name comment */ name = 2 [/* default lead */ default = "fubar" /* default trail */]; 46 47 extensions 100 to 200; 48 49 extensions 201 to 250 [(testprotos.exfubarb) = "\000\001\002\003\004\005\006\007", (testprotos.exfubar) = "splat!"]; 50 51 reserved 10 to 20, 30 to 50; 52 53 reserved "foo", "bar", "baz"; 54 55 // Group comment 56 optional group Extras = 3 { 57 // this is a custom option 58 option (testprotos.mfubar) = false; 59 60 optional double dbl = 1; 61 62 optional float flt = 2; 63 64 option no_standard_descriptor_accessor = false; 65 66 // Leading comment... 67 optional string str = 3; // Trailing comment... 68 } 69 70 enum MarioCharacters /* "super"! */ { 71 // allow_alias comments! 72 option allow_alias = true; 73 74 MARIO = 1 [(testprotos.evfubars) = -314, (testprotos.evfubar) = 278]; 75 76 LUIGI = 2 [(testprotos.evfubaruf) = 100, (testprotos.evfubaru) = 200]; 77 78 PEACH = 3; 79 80 BOWSER = 4; 81 82 option (testprotos.efubars) = -321; 83 84 WARIO = 5; 85 86 WALUIGI = 6; 87 88 SHY_GUY = 7 [(testprotos.evfubarsf) = 10101]; 89 90 HEY_HO = 7; 91 92 MAGIKOOPA = 8; 93 94 KAMEK = 8; 95 96 SNIFIT = -101; 97 98 option (testprotos.efubar) = 123; 99 } 100 101 // can be this or that 102 oneof abc { 103 string this = 4; 104 105 int32 that = 5; 106 } 107 108 // can be these or those 109 oneof xyz { 110 string these = 6; 111 112 int32 those = 7; 113 } 114 115 // map field 116 map<string, string> things = 8; 117 } 118 // And next we'll need some extensions... 119 120 extend /* extendee comment */ Request /* extendee trailer */ { 121 // comment for guid1 122 optional uint64 guid1 = 123; 123 124 // ... and a comment for guid2 125 optional uint64 guid2 = 124; 126 } 127 // extend trailer... 128 129 message /* name leading comment */ AnEmptyMessage /* name trailing comment */ { 130 } 131 132 // Service comment 133 service /* service name */ RpcService { 134 // option that sets field 135 option (testprotos.sfubar) = { id:100 name:"bob" }; 136 137 option deprecated = false; // DEPRECATED! 138 139 option (testprotos.sfubare) = VALUE; 140 141 // Method comment 142 rpc /* rpc name */ StreamingRpc /* comment A */ ( /* comment C */ stream Request ) returns ( /*comment E */ Request ); 143 144 rpc UnaryRpc ( Request ) returns ( google.protobuf.Empty ) { 145 option deprecated = true; 146 147 option (testprotos.mtfubar) = 12.340000; 148 149 option (testprotos.mtfubard) = 123.456000; 150 } 151 } 152 // service trailer 153 -------- foo.bar.Request (*desc.MessageDescriptor) -------- 154 // Multiple white space lines (like above) cannot 155 // be preserved... 156 157 // We need a request for our RPC service below. 158 message /* detached message name */ /* request with a capital R */ Request /* trailer */ { 159 option deprecated = true; // deprecated! 160 161 // A field comment 162 repeated int32 ids = /* detached tag */ /* tag numero uno */ 1 /* 163 * tag trailer 164 * that spans multiple lines... 165 * more than two. 166 */ [packed = true /* packed! */, json_name = "|foo|" /* custom JSON! */, (testprotos.ffubar) = "abc", (testprotos.ffubarb) = "xyz"]; // field trailer #1... 167 168 // lead mfubar 169 option (testprotos.mfubar) = true; // trailing mfubar 170 171 // some detached comments 172 173 // some detached comments 174 175 // Another field comment 176 177 // label comment 178 optional /* type comment */ string /* name comment */ name = 2 [/* default lead */ default = "fubar" /* default trail */]; 179 180 extensions 100 to 200; 181 182 extensions 201 to 250 [(testprotos.exfubarb) = "\000\001\002\003\004\005\006\007", (testprotos.exfubar) = "splat!"]; 183 184 reserved 10 to 20, 30 to 50; 185 186 reserved "foo", "bar", "baz"; 187 188 // Group comment 189 optional group Extras = 3 { 190 // this is a custom option 191 option (testprotos.mfubar) = false; 192 193 optional double dbl = 1; 194 195 optional float flt = 2; 196 197 option no_standard_descriptor_accessor = false; 198 199 // Leading comment... 200 optional string str = 3; // Trailing comment... 201 } 202 203 enum MarioCharacters /* "super"! */ { 204 // allow_alias comments! 205 option allow_alias = true; 206 207 MARIO = 1 [(testprotos.evfubars) = -314, (testprotos.evfubar) = 278]; 208 209 LUIGI = 2 [(testprotos.evfubaruf) = 100, (testprotos.evfubaru) = 200]; 210 211 PEACH = 3; 212 213 BOWSER = 4; 214 215 option (testprotos.efubars) = -321; 216 217 WARIO = 5; 218 219 WALUIGI = 6; 220 221 SHY_GUY = 7 [(testprotos.evfubarsf) = 10101]; 222 223 HEY_HO = 7; 224 225 MAGIKOOPA = 8; 226 227 KAMEK = 8; 228 229 SNIFIT = -101; 230 231 option (testprotos.efubar) = 123; 232 } 233 234 // can be this or that 235 oneof abc { 236 string this = 4; 237 238 int32 that = 5; 239 } 240 241 // can be these or those 242 oneof xyz { 243 string these = 6; 244 245 int32 those = 7; 246 } 247 248 // map field 249 map<string, string> things = 8; 250 } 251 // And next we'll need some extensions... 252 -------- foo.bar.Request.ids (*desc.FieldDescriptor) -------- 253 // A field comment 254 repeated int32 ids = /* detached tag */ /* tag numero uno */ 1 /* 255 * tag trailer 256 * that spans multiple lines... 257 * more than two. 258 */ [packed = true /* packed! */, json_name = "|foo|" /* custom JSON! */, (testprotos.ffubar) = "abc", (testprotos.ffubarb) = "xyz"]; // field trailer #1... 259 -------- foo.bar.Request.name (*desc.FieldDescriptor) -------- 260 // some detached comments 261 262 // some detached comments 263 264 // Another field comment 265 266 // label comment 267 optional /* type comment */ string /* name comment */ name = 2 [/* default lead */ default = "fubar" /* default trail */]; 268 -------- foo.bar.Request.extras (*desc.FieldDescriptor) -------- 269 // Group comment 270 optional group Extras = 3 { 271 // this is a custom option 272 option (testprotos.mfubar) = false; 273 274 optional double dbl = 1; 275 276 optional float flt = 2; 277 278 option no_standard_descriptor_accessor = false; 279 280 // Leading comment... 281 optional string str = 3; // Trailing comment... 282 } 283 -------- foo.bar.Request.this (*desc.FieldDescriptor) -------- 284 string this = 4; 285 -------- foo.bar.Request.that (*desc.FieldDescriptor) -------- 286 int32 that = 5; 287 -------- foo.bar.Request.these (*desc.FieldDescriptor) -------- 288 string these = 6; 289 -------- foo.bar.Request.those (*desc.FieldDescriptor) -------- 290 int32 those = 7; 291 -------- foo.bar.Request.things (*desc.FieldDescriptor) -------- 292 // map field 293 map<string, string> things = 8; 294 -------- foo.bar.Request.abc (*desc.OneOfDescriptor) -------- 295 oneof abc { 296 string this = 4; 297 298 int32 that = 5; 299 } 300 -------- foo.bar.Request.xyz (*desc.OneOfDescriptor) -------- 301 oneof xyz { 302 string these = 6; 303 304 int32 those = 7; 305 } 306 -------- foo.bar.Request.Extras (*desc.MessageDescriptor) -------- 307 // Group comment 308 message /* group name */ Extras { 309 // this is a custom option 310 option (testprotos.mfubar) = false; 311 312 optional double dbl = 1; 313 314 optional float flt = 2; 315 316 option no_standard_descriptor_accessor = false; 317 318 // Leading comment... 319 optional string str = 3; // Trailing comment... 320 } 321 -------- foo.bar.Request.Extras.dbl (*desc.FieldDescriptor) -------- 322 optional double dbl = 1; 323 -------- foo.bar.Request.Extras.flt (*desc.FieldDescriptor) -------- 324 optional float flt = 2; 325 -------- foo.bar.Request.Extras.str (*desc.FieldDescriptor) -------- 326 // Leading comment... 327 optional string str = 3; // Trailing comment... 328 -------- foo.bar.Request.ThingsEntry (*desc.MessageDescriptor) -------- 329 message ThingsEntry { 330 option map_entry = true; 331 332 optional string key = 1; 333 334 optional string value = 2; 335 } 336 -------- foo.bar.Request.ThingsEntry.key (*desc.FieldDescriptor) -------- 337 optional string key = 1; 338 -------- foo.bar.Request.ThingsEntry.value (*desc.FieldDescriptor) -------- 339 optional string value = 2; 340 -------- foo.bar.Request.MarioCharacters (*desc.EnumDescriptor) -------- 341 enum MarioCharacters /* "super"! */ { 342 // allow_alias comments! 343 option allow_alias = true; 344 345 MARIO = 1 [(testprotos.evfubars) = -314, (testprotos.evfubar) = 278]; 346 347 LUIGI = 2 [(testprotos.evfubaruf) = 100, (testprotos.evfubaru) = 200]; 348 349 PEACH = 3; 350 351 BOWSER = 4; 352 353 option (testprotos.efubars) = -321; 354 355 WARIO = 5; 356 357 WALUIGI = 6; 358 359 SHY_GUY = 7 [(testprotos.evfubarsf) = 10101]; 360 361 HEY_HO = 7; 362 363 MAGIKOOPA = 8; 364 365 KAMEK = 8; 366 367 SNIFIT = -101; 368 369 option (testprotos.efubar) = 123; 370 } 371 -------- foo.bar.Request.MarioCharacters.MARIO (*desc.EnumValueDescriptor) -------- 372 MARIO = 1 [(testprotos.evfubars) = -314, (testprotos.evfubar) = 278]; 373 -------- foo.bar.Request.MarioCharacters.LUIGI (*desc.EnumValueDescriptor) -------- 374 LUIGI = 2 [(testprotos.evfubaruf) = 100, (testprotos.evfubaru) = 200]; 375 -------- foo.bar.Request.MarioCharacters.PEACH (*desc.EnumValueDescriptor) -------- 376 PEACH = 3; 377 -------- foo.bar.Request.MarioCharacters.BOWSER (*desc.EnumValueDescriptor) -------- 378 BOWSER = 4; 379 -------- foo.bar.Request.MarioCharacters.WARIO (*desc.EnumValueDescriptor) -------- 380 WARIO = 5; 381 -------- foo.bar.Request.MarioCharacters.WALUIGI (*desc.EnumValueDescriptor) -------- 382 WALUIGI = 6; 383 -------- foo.bar.Request.MarioCharacters.SHY_GUY (*desc.EnumValueDescriptor) -------- 384 SHY_GUY = 7 [(testprotos.evfubarsf) = 10101]; 385 -------- foo.bar.Request.MarioCharacters.HEY_HO (*desc.EnumValueDescriptor) -------- 386 HEY_HO = 7; 387 -------- foo.bar.Request.MarioCharacters.MAGIKOOPA (*desc.EnumValueDescriptor) -------- 388 MAGIKOOPA = 8; 389 -------- foo.bar.Request.MarioCharacters.KAMEK (*desc.EnumValueDescriptor) -------- 390 KAMEK = 8; 391 -------- foo.bar.Request.MarioCharacters.SNIFIT (*desc.EnumValueDescriptor) -------- 392 SNIFIT = -101; 393 -------- foo.bar.AnEmptyMessage (*desc.MessageDescriptor) -------- 394 message /* name leading comment */ AnEmptyMessage /* name trailing comment */ { 395 } 396 -------- foo.bar.guid1 (*desc.FieldDescriptor) -------- 397 extend /* extendee comment */ Request /* extendee trailer */ { 398 // comment for guid1 399 optional uint64 guid1 = 123; 400 } 401 -------- foo.bar.guid2 (*desc.FieldDescriptor) -------- 402 extend Request { 403 // ... and a comment for guid2 404 optional uint64 guid2 = 124; 405 } 406 -------- foo.bar.RpcService (*desc.ServiceDescriptor) -------- 407 // Service comment 408 service /* service name */ RpcService { 409 // option that sets field 410 option (testprotos.sfubar) = { id:100 name:"bob" }; 411 412 option deprecated = false; // DEPRECATED! 413 414 option (testprotos.sfubare) = VALUE; 415 416 // Method comment 417 rpc /* rpc name */ StreamingRpc /* comment A */ ( /* comment C */ stream Request ) returns ( /*comment E */ Request ); 418 419 rpc UnaryRpc ( Request ) returns ( google.protobuf.Empty ) { 420 option deprecated = true; 421 422 option (testprotos.mtfubar) = 12.340000; 423 424 option (testprotos.mtfubard) = 123.456000; 425 } 426 } 427 // service trailer 428 -------- foo.bar.RpcService.StreamingRpc (*desc.MethodDescriptor) -------- 429 // Method comment 430 rpc /* rpc name */ StreamingRpc /* comment A */ ( /* comment C */ stream Request ) returns ( /*comment E */ Request ); 431 -------- foo.bar.RpcService.UnaryRpc (*desc.MethodDescriptor) -------- 432 rpc UnaryRpc ( Request ) returns ( google.protobuf.Empty ) { 433 option deprecated = true; 434 435 option (testprotos.mtfubar) = 12.340000; 436 437 option (testprotos.mtfubard) = 123.456000; 438 }