[SVN] Bugfix for Tcl Bundle Syntax

Taylor Venable taylor at metasyntax.net
Thu Jul 9 02:41:43 UTC 2009


This is my first time playing with TextMate syntax; I've only been  
using it for about two weeks but so far I'm quite happy with it.  But  
I found a problem in the Tcl bundle's syntax highlighting that causes  
embedded regexp and regsub commands to eat up the ending bracket which  
causes the embedded scope to continue beyond the end of the actual  
embedded command.  For example:

set x "hello [regsub {abc} "abcdef" {fed}] world"

At the end of this line the scope would be: source.tcl >  
string.quoted.double.tcl > source.tcl.embedded where it should be just  
source.tcl; the attached patch fixes this by making the check for  
the ] at the end of the regsub and regexp command syntax a zero-width  
lookahead assertion.

A patch (created by svn diff) is attached.  It's a very simple fix,  
and I've not noticed that it introduces any problems.  One other thing  
to consider along similar lines is making source.tcl include  
#embedded; while this is more technically correct to the code  
structure it's not going to affect syntax highlighting any.

Best regards,

Taylor Venable
taylor at metasyntax.net
http://real.metasyntax.net:2357/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcl.diff
Type: application/octet-stream
Size: 474 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate-dev/attachments/20090708/f98179e5/attachment.diff>


More information about the textmate-dev mailing list