1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
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}
|
30 | })
|
31 | ]
|
32 | },
|
33 | {
|
34 | className: 'function',
|
35 | beginKeywords: 'rpc',
|
36 | end: /[{;]/, excludeEnd: true,
|
37 | keywords: 'rpc returns'
|
38 | },
|
39 | {
|
40 |
|
41 | begin: /^\s*[A-Z_]+(?=\s*=[^\n]+;$)/
|
42 | }
|
43 | ]
|
44 | };
|
45 | }
|
46 |
|
47 | export { protobuf as default };
|