Initial commit.

Signed-off-by: Andreas Widen <aw@luflow.net>
This commit is contained in:
Andreas Widen 2026-07-27 17:57:03 +02:00
commit a4a5c7daa5
Signed by: hfsoulz
GPG key ID: 5B85F9B5F576A667
1389 changed files with 241399 additions and 0 deletions

View file

@ -0,0 +1,85 @@
/*! `thrift` grammar compiled for Highlight.js 11.11.1 */
var hljsGrammar = (function () {
'use strict';
/*
Language: Thrift
Author: Oleg Efimov <efimovov@gmail.com>
Description: Thrift message definition format
Website: https://thrift.apache.org
Category: protocols
*/
function thrift(hljs) {
const TYPES = [
"bool",
"byte",
"i16",
"i32",
"i64",
"double",
"string",
"binary"
];
const KEYWORDS = [
"namespace",
"const",
"typedef",
"struct",
"enum",
"service",
"exception",
"void",
"oneway",
"set",
"list",
"map",
"required",
"optional"
];
return {
name: 'Thrift',
keywords: {
keyword: KEYWORDS,
type: TYPES,
literal: 'true false'
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'class',
beginKeywords: 'struct enum service exception',
end: /\{/,
illegal: /\n/,
contains: [
hljs.inherit(hljs.TITLE_MODE, {
// hack: eating everything after the first title
starts: {
endsWithParent: true,
excludeEnd: true
} })
]
},
{
begin: '\\b(set|list|map)\\s*<',
keywords: { type: [
...TYPES,
"set",
"list",
"map"
] },
end: '>',
contains: [ 'self' ]
}
]
};
}
return thrift;
})();
;
export default hljsGrammar;