highlightjs-zenscript
Version:
highlight.js syntax definition for ZenScript
131 lines (129 loc) • 3.3 kB
JavaScript
/*
Language: ZenScript
Author: Jared Luboff <jluboff8@gmail.com>
Description: ZenScript language support
Category: scripting
*/
module.exports = function (hljs) {
return {
aliases: ["zenscript", "zs"],
keywords: {
keyword: [
"import",
"alias",
"class",
"function",
"interface",
"enum",
"struct",
"expand",
"variant",
"abstract",
"final",
"override",
"const",
"private",
"public",
"export",
"internal",
"static",
"protected",
"implicit",
"virtual",
"extern",
"immutable",
"val",
"var",
"get",
"implements",
"set",
"void",
"bool",
"byte",
"sbyte",
"short",
"ushort",
"int",
"uint",
"long",
"ulong",
"usize",
"float",
"double",
"char",
"string",
"if",
"else",
"do",
"while",
"for",
"throw",
"panic",
"lock",
"try",
"catch",
"finally",
"return",
"break",
"continue",
"switch",
"case",
"default",
"in",
"is",
"as",
"match",
"throws",
"super",
"this",
"null",
"true",
"false",
"new",
],
title: "< >",
},
contains: [
{
className: "keyword",
begin: "<",
contains: [
{
className: "literal",
begin: "\\w+",
end: ":|>",
excludeEnd: true,
endsWithParent: true,
},
],
},
{
className: "section",
begin: "\\w+\\.",
},
{
className: "section",
begin: "\\s\\w+\\.",
},
{
className: "keyword",
begin: ";",
},
{
className: "title",
begin: "\\(|\\)|\\{|\\}|\\[|\\]",
},
{
className: "variable",
begin: "as\\s",
end: "\\w+",
excludeBegin: true,
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_NUMBER_MODE,
hljs.QUOTE_STRING_MODE,
hljs.HASH_COMMENT_MODE,
],
};
};