[Issue 4375] Require explicit braces when 'else' is ambiguous

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 8 04:01:26 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4375



--- Comment #15 from bearophile_hugs at eml.cc 2010-11-08 04:00:05 PST ---
(In reply to comment #14)

> Stewart's right in that this change can be effected by changing the grammar. 

Good, the grammar may just require braces in this case. This is a good enough
solution.


> You can get into all kinds of confusion by perversely indenting the source
> code, this particular one isn't special and so doesn't warrant special
> treatment.

>From what I have seen this particular indentation is a common enough bug, while
other indentations aren't a common enough source of bugs.

But you are right, there are other wrong kinds of indentations that may be
sources of bugs that will enjoy specific warnings (example: unexpected negative
indents warning).


> What I think would be of significant value is to create a D source code
> formatter that will properly indent the code based on the grammar. I'd love
> such a tool, and would use it (for example) as a filter on all D source code
> checkins.

The purpose of a modern IDE is to contain few hundred functionalities like this
one. Using a different tool for those functionalities is not practical nor is
what most modern programmers look for.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list