Trass3r wrote:
I hope, we agree on !in and !is, as the current lexing introduces the shown parsing problems. But !is needs to be added to the IsExpression rules then.

Hmm what if you have something like Templ!is(T:int)

This is not allowed, template arguments without parenthesis are limited to a specific list of single tokens.


Is http://d.puremagic.com/issues/show_bug.cgi?id=5785 fixable with grammar changes other that !is being one token?

>>    if (s.x !in a) {}
>>    if (b !in a) {} // but this compiles!?

The second line works because it is special cased for PrimaryExpression in the dmd parser by checking whether '!' is followed by 'in' or 'is', while PostfixExpression only checks 'is'. I've added a patch to the bugreport.

I haven't had a look yet how UFCS is expressed and how it could affect this.

Reply via email to