You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-> is the only token used and required by this proposal. Several people suggested -> for code injection purposes. It's already a valid c++ token, which mean there is no need to add any new token or keyword, and -> represents injection pretty well.
Perhaps a new token is actually better? One reason why C++ is so slow to compile is due to the reuse of tokens. It requires the compiler to examine the context of tokens to disambiguate them.
The text was updated successfully, but these errors were encountered:
Fortunately, there should be no need to examine the context. -> followed by {, (, class, struct or namespace means injection, otherwise it means operator-> or trailing return type.
You only ever need to look up one token a head, which seems rather sensible given all the crazy things involved in parsing some other constructs.
if(token.is("->") and nextToken.is_identifier()) {
// not injection
}
else {
// probably injection
}
What other token would you propose ? we are running short on them. Maybe => ?
I was reading your proposal and found:
Perhaps a new token is actually better? One reason why C++ is so slow to compile is due to the reuse of tokens. It requires the compiler to examine the context of tokens to disambiguate them.
The text was updated successfully, but these errors were encountered: