main
Last change
on this file since e48199a was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | /*
|
---|
2 | Language: Protocol Buffers
|
---|
3 | Author: Dan Tao <daniel.tao@gmail.com>
|
---|
4 | Description: Protocol buffer message definition format
|
---|
5 | Website: https://developers.google.com/protocol-buffers/docs/proto3
|
---|
6 | Category: protocols
|
---|
7 | */
|
---|
8 |
|
---|
9 | function protobuf(hljs) {
|
---|
10 | return {
|
---|
11 | name: 'Protocol Buffers',
|
---|
12 | keywords: {
|
---|
13 | keyword: 'package import option optional required repeated group oneof',
|
---|
14 | built_in: 'double float int32 int64 uint32 uint64 sint32 sint64 ' +
|
---|
15 | 'fixed32 fixed64 sfixed32 sfixed64 bool string bytes',
|
---|
16 | literal: 'true false'
|
---|
17 | },
|
---|
18 | contains: [
|
---|
19 | hljs.QUOTE_STRING_MODE,
|
---|
20 | hljs.NUMBER_MODE,
|
---|
21 | hljs.C_LINE_COMMENT_MODE,
|
---|
22 | hljs.C_BLOCK_COMMENT_MODE,
|
---|
23 | {
|
---|
24 | className: 'class',
|
---|
25 | beginKeywords: 'message enum service', end: /\{/,
|
---|
26 | illegal: /\n/,
|
---|
27 | contains: [
|
---|
28 | hljs.inherit(hljs.TITLE_MODE, {
|
---|
29 | starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title
|
---|
30 | })
|
---|
31 | ]
|
---|
32 | },
|
---|
33 | {
|
---|
34 | className: 'function',
|
---|
35 | beginKeywords: 'rpc',
|
---|
36 | end: /[{;]/, excludeEnd: true,
|
---|
37 | keywords: 'rpc returns'
|
---|
38 | },
|
---|
39 | { // match enum items (relevance)
|
---|
40 | // BLAH = ...;
|
---|
41 | begin: /^\s*[A-Z_]+(?=\s*=[^\n]+;$)/
|
---|
42 | }
|
---|
43 | ]
|
---|
44 | };
|
---|
45 | }
|
---|
46 |
|
---|
47 | module.exports = protobuf;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.