Page 1 of 1

C/C++ syntax bug

Posted: 11 Jan 2021 17:10
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>

Re: C/C++ syntax bug

Posted: 11 Jan 2021 17:19
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

Re: C/C++ syntax bug

Posted: 17 Feb 2021 12:17
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.