[quote=“Daftatt”]Bumping, because the C++ syntax highlighting is screwy in other places too.
when declaring a pointer using parenthesis it thinks I’m declaring a function, the syntax highlighting needs to be changed so it will only highlight as a function after an open curly brace follows it (indicating a code block for the function statements)[/quote]
Well, yes, the syntax is screwy. Here’s the problem:
int f(3); // defines ‘f’ as an object of type int with initial value of 3
int g(int); // declares ‘g’ as a function that takes one argument, of type int, and returns int.
You can’t write a regular expression to distinguish between these two, because the difference between them is that in the first case, the text inside the parentheses is a value and in the second it’s the name of a type. Regular expressions, looking only at the text in question, don’t have enough information to make this distinction. Here’s a more perverse example:
// myheader.h:
#if DEFINE_OBJECT
const int xx = 3;
#else
typedef int xx;
#endif
// test.cpp:
#include “myheader.h”
int f(xx);
Understanding what ‘f’ is in this case requires the moral equivalent of compiling the source code. There’s no way that a regular expression can make sense out of it.