1 | Prism.languages.tcl = {
|
2 | 'comment': {
|
3 | pattern: /(^|[^\\])#.*/,
|
4 | lookbehind: true
|
5 | },
|
6 | 'string': {
|
7 | pattern: /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,
|
8 | greedy: true
|
9 | },
|
10 | 'variable': [
|
11 | {
|
12 | pattern: /(\$)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/,
|
13 | lookbehind: true
|
14 | },
|
15 | {
|
16 | pattern: /(\$){[^}]+}/,
|
17 | lookbehind: true
|
18 | },
|
19 | {
|
20 | pattern: /(^\s*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/m,
|
21 | lookbehind: true
|
22 | }
|
23 | ],
|
24 | 'function': {
|
25 | pattern: /(^\s*proc[ \t]+)[^\s]+/m,
|
26 | lookbehind: true
|
27 | },
|
28 | 'builtin': [
|
29 | {
|
30 | pattern: /(^\s*)(?:proc|return|class|error|eval|exit|for|foreach|if|switch|while|break|continue)\b/m,
|
31 | lookbehind: true
|
32 | },
|
33 | /\b(?:elseif|else)\b/
|
34 | ],
|
35 | 'scope': {
|
36 | pattern: /(^\s*)(?:global|upvar|variable)\b/m,
|
37 | lookbehind: true,
|
38 | alias: 'constant'
|
39 | },
|
40 | 'keyword': {
|
41 | pattern: /(^\s*|\[)(?:after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|Safe_Base|scan|seek|set|socket|source|split|string|subst|Tcl|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|wordBreak(?:After|Before)|test|vars)|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait)\b/m,
|
42 | lookbehind: true
|
43 | },
|
44 | 'operator': /!=?|\*\*?|==|&&?|\|\|?|<[=<]?|>[=>]?|[-+~\/%?^]|\b(?:eq|ne|in|ni)\b/,
|
45 | 'punctuation': /[{}()\[\]]/
|
46 | };
|