Parenthesis around if/for/while condition is not necessary

Basile B. b2.temp at gmx.com
Thu Jul 5 09:45:44 UTC 2018


On Wednesday, 4 July 2018 at 14:37:49 UTC, Timon Gehr wrote:
> On 24.06.2018 13:27, Basile B. wrote:
>> 
>> FYI this works fine, as expected it's just some small parser 
>> changes.
>> I didn't touch to for and foreach for now. I think that 
>> SwitchStatement is a candidate too.
>> 
>> https://github.com/BBasile/dmd/commit/5455a65c8fdee5a6d198782d1f168906b59e6d3d
>
> if (a+b)*c == d { ... }

right, maybe logic to apply here is : if the expression parses 
and no closing paren is found then it's not nececessary.


More information about the Digitalmars-d mailing list