Bug 279799 - awk highlighting /x/ issue
Summary: awk highlighting /x/ issue
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 10:01 UTC by Roberto
Modified: 2011-08-11 13:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto 2011-08-10 10:01:16 UTC
Version:           unspecified (using KDE 4.7.0) 
OS:                Linux

The highlighting feature for awk scripts misbehave when a pair of slash characters is found across quotes or double quotes.

Reproducible: Always

Steps to Reproduce:
The following example lines make text highlighting misbehave in awk scripts:
print a/b/c
printf("%g",a/b) >"/dev/stderr" #comment


Expected Results:  
quotes or double quotes should rule against slash pairs
Comment 1 Dominik Haumann 2011-08-11 08:35:51 UTC
Can you please have a look into the file
  kde4/share/apps/katepart/syntax/awk.xml
somewhere in your system (maybe /usr/share/ or so) and provide a fix for that?
Comment 2 Dominik Haumann 2011-08-11 10:09:50 UTC
We need someone with awk knowledge to fix this... Anyone?
Comment 3 Roberto 2011-08-11 11:04:18 UTC
Hi,

the problem relies in the line:
<RegExpr String="/([^\/[]|\\.|\[\]?(\[[^]]+\]|.)+\])+/" attribute="Pattern" context="#stay" />

by commenting out this line the issue is solved but no /x/ patterns are highlighted. IMO this is better than having a completely screwed highlighting through all the text.
Comment 4 Roberto 2011-08-11 11:14:57 UTC
I propose to remove or comment out the line as default in the next releases. It is not possible with a regexp to distinguish a pattern /x/ from a math operation, a/b/c, or from a path, /dev/stderr.
Comment 5 Dominik Haumann 2011-08-11 13:11:26 UTC
Yes, in my opinion, this is indeed a good compromise. Will change it this way.
Comment 6 Dominik Haumann 2011-08-11 13:11:52 UTC
Git commit 4a54effbb4bc256b8ead8b62c0339a0977c8bc75 by Dominik Haumann.
Committed on 11/08/2011 at 15:10.
Pushed by dhaumann into branch 'master'.

fix awk patatern highlighting

BUG: 279799

M  +1    -2    part/syntax/data/awk.xml

http://commits.kde.org/kate/4a54effbb4bc256b8ead8b62c0339a0977c8bc75
Comment 7 Dominik Haumann 2011-08-11 13:13:31 UTC
Git commit 3841d330ca149a8cfc9c2588beeaaba743b653a4 by Dominik Haumann.
Committed on 11/08/2011 at 15:10.
Pushed by dhaumann into branch 'KDE/4.7'.

fix awk patatern highlighting

BUG: 279799

M  +1    -2    part/syntax/data/awk.xml

http://commits.kde.org/kate/3841d330ca149a8cfc9c2588beeaaba743b653a4