Bug 609 : /*/ to start multiline comment misinterpreted by syntax highlighter
Last modified: 2010-03-17 13:24




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P5
Severity:
normal

 

Reporter:
ewjordan
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2007-08-19 08:20
Try the following code in the PDE:

//*
println("1");
/*/
println("2");
//*/

Based on the syntax highlighting in the PDE, one would expect Processing to
print both 1 and 2, but in fact it only prints 1. Apparently the /*/ is
being misinterpreted as both opening and closing the multiline comment by
the editor, whereas the compiler reads it as only opening the comment.
This is fairly serious since a bug caused by this could be very difficult
to track down, as it appears that a line of code is being executed whereas
in reality it is ignored. This caught me off guard and took a while to
figure out.

[Note that the main reason to use the above commenting scheme is that if
you change the first line between //* and /* you can toggle between the "1"
chunk and the "2" chunk by changing only a single character - I don't know
how many people do this, but I use this quite often when I have two
competing and nontrivial pieces of code to compare]
Additional Comment #1 From fry 2007-08-28 17:48
k, noted. thanks.

the syntax highlighter mostly just stinks (see: mousePressed and friends)
and needs to be replaced.
Additional Comment #2 From MrFeinberg 2010-03-15 19:59
Fixed; please verify and close.