• Re: highlight.js & DCL

    From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Sat Oct 12 21:28:50 2024
    On 1/18/2022 7:56 PM, Arne Vajhøj wrote:
    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
    ]
    };
    }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to All on Sun Oct 13 07:24:42 2024
    On 10/12/24 8:28 PM, Arne Vajhøj wrote:
    On 1/18/2022 7:56 PM, Arne Vajhøj wrote:
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Craig A. Berry on Sun Oct 13 14:44:20 2024
    On 10/13/2024 8:24 AM, Craig A. Berry wrote:
    On 10/12/24 8:28 PM, Arne Vajhøj wrote:
    On 1/18/2022 7:56 PM, Arne Vajhøj wrote:
    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

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Craig A. Berry on Sun Oct 13 20:36:54 2024
    On Sun, 13 Oct 2024 07:24:42 -0500, Craig A. Berry wrote:

    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 ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sun Oct 13 20:19:13 2024
    On 10/13/2024 4:36 PM, Lawrence D'Oliveiro wrote:
    On Sun, 13 Oct 2024 07:24:42 -0500, Craig A. Berry wrote:
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)