Discussion:
highlight.js & DCL
(too old to reply)
Arne Vajhøj
2024-10-13 01:28:50 UTC
Permalink
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.

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
]
};
}
Craig A. Berry
2024-10-13 12:24:42 UTC
Permalink
Post by Arne Vajhøj
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.
Not so difficult.
First attempt attached below.
In case it's of interest to compare with what others have done, there is
a VSCODE extension that already does this:

https://github.com/tomesparon/OpenVMS-DCL-VSCODE-Lang-Support

which is in turn based on:

https://github.com/gnikonorov/OpenVMS-DCL-Sublime-Lang-Support
Arne Vajhøj
2024-10-13 18:44:20 UTC
Permalink
Post by Craig A. Berry
Post by Arne Vajhøj
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.
Not so difficult.
First attempt attached below.
In case it's of interest to compare with what others have done, there is
https://github.com/tomesparon/OpenVMS-DCL-VSCODE-Lang-Support
https://github.com/gnikonorov/OpenVMS-DCL-Sublime-Lang-Support
I think those are way more advanced.

highlight.js is just for color coding of <code></code> blocks
in HTML.

And for what I posted it just ends up with:
comments - green
strings - red
known words - blue
everything else - black

Arne
Lawrence D'Oliveiro
2024-10-13 20:36:54 UTC
Permalink
Post by Craig A. Berry
In case it's of interest to compare with what others have done, there is
a VSCODE extension that already does this ...
Ah, VSCODE. Who would believe that a simple programming IDE would need to
include an entire web browser engine embedded in it ...
Arne Vajhøj
2024-10-14 00:19:13 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Craig A. Berry
In case it's of interest to compare with what others have done, there is
a VSCODE extension that already does this ...
Ah, VSCODE. Who would believe that a simple programming IDE would need to
include an entire web browser engine embedded in it ...
Well - VS Code is actually a lightweight IDE (or a powerful
text editor depending on how one categorize).

The real VS and Eclipse are way heavier. Eclipse does not embed
a browser, but it uses OSGI to manage plugins, which is very heavy.

Arne

Loading...