Packages
Packages copied to clipboard
[TCL] Comments directly after opening curly brace are not correctly rendered
- Sublime Version: 3.2.2
- OS Version: Windows 10 (latest udpates)
proc test { arg1 } {# this comment-colour is odd
set a 1
}
I fill bug firstly to forum.sublimetext.com, but duplicate there.
Steps:
- Color theme - "jEdit" (jEdit Color Theme).
- File "test.tcl".
- Syntax: "Tcl".
- Code example:
32: proc ::_buttontoggleHandler { cbox args } { 33: # Foreground of this comment is green. 34: if {$args eq "invoke"} { # Foreground of this comment is black. 35: $cbox invert; # Foreground of this comment is black too 36: }; 37: $cbox {*}$args; 38: };
- Check, that Sublime highlight the comments does not as expected.
Behaviour of the Sublime-Text:
Correct behaviour must be:
- Lines after the first symbol "#", which is not backslashed (backslashed symbols "#" - is not an indicator of start of comment), to the end of the line - must be highlighted as a comment (foreground=green, like in line 33). Syntax checker of the Tcl interpreter can detect, which words with "#" symbol is a part of argument, or is a comment, but in simple case (as in most editors, which I used, and which has the Tcl syntax highlight function), the line from the first un-backslashed symbol "#" - highlighted as comment. Line 34 shows, that syntax highlight function is bugged.
- Lines after the un-backslashed symbol ";" - is a new Tcl command. And all Tcl commands, which first printable symbol is a un-backslashed "#" - is a comment. So, comment at the end of line 35 must be highlighted as a comment (style foreground=greed, like in line 33). Line 35 show, that syntax highlight function is bugged.
Behaviour of the Eclipse:
- line 33 - is highlighted as a normal comment;
- line 34 - comment at the end of the line is not highlighted (Eclipse can't detect comments at the end of the command);
- line 35 - comment at the end of the line is highlighted (the symbol ";", which placed before the symbol "#", allows Eclipse to handle next words as a new command, which interpreted as comment, because this command has first printable symbol "#").
Behaviour of the Geany:
Geany editor correctly highlight comments at all lines as a comments: 33, 34 and 35.