2021-04-05 17:06:54 +03:00
## Syntax highlighting for Tcl and Expect scripts.
2014-02-23 20:07:44 +04:00
2021-04-05 17:06:54 +03:00
syntax tcl "\.(tcl|exp)$"
2017-11-19 13:10:53 +03:00
magic "Tcl(/Tk)? script"
2016-05-25 23:13:50 +03:00
comment "#"
2008-03-20 07:45:55 +03:00
2014-02-23 20:07:44 +04:00
# Standard Tcl [info commands]:
2022-12-11 14:40:22 +03:00
color green "\<(after|append|array|auto_(execok|import|load(_index)?|qualify)|binary|break)\>"
color green "\<(case|catch|cd|clock|close|concat|continue|encoding|eof|error|eval|exec|exit|expr)\>"
color green "\<(fblocked|fconfigure|fcopy|file(event)?|flush|for|foreach|format|gets|glob|global|history)\>"
color green "\<(if|incr|info|interp|join|lappend|lindex|linsert|list|llength|load|lrange|lreplace|lsearch|lset|lsort)\>"
color green "\<(namespace|open|package|pid|puts|pwd|read|regexp|regsub|rename|return)\>"
color green "\<(scan|seek|set|socket|source|split|string|subst|switch|tclLog|tell|time|trace)\>"
color green "\<(unknown|unset|update|uplevel|upvar|variable|vwait|while)\>"
2021-04-05 17:06:54 +03:00
2014-02-23 20:07:44 +04:00
# Basic Tcl subcommands:
2018-12-17 18:00:54 +03:00
color green "\<array (anymore|donesearch|exists|get|names|nextelement|set|size|startsearch|statistics|unset)\>"
2022-12-11 14:40:22 +03:00
color green "\<string (compare|equal|first|index|is|last|(byte)?length|map|match|range|repeat|replace|to(lower|title|upper)?|trim(left|right)?|will|word(end|start))\>"
2021-04-05 17:06:54 +03:00
2014-02-23 20:07:44 +04:00
# Extended TclX [info commands]:
2022-12-11 14:40:22 +03:00
color green "\<(alarm|auto_load_pkg|bsearch|cat(close|gets|open)|ccollate|cconcat|cequal|chgrp|chmod|chown|chroot)\>"
color green "\<(cindex|clength|cmdtrace|commandloop|crange|csubstr|ctoken|ctype|dup|echo|execl)\>"
color green "\<(fcntl|flock|fork|fstat|ftruncate|funlock|host_info|id|infox|keyl(del|get|keys|set)|kill)\>"
color green "\<(lassign|lcontain|lempty|lgets|link|lmatch|loadlibindex|loop|lvar(cat|pop|push)|max|min|nice)\>"
color green "\<(pipe|profile|random|readdir|replicate|scan(context|file|match)|select|server_(accept|create)|signal)\>"
color green "\<(sleep|sync|system|tclx_(findinit|fork|load_tndxs|sleep|system|wait)|times|translit|try_eval|umask|wait)\>"
2021-04-05 17:06:54 +03:00
2014-02-23 20:07:44 +04:00
# Syntax:
2022-12-11 14:40:22 +03:00
color green "[!$&();<=>\`|]"
2021-04-27 12:18:41 +03:00
color brightblue "\<proc[[:blank:]]|\{|\}"
2021-10-27 10:45:42 +03:00
color brightyellow ""([^"\]|\\.)*"|'([^'\]|\\.)*'"
2018-12-17 18:00:54 +03:00
color brightred "\$\{?[0-9A-Za-z_!@#$*?-]+\}?"
2021-04-05 17:06:54 +03:00
2018-12-17 18:00:54 +03:00
# Trailing whitespace:
2008-03-20 07:45:55 +03:00
color ,green "[[:space:]]+$"
2021-04-05 17:06:54 +03:00
2018-12-17 17:23:32 +03:00
# Comments:
2021-04-27 12:18:41 +03:00
color cyan "^[[:blank:]]*#.*"