C/C++ syntax bug

Discuss syntax highlighting or submit new syntax files.
Post Reply
Mpegip
Posts: 6
Joined: 11 Jan 2021 16:58

C/C++ syntax bug

Post by Mpegip »

'# include' is not highjlighted as preprocessor line. note that C/C++ allows spaces after # char.

Code: Select all

#include/**/<time.h>
#include <ncurses.h>
# include <stdlib.h>
Mpegip
Posts: 6
Joined: 11 Jan 2021 16:58

Re: C/C++ syntax bug

Post by Mpegip »

More

Code: Select all

#ifdef PROTECTED_BUILD
#	pragma warning(push)
#	pragma warning(disable:4995)
#	include <malloc.h>
#	pragma warning(pop)
//#	define TRIVIAL_ENCRYPTOR_DECODER
//#	include "trivial_encryptor.h"
//#	undef TRIVIAL_ENCRYPTOR_DECODER
#endif // PROTECTED_BUILD

CLocatorAPI*		xr_FS = NULL;
#pragma optimize("gyts", off)

#ifdef _EDITOR
#	define FSLTX	"fs.ltx"
#else
#	define FSLTX	"fsgame.ltx"
#endif
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: C/C++ syntax bug

Post by Rickard Johansson »

I tried changing the keyword group in Cpp.syx for preprocessor directives to:

Code: Select all

#Preprocessor Directives=^#\h*(?:define\b|elif\b|else\b|endif\b|error\b|if\b|ifdef\b|ifndef\b|include\b|line\b|pragma\b|undef\b)
It seems to work pretty well.
Post Reply