After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 594501 - perl: no highlight for filetest breaks it
perl: no highlight for filetest breaks it
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
git master
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
: 616749 655536 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-09-08 14:26 UTC by Arnaud B.
Modified: 2013-03-29 18:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bugfix (553 bytes, patch)
2011-05-13 20:19 UTC, Carnë Draug
none Details | Review
Filetest operators highlighting (48 bytes, patch)
2012-08-28 15:09 UTC, Artem S Vybornov
none Details | Review

Description Arnaud B. 2009-09-08 14:26:53 UTC
I'm not good at perd, but a friend of mine told me that this expression is correct but doesn't displays properly :

if (-s "text.txt") { print "blabla"; }

Good luck!
Comment 1 Alexander Kuleshov 2009-10-24 08:07:26 UTC
What you do not like to display this expression?
Comment 2 Id2ndR 2009-10-24 11:50:54 UTC
The trouble is that "-s" interpretation is wrong. In this expression, "(-s "text.txt")" is the test of "if". What follow in a block which should be interpreted as a different block.
gedit currently color all the text in pink starting from the "s" of "-s". Gedit does not interpret "-s" as it should be so the color of what follow is wrong.

You may look to the interpretation of vim as a example of the good intrepretation.
Comment 3 Carnë Draug 2011-05-13 20:13:07 UTC
*** Bug 616749 has been marked as a duplicate of this bug. ***
Comment 4 Carnë Draug 2011-05-13 20:18:27 UTC
Hi

I can confirm this bug is still present on the trunk version.
Comment 5 Carnë Draug 2011-05-13 20:19:46 UTC
Created attachment 187792 [details] [review]
bugfix

On the duplicated bug #616749 it was suggested (in a very bad english but I think that's what it was said) that the attached patch would fix. It does fix this but I didn't test it extensively and not sure if it will break something else.
Comment 6 Artem S Vybornov 2012-08-28 15:08:37 UTC
Guys the problem is that there is no support of highlighting filetest (see perldoc -f -X) operators at whole.

Solution is adding the corresponding pattern into <... id="operator" ...> section.

95a96
>       \-[rwxoRWXOezsfdlpSbctugkTBMAC] |

Note it's important to add this line before the definition of "-" operator.
Comment 7 Artem S Vybornov 2012-08-28 15:09:24 UTC
Created attachment 222642 [details] [review]
Filetest operators highlighting
Comment 8 Alex Mayer 2013-02-04 17:34:52 UTC
I can confirm that the bug exists and that Artem S Vybornov's fix works.
I use perl on a semi-regular basis and this bug was driving me crazy...
Comment 9 Alex Mayer 2013-02-04 17:48:11 UTC
I may have spoken too soon. With the current code:

95a96
>       \-[rwxoRWXOezsfdlpSbctugkTBMAC] |

things like -exp($foo) are highlighted wrong. A simple fix for this is:

95a96
>       \-[rwxoRWXOezsfdlpSbctugkTBMAC]\s |
Comment 10 Alex Mayer 2013-02-15 22:06:02 UTC
pbor(irc) and i had a discussion that the space is not part of the syntax so should not be included in highlighting and the \b operator let things like "-e." through so we used a look ahead to check for a space(the space is not included in the syntax highlighting, only the operator)

95a96
>       \-[rwxoRWXOezsfdlpSbctugkTBMAC](?=\s) |

Patch to come.
Comment 11 Carnë Draug 2013-03-29 18:28:20 UTC
*** Bug 655536 has been marked as a duplicate of this bug. ***
Comment 12 Carnë Draug 2013-03-29 18:29:49 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Hi signed the commit 67037f1198b9f23fa0f4c045a96464c633fcaf97 with Alex Mayer <magictrick4906@aim.com>