In D, lexically, which are the chars that can follow $, exactly ?

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 13 07:07:31 PDT 2016


'$' 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.



More information about the Digitalmars-d-learn mailing list