News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Is astyle supposed to touch comment (/* */)?

Started by m00, December 28, 2005, 07:08:09 PM

Previous topic - Next topic

m00

Current, I have comment looks like this.
/*
* comments....
* comments....
* comments....
*/


If I touch astyle and it always will ending up like this by remove the first space.
/*
* comments....
* comments....
* comments....
*/

Is there any option to disable it, or is it bug, or is it normal?


Uh oh, looks like forum has removed the first space too in the first example above. I had to add tab in the third example to workaround for this forum to show the * is supposed to be straight in the first example.
/*
* comments....
* comments....
* comments....
*/

jimp

The problem is probably one of the options you are using,  like pad-parens or pad-operators.  Try it without either of these options.

m00

Quote from: jimp on December 28, 2005, 10:18:44 PM
The problem is probably one of the options you are using,  like pad-parens or pad-operators.  Try it without either of these options.


Good call, it was pad-operators that I had it enable. It sounds like a bug? Should I report in sourceforge? I am not sure if it's a bug or feature.

Ceniza

I'd say that's a bug, an AStyle bug, but since AStyle development has stopped, it'd be kinda useless to add a bug report, or it could be reported already.

I hope AStyle's replacement be developed and released soon...

m00

Okay, thanks, I shall report in AStyle and leave there for anyone that willing to pick up in future.

takeshimiya

Quote from: devsolar link=http://sourceforge.net/forum/forum.php?forum_id=507269
Looking for new maintainer

I decided that the legacies involved in AStyle were too much of a hindrance for me to make any significant progress towards the 1.17.0 release I have been battling for whenever I picked up the thread again.

If anyone is willing to continue this project, please contact devsolar@users.sourceforge.net.

I will soon start work on a source reformatter specialized on C++ instead. I don't know much about C#, and AFAIK there are good Java reformatters readily available, so compatibility to those languages was one of the main roadblocks for me in AStyle. Perhaps I can make better progress that way.

Sorry for taking so long to realize I'm not the person to bring AStyle forward.

280Z28

Quote from: Ceniza on December 29, 2005, 02:44:37 AM
I'd say that's a bug, an AStyle bug, but since AStyle development has stopped, it'd be kinda useless to add a bug report, or it could be reported already.

I hope AStyle's replacement be developed and released soon...

I'm working on a plugin that does format-as-you-type, and can reformat code when you paste it (just the code you pasted, say copy and paste from one program to another), similar to what Visual Studio 2005 can do with C# code, if you are familiar with that.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
Check out The Sam Zone :cool:

yop

Quote from: 280Z28 on December 29, 2005, 10:27:09 PMI'm working on a plugin that does format-as-you-type, and can reformat code when you paste it (just the code you pasted, say copy and paste from one program to another), similar to what Visual Studio 2005 can do with C# code, if you are familiar with that.
This is a very handy feature, kdevelop has this one also (haven't used visual studio for ages to know what happens there). You'll use existing astyle handling implemented in codeblocks? (cause it'll need consistency with the style the user has selected for the astyle plugin).
Life would be so much easier if we could just look at the source code.

royalbox

#8
QuoteI'm working on a plugin that does format-as-you-type

I look forward to seeing that. There seems to be a few bugs or annoyances in Astyle.
One is this:

THING thing{0};
becomes:
THING thing {
    0
};

no matter what options I try.

Also, comments added after code (on the same line) seem to drift to the right each time Astyle is used.

Michael

Quote from: royalbox on January 03, 2006, 04:18:42 PM
THING thing{0};
becomes:
THING thing {
    0
};

no matter what options I try.

Hmm. And what you would like to have? Anyway, did you try with custom (and define what you would like by yourself)?

Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

rickg22

I think this is the way of initializing C Arrays.

char[25] mychars = {1,2,3,4,5, (etc) }; And that's very different from functions.

Michael

Quote from: rickg22 on January 03, 2006, 08:23:27 PM
I think this is the way of initializing C Arrays.

char[25] mychars = {1,2,3,4,5, (etc) }; And that's very different from functions.

Yes, you are right :). I have tried your array with ANSI style and got:


char[25] mychars =
    {
        1,2,3,4,5
    };


I suppose that this is not what you would like to have.

Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

royalbox

There are two options in the aStyle plugin configuration:

QuoteDon't break complex statements and multiple statements residing in a single line
and
QuoteDon't break one line blocks

which don't seem to do anything.

Let's say you have a class with several methods like this:


        int GetHeight() const {return cy;}
        int GetWidth() const {return cx;}
        int GetX() const {return x;}
        int GetY() const {return y;}

Even with both the above options checked, when you run aStyle you get this:

        int GetHeight() const
        {
            return cy;
        }
        int GetWidth() const
        {
            return cx;
        }
        int GetX() const
        {
            return x;
        }
        int GetY() const
        {
            return y;
        }


What are these options for if not for this?

Many thanks.