summaryrefslogtreecommitdiffstats
path: root/syntax/tcl.vim
diff options
context:
space:
mode:
Diffstat (limited to 'syntax/tcl.vim')
-rw-r--r--syntax/tcl.vim24
1 files changed, 12 insertions, 12 deletions
diff --git a/syntax/tcl.vim b/syntax/tcl.vim
index 73d1e607..54ec20a7 100644
--- a/syntax/tcl.vim
+++ b/syntax/tcl.vim
@@ -10,9 +10,9 @@ endif
" (previously Matt Neumann <mattneu@purpleturtle.com>)
" (previously Allan Kelly <allan@fruitloaf.co.uk>)
" Original: Robin Becker <robin@jessikat.demon.co.uk>
-" Last Change: 2014-02-12
-" Version: 1.14
-" URL: http://bitbucket.org/taylor_venable/metasyntax/src/tip/Config/vim/syntax/tcl.vim
+" Last Change: 2021 Nov 16
+" Version: 1.14 plus improvements from PR #8948
+" URL: (removed, no longer worked)
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -172,7 +172,7 @@ syn region tcltkCommand matchgroup=tcltkCommandColor start="\<format\>" matchgro
" PACK
" commands associated with pack
-syn keyword tcltkPackSwitch contained forget info propogate slaves
+syn keyword tcltkPackSwitch contained forget info propagate slaves
syn keyword tcltkPackConfSwitch contained after anchor before expand fill in ipadx ipady padx pady side
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
@@ -196,18 +196,18 @@ syn region tcltkCommand matchgroup=tcltkCommandColor start="\<lsort\>" matchgrou
syn keyword tclTodo contained TODO
" Sequences which are backslash-escaped: http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm#M16
-" Octal, hexadecimal, unicode codepoints, and the classics.
+" Octal, hexadecimal, Unicode codepoints, and the classics.
" Tcl takes as many valid characters in a row as it can, so \xAZ in a string is newline followed by 'Z'.
-syn match tclSpecial contained '\\\([0-7]\{1,3}\|x\x\{1,2}\|u\x\{1,4}\|[abfnrtv]\)'
+syn match tclSpecial contained '\\\(\o\{1,3}\|x\x\{1,2}\|u\x\{1,4}\|[abfnrtv]\)'
syn match tclSpecial contained '\\[\[\]\{\}\"\$]'
" Command appearing inside another command or inside a string.
syn region tclEmbeddedStatement start='\[' end='\]' contained contains=tclCommand,tclNumber,tclLineContinue,tclString,tclVarRef,tclEmbeddedStatement
" A string needs the skip argument as it may legitimately contain \".
" Match at start of line
-syn region tclString start=+^"+ end=+"+ contains=@tclSpecialC skip=+\\\\\|\\"+
+syn region tclString start=+^"+ end=+"+ contains=@tclSpecialC,@Spell skip=+\\\\\|\\"+
"Match all other legal strings.
-syn region tclString start=+[^\\]"+ms=s+1 end=+"+ contains=@tclSpecialC,@tclVarRefC,tclEmbeddedStatement skip=+\\\\\|\\"+
+syn region tclString start=+[^\\]"+ms=s+1 end=+"+ contains=@tclSpecialC,@tclVarRefC,tclEmbeddedStatement,@Spell skip=+\\\\\|\\"+
" Line continuation is backslash immediately followed by newline.
syn match tclLineContinue '\\$'
@@ -226,12 +226,12 @@ syn match tclNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
"floating point number, without dot, with exponent
syn match tclNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
"hex number
-syn match tclNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
-"syn match tclIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn match tclNumber "0x\x\+\(u\=l\=\|lu\)\>"
+"syn match tclIdentifier "\<\h\w*\>"
syn case match
-syn region tclComment start="^\s*\#" skip="\\$" end="$" contains=tclTodo
-syn region tclComment start=/;\s*\#/hs=s+1 skip="\\$" end="$" contains=tclTodo
+syn region tclComment start="^\s*\#" skip="\\$" end="$" contains=tclTodo,@Spell
+syn region tclComment start=/;\s*\#/hs=s+1 skip="\\$" end="$" contains=tclTodo,@Spell
"syn match tclComment /^\s*\#.*$/
"syn match tclComment /;\s*\#.*$/hs=s+1