mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Add Protocol Buffers
This commit is contained in:
@@ -1098,6 +1098,14 @@ Prolog:
|
|||||||
extensions:
|
extensions:
|
||||||
- .pro
|
- .pro
|
||||||
|
|
||||||
|
Protocol Buffer:
|
||||||
|
type: markup
|
||||||
|
ace_mode: protobuf
|
||||||
|
aliases:
|
||||||
|
- protobuf
|
||||||
|
- Protocol Buffers
|
||||||
|
primary_extension: .proto
|
||||||
|
|
||||||
Puppet:
|
Puppet:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#cc5555"
|
color: "#cc5555"
|
||||||
|
|||||||
27
samples/Protocol Buffer/addressbook.proto
Normal file
27
samples/Protocol Buffer/addressbook.proto
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package tutorial;
|
||||||
|
|
||||||
|
option java_package = "com.example.tutorial";
|
||||||
|
option java_outer_classname = "AddressBookProtos";
|
||||||
|
|
||||||
|
message Person {
|
||||||
|
required string name = 1;
|
||||||
|
required int32 id = 2;
|
||||||
|
optional string email = 3;
|
||||||
|
|
||||||
|
enum PhoneType {
|
||||||
|
MOBILE = 0;
|
||||||
|
HOME = 1;
|
||||||
|
WORK = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PhoneNumber {
|
||||||
|
required string number = 1;
|
||||||
|
optional PhoneType type = 2 [default = HOME];
|
||||||
|
}
|
||||||
|
|
||||||
|
repeated PhoneNumber phone = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AddressBook {
|
||||||
|
repeated Person person = 1;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user