[AMG]: My preferred method of [Tcl] syntax highlighting is to only highlight the syntax as defined by the [dodekalogue]. * $Variable ${subst}$itut(ions) * [[Brackets]] (not including the enclosed text) * {Braces} (not including the enclosed text) * "Quotes" and "text between quotes" * \Backslash sequences * Line continuation\ * [{*}] Expand operator * Semicolons; * # Comments Within a "quoted" word, text inside [[brackets]] should revert to the normal top-level syntax highlighting and should not be colored the same as the other text between quotes. ====== puts "this text [concat "contains a" subst$itut::ion]" ;# comment 122222222223 122222222221 455555555531 6777777777 1: quotes 2: quoted text 3: brackets 4: variable dollar sign, braces, or parentheses 5: variable name or array element name 6: semicolon 7: comment ====== I wonder if namespace qualifiers should be highlighted the same as variable names or if they should be shown a little differently. Try it and see, I guess. Part of the reason I like this approach is that it doesn't get hung up worrying about whether any given word is a "keyword". Tcl doesn't have keywords anyhow. For example, is "[set]" a keyword? How should "set set set" be highlighted? Or, is "[yieldm]" a keyword? It's (currently) [unsupported], but some programs ([Wub], at least) use it anyway. Is "[image]" a keyword? It's [Tk] only, and maybe the program doesn't use Tk. And so on. I suggest that this Wiki adopt this minimal approach to syntax highlighting, especially considering that it contains many preformatted code blocks that don't actually contain Tcl code. It's very distracting to have random words like "for" and "variable" be highlighted. ---- '''[jdc] - 2010-06-15 03:55:59''' Do you have code doing highlighting this way? [AMG]: Yes, but it's a [Vim] syntax highlight script, and it has a few bugs. <> Syntax