Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow accessing C++ symbols that are reserved keywords #92

Open
timotheecour opened this issue Jan 23, 2018 · 1 comment
Open

allow accessing C++ symbols that are reserved keywords #92

timotheecour opened this issue Jan 23, 2018 · 1 comment

Comments

@timotheecour
Copy link
Collaborator

// 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 #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);
@Syniurge
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants