Village Pump:Home/Syntax Highlighting ( archived 2009-06-18 ): Difference between revisions
Content added Content deleted
(→Highlighting of Tcl: reorganize for better readability, and state what the comment RE should be.) |
|||
Line 307: | Line 307: | ||
==Highlighting of [[Tcl]]== |
==Highlighting of [[Tcl]]== |
||
===Braces aren't comments=== |
|||
Is it possible to change the highlighting of Tcl so that sequences where there is an open and close brace on the same line are not highlighted as (presumably) comments? This makes expressions and one-liners much more difficult to read than they otherwise would be. For example, this is a one line <tt>if</tt>: |
Is it possible to change the highlighting of Tcl so that sequences where there is an open and close brace on the same line are not highlighted as (presumably) comments? This makes expressions and one-liners much more difficult to read than they otherwise would be. For example, this is a one line <tt>if</tt>: |
||
<lang tcl>if {[incr $a] == [list $b $c]} {puts [$d $a]} {error "$e $a"}</lang> |
<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) |
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) |
||
:Thanks for fixing this. —[[User:Dkf|Donal Fellows]] 14:34, 17 June 2009 (UTC) |
|||
⚫ | |||
===Keywords=== |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | :'''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 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 |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | ::proc global upvar variable after append apply array bgerror binary break catch cd chan clock close concat continue dde dict encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent flush for foreach format gets glob if incr info interp join lappend lassign lindex linsert list llength load lrange lrepeat lreplace lreverse lsearch lset lsort my namespace next open package parray pid prefix puts pwd read regexp registry regsub rename return scan seek self set socket source split string subst switch tell throw time trace try unload unset update uplevel vwait while zlib |
||
⚫ | |||
===Variables=== |
|||
A “$” followed by alphanumerics should be highlighted as a variable reference (if you highlight such things in other languages, of course). —[[User:Dkf|Donal Fellows]] 14:34, 17 June 2009 (UTC) |
|||
===Comments=== |
|||
The comment regexp should (probably) be: |
|||
(?:^|[[{;])[ \t]*(#[^\n]*) |
|||
(However that is encoded in PHP, I don't know.) It doesn't handle multi-line comments but we're not really using those on RC anyway. —[[User:Dkf|Donal Fellows]] 14:34, 17 June 2009 (UTC) |
|||
==Java5 messed up== |
==Java5 messed up== |