basant307/AI_Governance_Project
048
1/*2Language: Thrift3Author: Oleg Efimov <efimovov@gmail.com>4Description: Thrift message definition format5Website: https://thrift.apache.org6Category: protocols7*/8 9function thrift(hljs) {10 const TYPES = [11 "bool",12 "byte",13 "i16",14 "i32",15 "i64",16 "double",17 "string",18 "binary"19 ];20 const KEYWORDS = [21 "namespace",22 "const",23 "typedef",24 "struct",25 "enum",26 "service",27 "exception",28 "void",29 "oneway",30 "set",31 "list",32 "map",33 "required",34 "optional"35 ];36 return {37 name: 'Thrift',38 keywords: {39 keyword: KEYWORDS,40 type: TYPES,41 literal: 'true false'42 },43 contains: [44 hljs.QUOTE_STRING_MODE,45 hljs.NUMBER_MODE,46 hljs.C_LINE_COMMENT_MODE,47 hljs.C_BLOCK_COMMENT_MODE,48 {49 className: 'class',50 beginKeywords: 'struct enum service exception',51 end: /\{/,52 illegal: /\n/,53 contains: [54 hljs.inherit(hljs.TITLE_MODE, {55 // hack: eating everything after the first title56 starts: {57 endsWithParent: true,58 excludeEnd: true59 } })60 ]61 },62 {63 begin: '\\b(set|list|map)\\s*<',64 keywords: { type: [65 ...TYPES,66 "set",67 "list",68 "map"69 ] },70 end: '>',71 contains: [ 'self' ]72 }73 ]74 };75}76 77export { thrift as default };78 