I'm writing a minor mode to handle automatic spacing of operator characters, but I'm having some trouble with C/C++. The problem is that I can't figure out how to tell in general whether a *
is a multiplication or a pointer type. Similarly for &
, and <
/>
in C++ .
I've currently got some basic hacks to detect the built in types (int
, char
, etc.) and to detect types ending in _t
. I've also found the c-guess-basic-syntax
function which can tell me when point is in a function header so I can handle function argument and return types. However I can't find any way to detect when point is in a normal variable declaration.
Is it possible without implementing a C compiler?