tcl.js 2.3 KB

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