File: test.proto

package info (click to toggle)
golang-github-google-flatbuffers 24.3.25-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 17,356 kB
  • sloc: cpp: 49,726; python: 6,901; cs: 5,566; java: 4,370; ansic: 2,512; php: 1,460; javascript: 1,053; xml: 1,016; sh: 870; makefile: 13
file content (78 lines) | stat: -rw-r--r-- 1,907 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Sample .proto file that we can translate to the corresponding .fbs.

option some_option = is_ignored;
import "imported.proto";

package proto.test;

/// Enum doc comment.
enum ProtoEnum {
  option allow_alias = true;
  NUL = 0;
  FOO = 1;
  /// Enum 2nd value doc comment misaligned.
  BAR = 5;
  // Aliases
  FOO_A1 = 1;
  BAR_A1 = 5;
  FOO_A2 = 1;
}

/// 2nd table doc comment with
/// many lines.
message ProtoMessage {
  // Ignored non-doc comment.
  // A nested message declaration, will be moved to top level in .fbs
  message OtherMessage {
    reserved 2, 9 to 11, 15;
    optional double a = 26;
    /// doc comment for b.
    optional float b = 32 [default = 3.14149];

    // Nested enum that aliases the outer one.
    enum ProtoEnum {
      NUL = 0;
      FOO = 1;
      BAR = 2;
      BAZ = 3;
    }

    optional ProtoEnum foo_bar_baz = 33;
  }
  optional int32 c = 12 [default = 16];
  optional int64 d = 1 [default = 0];
  optional uint32 p = 40;
  optional uint64 e = 2;
  /// doc comment for f.
  optional sint32 f = 3 [default = -1];
  optional sint64 g = 4;
  optional fixed32 h = 5;
  optional fixed64 q = 6;
  optional sfixed32 i = 7;
  optional sfixed64 j = 8;
  /// doc comment for k.
  optional bool k = 9;
  /// doc comment for l on 2
  /// lines
  required string l = 10;
  optional bytes m = 11;
  optional OtherMessage n = 41;
  repeated string o = 14;
  optional ImportedMessage z = 16;
  /// doc comment for r.
  oneof r {
    /// doc comment for s.
    ImportedMessage s = 17;
    /// doc comment for t on 2
    /// lines.
    OtherMessage t = 18;
  }
  optional ProtoEnum outer_enum = 33;
  // Tests that `inf` and `+/-inf` can be parsed in proto options.
  optional float u = 34 [default = inf];
  optional float v = 35 [default = +inf];
  optional float w = 36 [default = -inf];

  map<string, float> grades = 37;
  map<string, OtherMessage> other_message_map = 38;
}