Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | // Sample .proto file that we can translate to the corresponding .fbs. |
| 2 | |
| 3 | option some_option = is_ignored; |
| 4 | import "imported.proto"; |
| 5 | |
| 6 | package proto.test; |
| 7 | |
| 8 | /// Enum doc comment. |
| 9 | enum ProtoEnum { |
| 10 | option allow_alias = true; |
| 11 | NUL = 0; |
| 12 | FOO = 1; |
| 13 | /// Enum 2nd value doc comment misaligned. |
| 14 | BAR = 5; |
| 15 | // Aliases |
| 16 | FOO_A1 = 1; |
| 17 | BAR_A1 = 5; |
| 18 | FOO_A2 = 1; |
| 19 | } |
| 20 | |
| 21 | /// 2nd table doc comment with |
| 22 | /// many lines. |
| 23 | message ProtoMessage { |
| 24 | // Ignored non-doc comment. |
| 25 | // A nested message declaration, will be moved to top level in .fbs |
| 26 | message OtherMessage { |
| 27 | optional double a = 26; |
| 28 | /// doc comment for b. |
| 29 | optional float b = 32 [default = 3.14149]; |
| 30 | } |
| 31 | optional int32 c = 12 [default = 16]; |
| 32 | optional int64 d = 1 [default = 0]; |
| 33 | optional uint32 p = 1; |
| 34 | optional uint64 e = 2; |
| 35 | /// doc comment for f. |
| 36 | optional sint32 f = 3 [default = -1]; |
| 37 | optional sint64 g = 4; |
| 38 | optional fixed32 h = 5; |
| 39 | optional fixed64 q = 6; |
| 40 | optional sfixed32 i = 7; |
| 41 | optional sfixed64 j = 8; |
| 42 | /// doc comment for k. |
| 43 | optional bool k = 9; |
| 44 | /// doc comment for l on 2 |
| 45 | /// lines |
| 46 | required string l = 10; |
| 47 | optional bytes m = 11; |
| 48 | optional OtherMessage n = 12; |
| 49 | repeated string o = 14; |
| 50 | optional ImportedMessage z = 16; |
| 51 | /// doc comment for r. |
| 52 | oneof r { |
| 53 | /// doc comment for s. |
| 54 | ImportedMessage s = 17; |
| 55 | /// doc comment for t on 2 |
| 56 | /// lines. |
| 57 | OtherMessage t = 18; |
| 58 | } |
| 59 | } |