Interesting user mistake
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Fri Sep 4 10:17:53 PDT 2015
On 09/03/2015 01:15 PM, "Luís Marques <luis at luismarques.eu> wrote:
> On Thursday, 3 September 2015 at 17:12:31 UTC, H. S. Teoh wrote:
>> Is there a way for the lexer to check for the specific character
>> sequence '=', '+', whitespace and not others (e.g. '=', whitespace,
>> '+')? IOW, "a =+ b" will be prohibited, but "a = + b" will be
>> allowed. If so, I agree with this.
>>
>> On that note, though, the unary + operator is totally useless in D...
>> maybe we should get rid of that instead? (Then "=+" will
>> automatically be an error.)
>
> What about the generalization? E.g., '=', '-', whitespace?
Yah, '-' with the wrong spacing around it also makes sense. -- Andrei
More information about the Digitalmars-d
mailing list