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 115614 - wrong highlight for #if 1 in c
wrong highlight for #if 1 in c
Status: RESOLVED DUPLICATE of bug 137587
Product: gtksourceview
Classification: Platform
Component: Syntax files
git master
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2003-06-20 16:40 UTC by Paolo Borelli
Modified: 2014-11-09 18:32 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Paolo Borelli 2003-06-20 16:40:01 UTC
if I have


#if 0
	foo
#else
	bar
#endif


foo is blue (color meaning commented out) and bar is black as expected; but
if I have


#if 1
	foo
#else
	bar
#endif


both foo and bar are black, while I would expect bar to be blue since in
this case it is commented out.
Comment 1 Paolo Maggi 2003-06-22 10:27:53 UTC
Current highlighting algorithm is quite limited and cannot handle the
case you have described.

Changing severity to enh.
Comment 2 Paolo Maggi 2004-07-20 10:08:50 UTC

*** This bug has been marked as a duplicate of 137587 ***
Comment 3 Erkin Alp Güney 2014-11-09 18:20:28 UTC
It goes out of the scope of regex. We would need at least context-free grammars to understand #if 1 // #else situation.
Comment 4 Sébastien Wilmet 2014-11-09 18:32:01 UTC
Hey, this bug was marked as duplicate 10 years ago, why do you comment here? And it seems that the problem is fixed.