Skip to content

Commit 296a217

Browse files
committed
[WIP] test of Lua-syntax protobuf schema file.
1 parent 4a259ff commit 296a217

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

test/addressbook.proto.lua

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-- See README.txt for information and build instructions.
2+
3+
package "tutorial";
4+
5+
option {
6+
java_package = "com.example.tutorial";
7+
java_outer_classname = "AddressBookProtos";
8+
}
9+
10+
message "Person" {
11+
required "name" :string(1);
12+
required "id" :int32(2); -- Unique ID number for this person.
13+
optional "email" :string(3);
14+
15+
enum "PhoneType" {
16+
MOBILE = 0;
17+
HOME = 1;
18+
WORK = 2;
19+
};
20+
21+
message "PhoneNumber" {
22+
required "number" :string(1);
23+
optional "type" :PhoneType(2) {default = "HOME"};
24+
};
25+
26+
repeated "phone" :PhoneNumber(4);
27+
repeated "test" :int32(5) {packed=true};
28+
29+
extensions (10, "max");
30+
}
31+
32+
message "Ext" {
33+
extend "Person" {
34+
optional "test" :int32(10);
35+
}
36+
}
37+
38+
-- Our address book file is just one of these.
39+
message "AddressBook" {
40+
repeated "person" :Person(1);
41+
}
42+

0 commit comments

Comments
 (0)