When the "Comment" character is part of the syntax

Started by: Meir3 voices7 posts

Dear Yutaka,

In Perl at least, sometimes the comment character '#' is a part of the syntax. EE does ignore its commenting-out nature when it is part of a string. However, at least in the following example it does color the rest of the line as comment:


my @list = ('string 1', 2, 4, 'string 2');
for my $i (0 .. $#list) {
...
}

everything beyond the '#' is colored 'comment'.

Did I missed a feature again...? :-(
Hello,

This is because '#' is defined as a Line Comment on the Highlight (2) tab of Perl configuration properties. You can remove the '#' from the Line Comment text box. This is the only way to solve the issue.

Thanks!
Perl is too messy, use Python.
This will solve a problem.
To whoever can understand this ancient language, written in ASCII graphems:

Mit eitzes binech bazorgt shoin!
In fact, what I forgot to mention is that the problem is not the coloring. I can live with that!

A more serious problem is that the matching parenthesis pairing is messed up. This IS a problem!

Removing the '#' from the Line Comment text field in the Highlight(2) tab of Perl configuration properties will create a lot more problems than "solved".

Can that be fixed???
Hello,

I see. I will have to consider improvements about line comments in future versions. For example, using regular expressions to specify line comments.

Thanks!
Yes, that would be great if you could find a way...

In fact, may be any coloring or other stuff could be specified by a regex.

EDIT: There are also other cases where the coloring/syntax is wrongly interpreted. For example, when a Perl scalar is named '$pos', the 'pos' part is colored red, being (also!) a standard Perl function. But here it is a scalar identifier, and it should have been colored blue. And yes, indeed, a RegEx looking for a Perl "sigil" ($, \%, @, & and more) concatenated with "w" will always color it as an identifier.

7 posts in this topic