Arne Vajhøj
2024-10-13 01:28:50 UTC
Long shot, but has anyone added DCL support to highlight.js?
https://highlightjs.org/
(it hash all kinds of programming languages, bash, cmd
etc. but no DCL)
I finally got to take a look at it.https://highlightjs.org/
(it hash all kinds of programming languages, bash, cmd
etc. but no DCL)
Not so difficult.
First attempt attached below.
Arne
export default function(hljs) {
const COMMENT = hljs.COMMENT(
'!',
'$',
{ relevance: 10 }
);
const KEYWORDS = [
"if",
"then",
"else",
"endif",
"goto",
"open",
"read",
"write",
"close",
"call",
"subroutine",
"return",
"endsubroutine",
"def",
"define",
"assign",
"deassign",
"set",
"show",
"on",
"wait",
"exit"
];
const BUILT_INS = [
"copy",
"type",
"append",
"del",
"delete",
"pur",
"purge",
"ren",
"rename",
"dir",
"directory",
"cre",
"create",
"conv",
"convert",
"pipe",
"edit",
"link",
"run",
"for",
"fortran",
"pas",
"pascal",
"cc",
"cxx",
"bas",
"basic",
"cob",
"cobol",
"macro",
"bliss",
"java",
"javax",
"groovy",
"groovyc",
"kotlin",
"kotlinc",
"scala",
"scalac",
"python",
"php",
"sear",
"search",
"diff",
"difference",
"sort",
"backup",
"allocate",
"deallocate",
"mount",
"dismount",
"submit",
"print",
"logout"
];
return {
name: 'DCL (VMS)',
aliases: [
'dcl',
'com'
],
case_insensitive: true,
keywords: {
$pattern: /\b[a-z]+\b/,
keyword: KEYWORDS,
built_in: BUILT_INS
},
contains: [
hljs.QUOTE_STRING_MODE,
COMMENT
]
};
}