l0bsterssg

node.js static responsive blog post generator
Log | Files | Refs | README

tcl.js (2437B)


      1 /*
      2 Language: Tcl
      3 Description: Tcl is a very simple programming language.
      4 Author: Radek Liska <radekliska@gmail.com>
      5 Website: https://www.tcl.tk/about/language.html
      6 */
      7 
      8 function tcl(hljs) {
      9   return {
     10     name: 'Tcl',
     11     aliases: ['tk'],
     12     keywords: 'after append apply array auto_execok auto_import auto_load auto_mkindex ' +
     13       'auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock ' +
     14       'close concat continue dde dict encoding eof error eval exec exit expr fblocked ' +
     15       'fconfigure fcopy file fileevent filename flush for foreach format gets glob global ' +
     16       'history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list ' +
     17       'llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 '+
     18       'mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex '+
     19       'platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename '+
     20       'return safe scan seek set socket source split string subst switch tcl_endOfWord '+
     21       'tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter '+
     22       'tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update '+
     23       'uplevel upvar variable vwait while',
     24     contains: [
     25       hljs.COMMENT(';[ \\t]*#', '$'),
     26       hljs.COMMENT('^[ \\t]*#', '$'),
     27       {
     28         beginKeywords: 'proc',
     29         end: '[\\{]',
     30         excludeEnd: true,
     31         contains: [
     32           {
     33             className: 'title',
     34             begin: '[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*',
     35             end: '[ \\t\\n\\r]',
     36             endsWithParent: true,
     37             excludeEnd: true
     38           }
     39         ]
     40       },
     41       {
     42         excludeEnd: true,
     43         variants: [
     44           {
     45             begin: '\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*\\(([a-zA-Z0-9_])*\\)',
     46             end: '[^a-zA-Z0-9_\\}\\$]'
     47           },
     48           {
     49             begin: '\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*',
     50             end: '(\\))?[^a-zA-Z0-9_\\}\\$]'
     51           }
     52         ]
     53       },
     54       {
     55         className: 'string',
     56         contains: [hljs.BACKSLASH_ESCAPE],
     57         variants: [
     58           hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null})
     59         ]
     60       },
     61       {
     62         className: 'number',
     63         variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]
     64       }
     65     ]
     66   }
     67 }
     68 
     69 module.exports = tcl;