bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-indent] Improvement of indent


From: Владислав Дума
Subject: [Bug-indent] Improvement of indent
Date: Fri, 06 Dec 2002 13:55:09 +0300

Dear indent maintainers,

I have an idea on improvement of its behaviour.

The point is that the following construction:
8><----------------
if (cond_1)
    if (cond_2)
        expr_1;
else
    expr_2;
----------------><8
(which is of course logically erroneous, since
"else" is related to the second "if", not the first!)
will be reformatted by indent to something like
8><----------------
if (cond_1)
    if (cond_2)
        expr_1;
    else
        expr_2;
----------------><8
This is not very good, because in the former version of
formatting the intention of code author can be clearly seen
and the error can be mentioned by a qualified code-checker,
while in the latter version the code looks correct, and finding
an error here needs having understood the sence of code.
So this might lead to some logical errors.

Improvement of this can be perhaps done by issuing a warning
to user about "possible semantic mistake" or so on.

Sincerely yours,
Vladislav Duma,

programmer,
IT ConSol GmbH,
Nurnberg,
Germany.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]