Bug 397766 - Underline as first character in name passed to #ifndef breaks highlighting
Summary: Underline as first character in name passed to #ifndef breaks highlighting
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (show other bugs)
Version: 5.49.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 398147 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-23 00:55 UTC by Piotr Mierzwinski
Modified: 2018-09-05 07:31 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.50.0


Attachments
ifndef correct syntax highlighting (19.16 KB, image/png)
2018-08-23 19:22 UTC, Piotr Mierzwinski
Details
ifndef incorrect syntax highlighting (19.00 KB, image/png)
2018-08-23 19:22 UTC, Piotr Mierzwinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2018-08-23 00:55:51 UTC
As in subject.
Below line is showing in red color (skipping hash) instead of green (default setting)
#ifndef _LISTVIEWITEMDELEGATE_

This line is green (default setting)
#ifndef LISTVIEWITEMDELEGATE_

In some previous version it worked fine (both lines were green).
Comment 1 Dominik Haumann 2018-08-23 05:38:05 UTC
Please attach a screenshot.
Comment 2 Christoph Cullmann 2018-08-23 06:39:24 UTC
I think the issue is that we highlight _+... defines as error because they are reserved.

That might make sense for #define but I don't think for the uses.
Comment 3 Christoph Cullmann 2018-08-23 08:59:56 UTC
I think that handling shall be removed.
Your can do #define _xxxx just fine but not #ifdef _xxxx
Comment 4 Piotr Mierzwinski 2018-08-23 19:22:15 UTC
Created attachment 114562 [details]
ifndef correct syntax highlighting
Comment 5 Piotr Mierzwinski 2018-08-23 19:22:39 UTC
Created attachment 114563 [details]
ifndef incorrect syntax highlighting
Comment 6 Piotr Mierzwinski 2018-08-23 19:23:27 UTC
In attachment screen shots as you asked.
Comment 7 Christoph Cullmann 2018-08-25 18:43:02 UTC
Git commit 365fee5787c164e9e4a5c17440196456869d0a14 by Christoph Cullmann.
Committed on 25/08/2018 at 18:42.
Pushed by cullmann into branch 'master'.

fix highlighting for #ifdef _xxx stuff
unit test extended to catch this case

M  +9    -0    autotests/folding/highlight.cpp.fold
M  +9    -0    autotests/html/highlight.cpp.html
M  +9    -0    autotests/input/highlight.cpp
M  +9    -0    autotests/reference/highlight.cpp.ref
M  +2    -2    data/syntax/isocpp.xml

https://commits.kde.org/syntax-highlighting/365fee5787c164e9e4a5c17440196456869d0a14
Comment 8 Christoph Cullmann 2018-09-05 07:31:19 UTC
*** Bug 398147 has been marked as a duplicate of this bug. ***