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

Initializers support, not just pure decl #21

Open
pyoneerC opened this issue Jul 7, 2023 · 1 comment
Open

Initializers support, not just pure decl #21

pyoneerC opened this issue Jul 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@pyoneerC
Copy link

pyoneerC commented Jul 7, 2023

unnamed

@Eisenwave Eisenwave added the enhancement New feature or request label Jul 7, 2023
@Eisenwave
Copy link
Owner

Eisenwave commented Jul 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants