[TxMt] Some Tcl Syntax fixes...

Oscar Bonilla ob at bitmover.com
Thu Nov 10 22:18:29 UTC 2005


# These are some fixes for the Tcl Syntax.
#
# Tag function names as entity.name.function.tcl
# Make the array element name be part of the variable
# Use Tcl rules for embedded variable names
#
Index: Syntaxes/Tcl.plist
===================================================================
--- Syntaxes/Tcl.plist	(revision 2123)
+++ Syntaxes/Tcl.plist	(working copy)
@@ -60,8 +60,25 @@
					<key>name</key>
					<string>keyword.other.tcl</string>
				</dict>
+				<key>2</key>
+				<dict>
+					<key>name</key>
+					<string>entity.name.function.tcl</string>
+				</dict>
			</dict>
			<key>match</key>
+			<string>^\s*(proc)\s+([^\s]+)</string>
+		</dict>
+		<dict>
+			<key>captures</key>
+			<dict>
+				<key>1</key>
+				<dict>
+					<key>name</key>
+					<string>keyword.other.tcl</string>
+				</dict>
+			</dict>
+			<key>match</key>
			<string>(?<=^|[\[{;])\s*(after|append|array|auto_execok| 
auto_import|auto_load|auto_mkindex|auto_mkindex_old|auto_qualify| 
auto_reset|bgerror|binary|cd|clock|close|concat|dde|encoding|eof| 
error|eval|exec|expr|fblocked|fconfigure|fcopy|file|fileevent| 
filename|flush|format|gets|glob|global|history|http|incr|info|interp| 
join|lappend|library|lindex|linsert|list|llength|load|lrange|lreplace| 
lsearch|lset|lsort|memory|msgcat|namespace|open|package|parray|pid| 
pkg::create|pkg_mkIndex|proc|puts|pwd|re_syntax|read|regexp|registry| 
regsub|rename|resource|scan|seek|set|socket|SafeBase|source|split| 
string|subst|Tcl|tcl_endOfWord|tcl_findLibrary|tcl_startOfNextWord| 
tcl_startOfPreviousWord|tcl_wordBreakAfter|tcl_wordBreakBefore| 
tcltest|tclvars|tell|time|trace|unknown|unset|update|uplevel|upvar| 
variable|vwait)\b</string>
		</dict>
		<dict>
@@ -72,7 +89,7 @@
		</dict>
		<dict>
			<key>match</key>
-			<string>(\$)(\w+)</string>
+			<string>(\$)(\w+)(\([^\)]+\))?</string>
			<key>name</key>
			<string>variable.other.tcl</string>
		</dict>
@@ -94,10 +111,8 @@
					<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_.:][a-zA-Z_0-9.:]+(\([^)]+\))?|\{[a-zA-Z ]* 
\})</string>
+					<string>\$([a-zA-Z0-9_:]+(\([^\)]+\))?|\{[^\}]*\})</string>
					<key>name</key>
					<string>variable.other.tcl</string>
				</dict>




More information about the textmate mailing list