Mercurial > vim
annotate runtime/syntax/tcl.vim @ 7064:5fc5c5bf2233 v7.4.844
commit https://github.com/vim/vim/commit/37a8de17d4dfd3d463960c38a204ce399c8e19d4
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 1 16:05:00 2015 +0200
patch 7.4.844
Problem: When '#' is in 'isident' the is# comparator doesn't work.
Solution: Don't use vim_isIDc(). (Yasuhiro Matsumoto)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 01 Sep 2015 16:15:04 +0200 |
parents | 80e5f9584b02 |
children | 43efa4f5a8ea |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2034 | 2 " Language: Tcl/Tk |
3 " Maintainer: Taylor Venable <taylor@metasyntax.net> | |
4 " (previously Brett Cannon <brett@python.org>) | |
1125 | 5 " (previously Dean Copsey <copsey@cs.ucdavis.edu>) |
7 | 6 " (previously Matt Neumann <mattneu@purpleturtle.com>) |
7 " (previously Allan Kelly <allan@fruitloaf.co.uk>) | |
8 " Original: Robin Becker <robin@jessikat.demon.co.uk> | |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
9 " Last Change: 2014-02-12 |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
10 " Version: 1.14 |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
11 " URL: http://bitbucket.org/taylor_venable/metasyntax/src/tip/Config/vim/syntax/tcl.vim |
7 | 12 |
13 " For version 5.x: Clear all syntax items | |
14 " For version 6.x: Quit when a syntax file was already loaded | |
15 if version < 600 | |
16 syntax clear | |
17 elseif exists("b:current_syntax") | |
18 finish | |
19 endif | |
20 | |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
21 " Basic Tcl commands: http://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
22 syn keyword tclCommand after append array bgerror binary cd chan clock close concat |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
23 syn keyword tclCommand dde dict encoding eof error eval exec exit expr fblocked |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
24 syn keyword tclCommand fconfigure fcopy file fileevent flush format gets glob |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
25 syn keyword tclCommand global history http incr info interp join lappend lassign |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
26 syn keyword tclCommand lindex linsert list llength lmap load lrange lrepeat |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
27 syn keyword tclCommand lreplace lreverse lsearch lset lsort memory my namespace |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
28 syn keyword tclCommand next nextto open package pid puts pwd read refchan regexp |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
29 syn keyword tclCommand registry regsub rename scan seek self set socket source |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
30 syn keyword tclCommand split string subst tell time trace unknown unload unset |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
31 syn keyword tclCommand update uplevel upvar variable vwait |
2034 | 32 |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
33 " The 'Tcl Standard Library' commands: http://www.tcl.tk/man/tcl8.6/TclCmd/library.htm |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
34 syn keyword tclCommand auto_execok auto_import auto_load auto_mkindex auto_reset |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
35 syn keyword tclCommand auto_qualify tcl_findLibrary parray tcl_endOfWord |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
36 syn keyword tclCommand tcl_startOfNextWord tcl_startOfPreviousWord |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
37 syn keyword tclCommand tcl_wordBreakAfter tcl_wordBreakBefore |
2034 | 38 |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
39 " Global variables used by Tcl: http://www.tcl.tk/man/tcl8.6/TclCmd/tclvars.htm |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
40 syn keyword tclVars auto_path env errorCode errorInfo tcl_library tcl_patchLevel |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
41 syn keyword tclVars tcl_pkgPath tcl_platform tcl_precision tcl_rcFileName |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
42 syn keyword tclVars tcl_traceCompile tcl_traceExec tcl_wordchars |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
43 syn keyword tclVars tcl_nonwordchars tcl_version argc argv argv0 tcl_interactive |
2034 | 44 |
45 " Strings which expr accepts as boolean values, aside from zero / non-zero. | |
46 syn keyword tclBoolean true false on off yes no | |
47 | |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
48 syn keyword tclProcCommand apply coroutine proc return tailcall yield yieldto |
7 | 49 syn keyword tclConditional if then else elseif switch |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
50 syn keyword tclConditional catch try throw finally |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
51 syn keyword tclLabel default |
7 | 52 syn keyword tclRepeat while for foreach break continue |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
53 |
7 | 54 syn keyword tcltkSwitch contained insert create polygon fill outline tag |
55 | |
56 " WIDGETS | |
57 " commands associated with widgets | |
58 syn keyword tcltkWidgetSwitch contained background highlightbackground insertontime cget | |
59 syn keyword tcltkWidgetSwitch contained selectborderwidth borderwidth highlightcolor insertwidth | |
60 syn keyword tcltkWidgetSwitch contained selectforeground cursor highlightthickness padx setgrid | |
61 syn keyword tcltkWidgetSwitch contained exportselection insertbackground pady takefocus | |
62 syn keyword tcltkWidgetSwitch contained font insertborderwidth relief xscrollcommand | |
63 syn keyword tcltkWidgetSwitch contained foreground insertofftime selectbackground yscrollcommand | |
64 syn keyword tcltkWidgetSwitch contained height spacing1 spacing2 spacing3 | |
65 syn keyword tcltkWidgetSwitch contained state tabs width wrap | |
66 " button | |
67 syn keyword tcltkWidgetSwitch contained command default | |
68 " canvas | |
69 syn keyword tcltkWidgetSwitch contained closeenough confine scrollregion xscrollincrement yscrollincrement orient | |
70 " checkbutton, radiobutton | |
71 syn keyword tcltkWidgetSwitch contained indicatoron offvalue onvalue selectcolor selectimage state variable | |
72 " entry, frame | |
73 syn keyword tcltkWidgetSwitch contained show class colormap container visual | |
74 " listbox, menu | |
75 syn keyword tcltkWidgetSwitch contained selectmode postcommand selectcolor tearoff tearoffcommand title type | |
76 " menubutton, message | |
77 syn keyword tcltkWidgetSwitch contained direction aspect justify | |
78 " scale | |
79 syn keyword tcltkWidgetSwitch contained bigincrement digits from length resolution showvalue sliderlength sliderrelief tickinterval to | |
80 " scrollbar | |
81 syn keyword tcltkWidgetSwitch contained activerelief elementborderwidth | |
82 " image | |
83 syn keyword tcltkWidgetSwitch contained delete names types create | |
84 " variable reference | |
85 " ::optional::namespaces | |
2034 | 86 syn match tclVarRef "$\(\(::\)\?\([[:alnum:]_]*::\)*\)\a[[:alnum:]_]*" |
7 | 87 " ${...} may contain any character except '}' |
88 syn match tclVarRef "${[^}]*}" | |
2034 | 89 |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
90 " Used to facilitate hack to utilize string background for certain color |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
91 " schemes, e.g. inkpot and lettuce. |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
92 syn cluster tclVarRefC add=tclVarRef |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
93 syn cluster tclSpecialC add=tclSpecial |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
94 |
2034 | 95 " The syntactic unquote-splicing replacement for [expand]. |
96 syn match tclExpand '\s{\*}' | |
97 syn match tclExpand '^{\*}' | |
98 | |
7 | 99 " menu, mane add |
100 syn keyword tcltkWidgetSwitch contained active end last none cascade checkbutton command radiobutton separator | |
101 syn keyword tcltkWidgetSwitch contained activebackground actveforeground accelerator background bitmap columnbreak | |
102 syn keyword tcltkWidgetSwitch contained font foreground hidemargin image indicatoron label menu offvalue onvalue | |
103 syn keyword tcltkWidgetSwitch contained selectcolor selectimage state underline value variable | |
104 syn keyword tcltkWidgetSwitch contained add clone configure delete entrycget entryconfigure index insert invoke | |
105 syn keyword tcltkWidgetSwitch contained post postcascade type unpost yposition activate | |
106 "syn keyword tcltkWidgetSwitch contained | |
107 "syn match tcltkWidgetSwitch contained | |
108 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<button\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
109 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<scale\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
110 | |
111 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<canvas\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
112 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<checkbutton\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
113 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<entry\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
114 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<frame\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
115 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<image\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
116 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<listbox\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
117 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<menubutton\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
118 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<message\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
119 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<radiobutton\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
120 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<scrollbar\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
121 " These words are dual purpose. | |
122 " match switches | |
123 "syn match tcltkWidgetSwitch contained "-text"hs=s+1 | |
124 syn match tcltkWidgetSwitch contained "-text\(var\)\?"hs=s+1 | |
125 syn match tcltkWidgetSwitch contained "-menu"hs=s+1 | |
126 syn match tcltkWidgetSwitch contained "-label"hs=s+1 | |
127 " match commands - 2 lines for pretty match. | |
128 "variable | |
129 " Special case - If a number follows a variable region, it must be at the end of | |
130 " the pattern, by definition. Therefore, (1) either include a number as the region | |
131 " end and exclude tclNumber from the contains list, or (2) make variable | |
132 " keepend. As (1) would put variable out of step with everything else, use (2). | |
133 syn region tcltkCommand matchgroup=tcltkCommandColor start="^\<variable\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tclString,tclNumber,tclVarRef,tcltkCommand | |
134 syn region tcltkCommand matchgroup=tcltkCommandColor start="\s\<variable\>\|\[\<variable\>"hs=s+1 matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tclString,tclNumber,tclVarRef,tcltkCommand | |
135 " menu | |
136 syn region tcltkWidget matchgroup=tcltkWidgetColor start="^\<menu\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
137 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\<menu\>\|\[\<menu\>"hs=s+1 matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
138 " label | |
139 syn region tcltkWidget matchgroup=tcltkWidgetColor start="^\<label\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
140 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\<label\>\|\[\<label\>"hs=s+1 matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
141 " text | |
142 syn region tcltkWidget matchgroup=tcltkWidgetColor start="^\<text\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidget,tcltkWidgetSwitch,tcltkSwitch,tclNumber,tclVarRef,tclString | |
143 syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\<text\>\|\[\<text\>"hs=s+1 matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidget,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef | |
144 | |
145 " This isn't contained (I don't think) so it's OK to just associate with the Color group. | |
146 " TODO: This could be wrong. | |
147 syn keyword tcltkWidgetColor toplevel | |
148 | |
149 | |
150 syn region tcltkPackConf matchgroup=tcltkPackConfColor start="\<configure\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tcltkPackConfSwitch,tclNumber,tclVarRef keepend | |
151 syn region tcltkPackConf matchgroup=tcltkPackConfColor start="\<cget\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tcltkPackConfSwitch,tclNumber,tclVarRef | |
152 | |
153 | |
154 " NAMESPACE | |
155 " commands associated with namespace | |
156 syn keyword tcltkNamespaceSwitch contained children code current delete eval | |
157 syn keyword tcltkNamespaceSwitch contained export forget import inscope origin | |
158 syn keyword tcltkNamespaceSwitch contained parent qualifiers tail which command variable | |
159 syn region tcltkCommand matchgroup=tcltkCommandColor start="\<namespace\>" matchgroup=NONE skip="^\s*$" end="{\|}\|]\|\"\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkNamespaceSwitch | |
160 | |
161 " EXPR | |
162 " commands associated with expr | |
2034 | 163 syn keyword tcltkMaths contained abs acos asin atan atan2 bool ceil cos cosh double entier |
164 syn keyword tcltkMaths contained exp floor fmod hypot int isqrt log log10 max min pow rand | |
165 syn keyword tcltkMaths contained round sin sinh sqrt srand tan tanh wide | |
166 | |
7 | 167 syn region tcltkCommand matchgroup=tcltkCommandColor start="\<expr\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkMaths,tclNumber,tclVarRef,tclString,tcltlWidgetSwitch,tcltkCommand,tcltkPackConf |
168 | |
169 " format | |
170 syn region tcltkCommand matchgroup=tcltkCommandColor start="\<format\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkMaths,tclNumber,tclVarRef,tclString,tcltlWidgetSwitch,tcltkCommand,tcltkPackConf | |
171 | |
172 " PACK | |
173 " commands associated with pack | |
174 syn keyword tcltkPackSwitch contained forget info propogate slaves | |
175 syn keyword tcltkPackConfSwitch contained after anchor before expand fill in ipadx ipady padx pady side | |
176 syn region tcltkCommand matchgroup=tcltkCommandColor start="\<pack\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkPackSwitch,tcltkPackConf,tcltkPackConfSwitch,tclNumber,tclVarRef,tclString,tcltkCommand keepend | |
177 | |
178 " STRING | |
179 " commands associated with string | |
180 syn keyword tcltkStringSwitch contained compare first index last length match range tolower toupper trim trimleft trimright wordstart wordend | |
181 syn region tcltkCommand matchgroup=tcltkCommandColor start="\<string\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkStringSwitch,tclNumber,tclVarRef,tclString,tcltkCommand | |
182 | |
183 " ARRAY | |
184 " commands associated with array | |
185 syn keyword tcltkArraySwitch contained anymore donesearch exists get names nextelement size startsearch set | |
186 " match from command name to ] or EOL | |
187 syn region tcltkCommand matchgroup=tcltkCommandColor start="\<array\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkArraySwitch,tclNumber,tclVarRef,tclString,tcltkCommand | |
188 | |
189 " LSORT | |
190 " switches for lsort | |
191 syn keyword tcltkLsortSwitch contained ascii dictionary integer real command increasing decreasing index | |
192 " match from command name to ] or EOL | |
193 syn region tcltkCommand matchgroup=tcltkCommandColor start="\<lsort\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkLsortSwitch,tclNumber,tclVarRef,tclString,tcltkCommand | |
194 | |
195 syn keyword tclTodo contained TODO | |
196 | |
2034 | 197 " Sequences which are backslash-escaped: http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm#M16 |
198 " Octal, hexadecimal, unicode codepoints, and the classics. | |
199 " Tcl takes as many valid characters in a row as it can, so \xAZ in a string is newline followed by 'Z'. | |
200 syn match tclSpecial contained '\\\([0-7]\{1,3}\|x\x\{1,2}\|u\x\{1,4}\|[abfnrtv]\)' | |
201 syn match tclSpecial contained '\\[\[\]\{\}\"\$]' | |
7 | 202 |
2034 | 203 " Command appearing inside another command or inside a string. |
204 syn region tclEmbeddedStatement start='\[' end='\]' contained contains=tclCommand,tclNumber,tclLineContinue,tclString,tclVarRef,tclEmbeddedStatement | |
7 | 205 " A string needs the skip argument as it may legitimately contain \". |
206 " Match at start of line | |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
207 syn region tclString start=+^"+ end=+"+ contains=@tclSpecialC skip=+\\\\\|\\"+ |
7 | 208 "Match all other legal strings. |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
209 syn region tclString start=+[^\\]"+ms=s+1 end=+"+ contains=@tclSpecialC,@tclVarRefC,tclEmbeddedStatement skip=+\\\\\|\\"+ |
7 | 210 |
2034 | 211 " Line continuation is backslash immediately followed by newline. |
212 syn match tclLineContinue '\\$' | |
213 | |
214 if exists('g:tcl_warn_continuation') | |
215 syn match tclNotLineContinue '\\\s\+$' | |
216 endif | |
7 | 217 |
218 "integer number, or floating point number without a dot and with "f". | |
219 syn case ignore | |
220 syn match tclNumber "\<\d\+\(u\=l\=\|lu\|f\)\>" | |
221 "floating point number, with dot, optional exponent | |
222 syn match tclNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>" | |
223 "floating point number, starting with a dot, optional exponent | |
224 syn match tclNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" | |
225 "floating point number, without dot, with exponent | |
226 syn match tclNumber "\<\d\+e[-+]\=\d\+[fl]\=\>" | |
227 "hex number | |
228 syn match tclNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>" | |
229 "syn match tclIdentifier "\<[a-z_][a-z0-9_]*\>" | |
230 syn case match | |
231 | |
232 syn region tclComment start="^\s*\#" skip="\\$" end="$" contains=tclTodo | |
233 syn region tclComment start=/;\s*\#/hs=s+1 skip="\\$" end="$" contains=tclTodo | |
234 | |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
235 "syn match tclComment /^\s*\#.*$/ |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
236 "syn match tclComment /;\s*\#.*$/hs=s+1 |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
237 |
7 | 238 "syn sync ccomment tclComment |
239 | |
240 " Define the default highlighting. | |
241 " For version 5.7 and earlier: only when not done already | |
242 " For version 5.8 and later: only when an item doesn't have highlighting yet | |
243 if version >= 508 || !exists("did_tcl_syntax_inits") | |
244 if version < 508 | |
245 let did_tcl_syntax_inits = 1 | |
246 command -nargs=+ HiLink hi link <args> | |
247 else | |
248 command -nargs=+ HiLink hi def link <args> | |
249 endif | |
250 | |
251 HiLink tcltkSwitch Special | |
2034 | 252 HiLink tclExpand Special |
7 | 253 HiLink tclLabel Label |
254 HiLink tclConditional Conditional | |
255 HiLink tclRepeat Repeat | |
256 HiLink tclNumber Number | |
257 HiLink tclError Error | |
2034 | 258 HiLink tclCommand Statement |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
259 HiLink tclProcCommand Type |
7 | 260 HiLink tclString String |
261 HiLink tclComment Comment | |
262 HiLink tclSpecial Special | |
263 HiLink tclTodo Todo | |
264 " Below here are the commands and their options. | |
265 HiLink tcltkCommandColor Statement | |
266 HiLink tcltkWidgetColor Structure | |
267 HiLink tclLineContinue WarningMsg | |
2034 | 268 if exists('g:tcl_warn_continuation') |
269 HiLink tclNotLineContinue ErrorMsg | |
270 endif | |
7 | 271 HiLink tcltkStringSwitch Special |
272 HiLink tcltkArraySwitch Special | |
273 HiLink tcltkLsortSwitch Special | |
274 HiLink tcltkPackSwitch Special | |
275 HiLink tcltkPackConfSwitch Special | |
276 HiLink tcltkMaths Special | |
277 HiLink tcltkNamespaceSwitch Special | |
278 HiLink tcltkWidgetSwitch Special | |
279 HiLink tcltkPackConfColor Identifier | |
280 HiLink tclVarRef Identifier | |
281 | |
282 delcommand HiLink | |
283 endif | |
284 | |
285 let b:current_syntax = "tcl" | |
286 | |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
287 " vim: ts=8 noet nolist |