On Sunday, 13 March 2016 at 14:07:31 UTC, Basile B. wrote:
'$' is only valid in an indexExpression
(https://dlang.org/spec/grammar.html#IndexExpression),
so it can only be followed by
- ' '
- ']'
- operators , usually '-' but also '/', '+', '>>' etc
Is that right ?
I'd like to relax the lexical rule for C.E static macros which
currently is
- "^\$\w*[a-zA-Z]$", so for example "$a1A" is valid and "$a1"
is not.
But it looks like for example "$)" or "$}" wouldn't be
ambiguous since it's not possible in D.
I don't know what C.E is, but `$` is an expansion of
`PrimaryExpression`, which means it can (syntactically) appear
anywhere a `PrimaryExpression` is allowed. For example, this
compiles:
void main() {
int[] a;
a[0 .. ($)] = 0;
}