source: node_modules/highlight.js/lib/languages/thrift.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2Language: Thrift
3Author: Oleg Efimov <efimovov@gmail.com>
4Description: Thrift message definition format
5Website: https://thrift.apache.org
6Category: protocols
7*/
8
9function thrift(hljs) {
10 const BUILT_IN_TYPES = 'bool byte i16 i32 i64 double string binary';
11 return {
12 name: 'Thrift',
13 keywords: {
14 keyword:
15 'namespace const typedef struct enum service exception void oneway set list map required optional',
16 built_in:
17 BUILT_IN_TYPES,
18 literal:
19 'true false'
20 },
21 contains: [
22 hljs.QUOTE_STRING_MODE,
23 hljs.NUMBER_MODE,
24 hljs.C_LINE_COMMENT_MODE,
25 hljs.C_BLOCK_COMMENT_MODE,
26 {
27 className: 'class',
28 beginKeywords: 'struct enum service exception',
29 end: /\{/,
30 illegal: /\n/,
31 contains: [
32 hljs.inherit(hljs.TITLE_MODE, {
33 // hack: eating everything after the first title
34 starts: {
35 endsWithParent: true,
36 excludeEnd: true
37 }
38 })
39 ]
40 },
41 {
42 begin: '\\b(set|list|map)\\s*<',
43 end: '>',
44 keywords: BUILT_IN_TYPES,
45 contains: [ 'self' ]
46 }
47 ]
48 };
49}
50
51module.exports = thrift;
Note: See TracBrowser for help on using the repository browser.