From 281e7456d567681f41e9ee234779036da4f4b0b9 Mon Sep 17 00:00:00 2001 From: Hanfei Shen Date: Fri, 22 Feb 2013 15:19:13 +0800 Subject: [PATCH] Add Protocol Buffers --- lib/linguist/languages.yml | 8 +++++++ samples/Protocol Buffer/addressbook.proto | 27 +++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 samples/Protocol Buffer/addressbook.proto diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 6c5cde1f..22e6a3cc 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1098,6 +1098,14 @@ Prolog: extensions: - .pro +Protocol Buffer: + type: markup + ace_mode: protobuf + aliases: + - protobuf + - Protocol Buffers + primary_extension: .proto + Puppet: type: programming color: "#cc5555" diff --git a/samples/Protocol Buffer/addressbook.proto b/samples/Protocol Buffer/addressbook.proto new file mode 100644 index 00000000..2dee2965 --- /dev/null +++ b/samples/Protocol Buffer/addressbook.proto @@ -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; +}