Village Pump:Home/Syntax Highlighting ( archived 2009-06-18 ): Difference between revisions

→‎Highlighting of Tcl: Improved description of what is wrong
(→‎Highlighting of Tcl: Improved description of what is wrong)
Line 310:
<lang tcl>if {[incr $a] == [list $b $c]} {puts [$d $a]} {error "$e $a"}</lang>
It's probably best for “{…}” to be not treated specially at all. (At some point we could also do with updating the list of ”keywords”, but that's nothing like as important.) —[[User:Dkf|Dkf]] 09:07, 22 May 2009 (UTC)
:The current list of "keywords" for Tcl 8.6 (which is quite a bit longer than for previous versions) is:
::'''Normal Keywords:''' append apply bgerror break catch cd class close concat constructor continue copy define deletemethod destructor else elseif eof error eval exec exit export expr fblocked fconfigure fcopy fileevent filename filter finally flush for foreach format gets glob if incr join lappend lassign lindex linsert list llength load lrange lrepeat lreplace lreverse lsearch lset lsort mixin my next objdefine object on open parray pid puts pwd read regexp regsub rename renamemethod return scan seek self set socket source split subst superclass switch tell then throw time trap try unexport unload unset uplevel vwait while
::'''Function Definition Keywords:''' create forward method new proc
::'''Variable Definition Keywords:''' global upvar variable
::'''Compound Keywords:''' after array binary chan clock dde dict encoding file info interp namespace package prefix registry string trace update zlib
:(With compound keywords, the word after the listed keyword should also be highlighted.) OK, they're not formally keywords, but they should be formatted like they are. Also, “{...}” is ''never'' an indication of a comment, and “$” followed by alphanumerics should be formatted as a variable reference. —[[User:Dkf|Donal Fellows]] 09:58, 17 June 2009 (UTC)
 
==Java5 messed up==
Anonymous user