cdecl-plus
cdecl-plus copied to clipboard
Initializers support, not just pure decl
The problem with this is that C++ is a context-sensitive language. You can't generally tell what an expression means without the symbols. For example:
void* xy = templ<0>>3;
// if templ is a template, then this is parsed as
void* xy = (templ<0>) > 3
// if templ is not a template, then this is parsed as
void* xy = (templ < 0) >> 3;
To make this work, I would either have to hard-code a huge amount of symbols (or at least whether they are a template, type, or variable), or write a full C++ parser and take in standard library headers.
One alternative is to treat everything as a non-template by default, and require typename and template disambiguators everywhere.