Calypso
Calypso copied to clipboard
allow accessing C++ symbols that are reserved keywords
// util.h
void function(int a){}
struct delegate{
int function=0;
};
// main.d
import _; // won't make clashing symbols available (unless maybe with awkward __traits wizardry)
//import (C++) _ : _function=function; // not legal
We need a more general solution than https://github.com/Syniurge/Calypso/pull/5
How about making each C++ symbol that is a reserved D keyword automatically prepended by §
or ℂ
?
eg:
import _;
ℂfunction(1);
import _ : _function = ℂfunction;
_function(1);
That's how it should be, getIdentifierOrNull
needs to be expanded to prefix with ℂ in more cases. § isn't suitable however, it's easier to type on some keyboards but it's not accepted by the lexer as a valid character in identifiers.