[TxMt] Little patch for Tcl Syntax

Allan Odgaard allan at macromates.com
Fri Aug 26 19:16:40 UTC 2005


On 26/08/2005, at 20.59, Oscar Bonilla wrote:

> This little patch fixes the syntax highlighting for strings with  
> escaped characters in Tcl. In case anyone finds it useful.

Actually Yuhei Kuratomi recently alerted me to the problem of  
embedded quotes in Tcl strings, and I have updated the Tcl syntax on  
the svn repository.

Below is the patch (which does change a few things about embedded  
stuff in strings), but it's probably easier to just grab the file  
from svn.

http://anon:anon@macromates.com/svn/Bundles/trunk/Bundles/ 
Tcl.tmbundle/Syntaxes/Tcl.plist


  Index: /Users/duff/Library/as/TextMate/Bundles/Tcl.tmbundle/ 
Syntaxes/Tcl.plist
===================================================================
--- /Users/duff/Library/as/TextMate/Bundles/Tcl.tmbundle/Syntaxes/ 
Tcl.plist    (revision 1590)
+++ /Users/duff/Library/as/TextMate/Bundles/Tcl.tmbundle/Syntaxes/ 
Tcl.plist    (working copy)
@@ -100,10 +100,33 @@

                      <key>comment</key>
                      <string>FIXME not sure this is the proper way  
to do Tcl escape sequences --Allan</string>
                      <key>match</key>
-                    <string>\([abfnrtv]|0d{2}|x[a-fA-F]{2}\)</string>
+                    <string>\\([abfnrtv"\\]|0\d{2}|x[a-fA-F0-9]{2}|u 
[a-fA-F0-9]{4})</string>
                      <key>name</key>
                      <string>constant.character.escape.tcl</string>
                  </dict>
+                <dict>
+                    <key>comment</key>
+                    <string>FIXME what are legal variable  
characters? --Allan</string>
+                    <key>match</key>
+                    <string>\$[a-zA-Z]+</string>
+                    <key>name</key>
+                    <string>variable.other.tcl</string>
+                </dict>
+                <dict>
+                    <key>begin</key>
+                    <string>\[</string>
+                    <key>end</key>
+                    <string>\]</string>
+                    <key>name</key>
+                    <string>source.tcl.embedded</string>
+                    <key>patterns</key>
+                    <array>
+                        <dict>
+                            <key>include</key>
+                            <string>source.tcl</string>
+                        </dict>
+                    </array>
+                </dict>
              </array>
          </dict>
      </array>




More information about the textmate mailing list