Bug 108370

Summary: C/C++ syntax highlight doesn't distinguish comments on the same line as #define
Product: [Applications] kate Reporter: Ruslan Mstoi <rmstoi>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: 2.4.1   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ruslan Mstoi 2005-06-30 15:25:54 UTC
Version:           2.4.1 (using KDE KDE 3.4.1)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-52) 
OS:                Linux

The C/C++ syntax highlight doesn't seem to notice comments on the same
line as #define. For example:

#define TRUE 1 /* just some comment */

or 

#define TRUE 1 // just some comment

In either cases the whole line is colored as preprocessor.
On the other hand #ifdef, #elif, #undef, #endif seem to work
ok. 

It would also be nice to have tokens highlighted in different
color. I.e. in this case #define could be colored as preprocessor
command, and toked TRUE could be colored in some other color.
Comment 1 Tom McDonald 2007-08-23 21:39:45 UTC
The syntax coloring also bugs out if a #define (or similar) statement is followed by a multi-line comment. For example,

#define N 1  /* this comment has
                multiple lines */
Comment 2 Sebastian Pipping 2007-10-16 21:42:22 UTC
SVN commit 725983 by sping:

Fixes for C/C++ highlighters:
- Recogize comments after #define (#108370)
- Folding for for all proprocessor conditionals (only for "#if 0" before) (#124362)
- Folding for multi-line comments was missing in C++ highlighter
- Error marking for preprocessor lines not in #(define|elif|else|endif|if|ifdef|ifndef|include)
- Sync notice added
- Version number incremented to same value
BUG: 108370
BUG: 124362
CCMAIL: webmaster@hartwork.org


 M  +35 -10    c.xml  
 M  +37 -11    cpp.xml  


WebSVN link: http://websvn.kde.org/?view=rev&revision=725983