navid/veinsforge / d76a04b1357dd5c4f3c75196b621f8c22fee437ba918158e3542362b4dfc163a / internal/web/static/hljs-langs.js
hljs-langs.js
← internal/web/static · 6433 bytes · raw · download
// Extra highlight.js grammars for languages that are not in the bundled
// highlight.js build, plus veinsforge's own language family.
(function (hljs) {
"use strict";
if (!hljs || typeof hljs.registerLanguage !== "function") return;
hljs.registerLanguage("spectre", function () {
return {
name: "Spectre",
aliases: ["spectre", "sx"],
keywords: {
keyword:
"fn spec val mut pub type pre post return if else elif trust inline use ref for in some none ok err match defer break continue as assert when union enum extern link lib guarded not test guard invariant is or otherwise",
literal: "true false",
type: "i8 i16 i32 i64 u8 u16 u32 u64 usize isize f32 f64 bool void self argspack option result list",
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{ className: "built_in", begin: /@[A-Za-z_]\w*/ },
{ className: "title.function", begin: /[A-Za-z_]\w*(?=\s*\()/, relevance: 0 },
],
};
});
hljs.registerLanguage("scar", function () {
return {
name: "Scar",
aliases: ["scar"],
keywords: {
keyword:
"def type interface union enum val var mut pub export extern import use return if else elif for in while loop match when guard test assert break continue defer as and or not ref self end module",
literal: "true false none",
type: "i8 i16 i32 i64 u8 u16 u32 u64 usize isize f32 f64 bool void",
},
contains: [
hljs.HASH_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{ className: "built_in", begin: /@[A-Za-z_]\w*/ },
{ className: "symbol", begin: /::/ },
{ className: "title.function", begin: /[A-Za-z_]\w*(?=\s*\()/, relevance: 0 },
],
};
});
hljs.registerLanguage("blood", function () {
return {
name: "Blood",
aliases: ["blood", "bx"],
keywords: {
keyword:
"fn let val var mut type struct enum union trait impl effect handler handle with match case of if else for while loop return break continue use import export pub const static where do in module data class interface derive new try catch throw yield async await",
literal: "true false none",
type: "i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 usize isize f32 f64 bool char string unit never",
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{ className: "meta", begin: /#!?\[[^\]]*\]/ },
{ className: "built_in", begin: /@[A-Za-z_]\w*/ },
{ className: "title.function", begin: /[A-Za-z_]\w*(?=\s*[(<])/, relevance: 0 },
],
};
});
hljs.registerLanguage("solidity", function () {
var types =
"address bool string bytes byte int uint int8 int16 int24 int32 int40 int48 int56 int64 int72 int80 int88 int96 int104 int112 int120 int128 int136 int144 int152 int160 int168 int176 int184 int192 int200 int208 int216 int224 int232 int240 int248 int256 uint8 uint16 uint24 uint32 uint40 uint48 uint56 uint64 uint72 uint80 uint88 uint96 uint104 uint112 uint120 uint128 uint136 uint144 uint152 uint160 uint168 uint176 uint184 uint192 uint200 uint208 uint216 uint224 uint232 uint240 uint248 uint256 bytes1 bytes2 bytes3 bytes4 bytes8 bytes16 bytes32 fixed ufixed";
return {
name: "Solidity",
aliases: ["sol"],
keywords: {
keyword:
"pragma import as from contract interface library abstract is using function modifier event error struct enum mapping constructor receive fallback public private internal external pure view payable nonpayable virtual override returns return if else for while do break continue emit new delete try catch assembly unchecked immutable constant memory storage calldata indexed anonymous",
literal: "true false",
type: types,
built_in:
"msg block tx abi require assert revert keccak256 sha256 ecrecover addmod mulmod selfdestruct type this super",
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: "string",
begin: /["']/,
end: /["']/,
illegal: /\n/,
},
hljs.C_NUMBER_MODE,
{
className: "meta",
begin: /pragma\s+solidity[^;]*;/,
},
{
className: "title.function",
begin: /\b(function|modifier|event|error|contract|interface|library|struct|enum)\s+/,
end: /[({;]/,
excludeBegin: true,
excludeEnd: true,
relevance: 0,
},
],
};
});
hljs.registerLanguage("zig", function () {
return {
name: "Zig",
aliases: ["zig"],
keywords: {
keyword:
"pub fn const var return if else while for switch break continue defer errdefer try catch unreachable async await suspend resume nosuspend export extern packed struct enum union opaque error test comptime inline noinline usingnamespace asm volatile linksection align allowzero orelse and or",
literal: "true false null undefined",
type: "i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 usize isize f16 f32 f64 f80 f128 bool void noreturn anytype type comptime_int comptime_float c_int c_uint c_long c_ulong",
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{ className: "built_in", begin: /@[A-Za-z_]\w*/ },
{ className: "title.function", begin: /[A-Za-z_]\w*(?=\s*\()/, relevance: 0 },
],
};
});
hljs.registerLanguage("hcl", function () {
return {
name: "HCL",
aliases: ["hcl", "terraform"],
keywords: {
keyword:
"resource data variable output module provider terraform locals dynamic for_each count depends_on lifecycle provisioner connection backend required_providers expression",
literal: "true false null",
},
contains: [
hljs.HASH_COMMENT_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{ className: "attr", begin: /[A-Za-z_]\w*(?=\s*=)/, relevance: 0 },
{ className: "title", begin: /[A-Za-z_]\w*(?=\s*\{)/, relevance: 0 },
],
};
});
})(window.hljs);