Re: highlight.js & DCL

Liste des GroupesRevenir à co vms 
Sujet : Re: highlight.js & DCL
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vms
Date : 13. Oct 2024, 02:28:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vef7oh$caat$1@dont-email.me>
User-Agent : Mozilla Thunderbird
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
     ]
   };
}

Date Sujet#  Auteur
13 Oct 24 * Re: highlight.js & DCL5Arne Vajhøj
13 Oct 24 `* Re: highlight.js & DCL4Craig A. Berry
13 Oct 24  +- Re: highlight.js & DCL1Arne Vajhøj
13 Oct 24  `* Re: highlight.js & DCL2Lawrence D'Oliveiro
14 Oct 24   `- Re: highlight.js & DCL1Arne Vajhøj

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal