Bug 129860 - perl syntax highlighting, $q,$m,$s treated as q,m,s
Summary: perl syntax highlighting, $q,$m,$s treated as q,m,s
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-26 19:44 UTC by rian
Modified: 2012-10-26 12:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rian 2006-06-26 19:44:19 UTC
Version:           3.3.3 (using KDE KDE 3.5.3)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8) 
OS:                Linux

if you are calling a method in a package (?terminology?), and one of your arguments is a variable named $q,$m, or $s, then it ends up being incorrectly highlighted.

If you open up a blank file in kdevelop, an turn on the perl syntax highlighting, none of these lines are 
correctly highlighted
a::a($q, $a);  #this text should be gray (comment colored)
a::a($s, $a);  #this text should be gray (comment colored)
a::a($m, $a);  #this text should be gray (comment colored)

Here are a few things i have noticed:
for the example:
a::a($q, $a);  #this text should be grey (comment colored)

it seems to be treating the $q as a q. it seems to be seeing something like this: q,<text>,. It mishighlights everthing until the next comma, as demonstrated by this example:
a::a($q, $a);  #not gray, #gray


for the examples:
a::a($s, $a);  #this text should be gray (comment colored)
a::a($m, $a);  #this text should be gray (comment colored)
if you add a third space after the semicolon, it will be correctly highlighted:
a::a($m, $a);   #This text is gray
Comment 1 Christoph Cullmann 2010-02-20 15:02:24 UTC
Moving to wish list status. All highlightings works with heuristics and will
never be perfect. Perhaps somebody can provide a patch, therefor not closing
it.
Comment 2 Anders Lund 2010-02-20 15:13:16 UTC
This is a bug, the variable should be detected here. I'll try and look into this one.
Comment 3 Christoph Cullmann 2012-10-26 12:35:10 UTC
All highlightings are just heuristics, they can't cover all corner cases and often lack latest language features.

If you provide some patch to fix your issue, we will take care of it, otherwise, it won't be fixed as the xml files are not that "actively" maintained beside by users fixing such issues themself.

See the highlighting docs on kate-editor.org on how to improve our existing files.

As we have >> 200 highlightings around, we can't do this ourself, sorry.
Please provide a patch and reopen the bug then (or dump the patch to kwrite-devel@kde.org).