indent enhancement request remove unneeded brackets

View: New views
3 Messages — Rating Filter:   Alert me  

indent enhancement request remove unneeded brackets

by w langdon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I do not know how easy it would be to do this, but one of our users
has requested that indent be able to remove unnecessary "{" "}".

Some automatically generated C (produced by CIL) has many
extra brackets, which serve only to clutter the source code
and it would be nice if gnu indent could remove them from its
pretty print.

                            Thank you

                                Bill

        Dr. W. B. Langdon,
        Department of Computer Science,
        King's College London,
        Strand, London, WC2R 2LS, UK
        http://www.cs.ucl.ac.uk/external/W.Langdon

A Field Guide to Genetic Programming
                       http://www.gp-field-guide.org.uk/
Evolving purple robot
http://bioinformatics.essex.ac.uk/users/wlangdon/field_guide/
CIGPU 2009             http://www.cs.ucl.ac.uk/external/W.Langdon/cigpu
GP EM                  http://www.springer.com/10710
GP Bibliography        http://www.cs.bham.ac.uk/~wbl/biblio/


_______________________________________________
bug-indent mailing list
bug-indent@...
http://lists.gnu.org/mailman/listinfo/bug-indent

Re: indent enhancement request remove unneeded brackets

by indent-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

w langdon wrote:

> I do not know how easy it would be to do this, but one of our users
> has requested that indent be able to remove unnecessary "{" "}".
>
> Some automatically generated C (produced by CIL) has many
> extra brackets, which serve only to clutter the source code
> and it would be nice if gnu indent could remove them from its
> pretty print.
>
>                             Thank you
>
>                                 Bill
>
>         Dr. W. B. Langdon,
>         Department of Computer Science,
>         King's College London,
>         Strand, London, WC2R 2LS, UK
>         http://www.cs.ucl.ac.uk/external/W.Langdon
>
> A Field Guide to Genetic Programming
>                        http://www.gp-field-guide.org.uk/
> Evolving purple robot
> http://bioinformatics.essex.ac.uk/users/wlangdon/field_guide/
> CIGPU 2009             http://www.cs.ucl.ac.uk/external/W.Langdon/cigpu
> GP EM                  http://www.springer.com/10710
> GP Bibliography        http://www.cs.bham.ac.uk/~wbl/biblio/
>
>
> _______________________________________________
> bug-indent mailing list
> bug-indent@...
> http://lists.gnu.org/mailman/listinfo/bug-indent
>
>  
Bill,
Thank you for your suggestion. In my opinion, however, it is beyond the
scope of indent to modify syntactic elements of the source code. The
purpose of indent is to adjust the white space between the syntactic
elements. It would be better to fix the problem at the origin by
adapting CIL to not produce superfluous braces.

David.


_______________________________________________
bug-indent mailing list
bug-indent@...
http://lists.gnu.org/mailman/listinfo/bug-indent

Re: indent enhancement request remove unneeded brackets

by Ben Gardner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, May 22, 2009 at 11:48 AM, w langdon
<william.bill.langdon@...> wrote:
> I do not know how easy it would be to do this, but one of our users
> has requested that indent be able to remove unnecessary "{" "}".
>
> Some automatically generated C (produced by CIL) has many
> extra brackets, which serve only to clutter the source code
> and it would be nice if gnu indent could remove them from its
> pretty print.

Hi Bill,

Uncrustify can remove unnecessary braces. It can also add them.
http://uncrustify.sourceforge.net/

Ben


_______________________________________________
bug-indent mailing list
bug-indent@...
http://lists.gnu.org/mailman/listinfo/bug-indent