Skip to content

Commit c1167bd

Browse files
m00tpointdavidhcefx
authored andcommitted
Add syntax highlighting for Expect scripts. File is a copy of tcl.nanorc
with Expect commands added (Expect is a TCL extension). Originally proposed in scopatz#367
1 parent 6ca4ffa commit c1167bd

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

expect.nanorc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
syntax "EXPECT" "\.exp$"
2+
header "^#!.*/(env +)?expect( |$)"
3+
4+
magic "Tcl(/Tk)? script"
5+
comment "#"
6+
7+
## Standard Expect [info commands]
8+
color cyan "\<(close|debug|disconnect|exit|exp_continue|exp_internal|exp_open|exp_pid|exp_send|exp_send_error|exp_send_log|exp_send_tty|exp_send_user|exp_version|expect|expect_after|expect_background|expect_before|expect_tty|expect_user|fork|interact|interpreter|log_file|log_user|match_max|overlay|parity|remove_nulls|send|send_error|send_log|send_tty|send_user|sleep|spawn|strace|stty|system|timestamp|trap|wait)\>"
9+
## Standard Tcl [info commands]
10+
color cyan "\<(after|append|array|auto_execok|auto_import|auto_load|auto_load_index|auto_qualify|binary|break|case|catch|cd|clock|close|concat|continue|else|encoding|eof|error|eval|exec|exit|expr|fblocked|fconfigure|fcopy|file|fileevent|flush|for|foreach|format|gets|glob|global|history|if|incr|info|interp|join|lappend|lindex|linsert|list|llength|load|lrange|lreplace|lsearch|lset|lsort|namespace|open|package|pid|puts|pwd|read|regexp|regsub|rename|return|scan|seek|set|socket|source|split|string|subst|switch|tclLog|tell|time|trace|unknown|unset|update|uplevel|upvar|variable|vwait|while)\>"
11+
## Basic Tcl sub commands
12+
color cyan "\<(array anymore|array donesearch|array exists|array get|array names|array nextelement|array set|array size|array startsearch|array statistics|array unset)\>"
13+
color cyan "\<(string bytelength|string compare|string equal|string first|string index|string is|string last|string length|string map|string match|string range|string repeat|string replace|string to|string tolower|string totitle|string toupper|string trim|string trimleft|string trimright|string will|string wordend|string wordstart)\>"
14+
## Extended TclX [info commands]
15+
color cyan "\<(alarm|auto_load_pkg|bsearch|catclose|catgets|catopen|ccollate|cconcat|cequal|chgrp|chmod|chown|chroot|cindex|clength|cmdtrace|commandloop|crange|csubstr|ctoken|ctype|dup|echo|execl|fcntl|flock|fork|fstat|ftruncate|funlock|host_info|id|infox|keyldel|keylget|keylkeys|keylset|kill|lassign|lcontain|lempty|lgets|link|lmatch|loadlibindex|loop|lvarcat|lvarpop|lvarpush|max|min|nice|pipe|profile|random|readdir|replicate|scancontext|scanfile|scanmatch|select|server_accept|server_create|signal|sleep|sync|system|tclx_findinit|tclx_fork|tclx_load_tndxs|tclx_sleep|tclx_system|tclx_wait|times|translit|try_eval|umask|wait)\>"
16+
## Function declaration
17+
color brightblue "proc[[:space:]]" "(\{|\})"
18+
## Syntax
19+
color green "(\(|\)|\;|`|\\|\$|<|>|!|=|&|\|)"
20+
## Numbers
21+
color brightyellow "\<[0-9]+(\.[0-9]+)?\>"
22+
## Strings
23+
color yellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
24+
## Variables
25+
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
26+
## Comments
27+
color magenta "(^|;)[[:space:]]*#.*"
28+
## Trailing whitespace
29+
color ,green "[[:space:]]+$"

0 commit comments

Comments
 (0)