is(int*==int*) / template X(T : int*=int*) do not compile because they are tokenized as
is ( int *= = int *)
template X ( T : int *= int * )
The parser could explicitly check for the *= = token combination / the *= token.
What this would add is that the compiler can actually parse all programs generated from the D grammar. It would solve a similar language problem C++98 had with the X<Y<int>>.
I think this should not add more than 10 LOC to the parser in total.
Comment #1 by nick — 2023-11-21T20:11:21Z
It could parse `*==` as `*` and `==`.
How can it tell that `*=` should be `*` and `=`?
Comment #2 by nick — 2023-11-21T20:13:55Z
> It could parse `*==` as `*` and `==`.
Here I meant the tokenizer.
> How can it tell that `*=` should be `*` and `=`?
You mean a workaround in the parser to deconstruct the `*=` token?
Comment #3 by robert.schadek — 2024-12-13T17:56:17Z