Author Topic: Is astyle supposed to touch comment (/* */)?  (Read 8112 times)

m00

  • Guest
Is astyle supposed to touch comment (/* */)?
« on: December 28, 2005, 07:08:09 pm »
Current, I have comment looks like this.
Code
/*
 * comments....
 * comments....
 * comments....
 */

If I touch astyle and it always will ending up like this by remove the first space.
Code
/*
* 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.
Code
	/*
* comments....
* comments....
* comments....
*/

Offline jimp

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Is astyle supposed to touch comment (/* */)?
« Reply #1 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.

m00

  • Guest
Re: Is astyle supposed to touch comment (/* */)?
« Reply #2 on: December 28, 2005, 10:47:28 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.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Is astyle supposed to touch comment (/* */)?
« Reply #3 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...

m00

  • Guest
Re: Is astyle supposed to touch comment (/* */)?
« Reply #4 on: December 29, 2005, 05:07:39 am »
Okay, thanks, I shall report in AStyle and leave there for anyone that willing to pick up in future.

takeshimiya

  • Guest
Re: Is astyle supposed to touch comment (/* */)?
« Reply #5 on: December 29, 2005, 05:55:11 am »
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.

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Is astyle supposed to touch comment (/* */)?
« Reply #6 on: December 29, 2005, 10:27:09 pm »
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:

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: Is astyle supposed to touch comment (/* */)?
« Reply #7 on: December 29, 2005, 10:39:00 pm »
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.
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

  • Guest
Re: Is astyle supposed to touch comment (/* */)?
« Reply #8 on: January 03, 2006, 04:18:42 pm »
Quote
I'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:

Code
THING thing{0};
becomes:
Code
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.
« Last Edit: January 03, 2006, 04:20:27 pm by royalbox »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Is astyle supposed to touch comment (/* */)?
« Reply #9 on: January 03, 2006, 08:20:16 pm »
Code
THING thing{0};
becomes:
Code
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

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Is astyle supposed to touch comment (/* */)?
« Reply #10 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.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Is astyle supposed to touch comment (/* */)?
« Reply #11 on: January 03, 2006, 08:33:39 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:

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

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

Michael

royalbox

  • Guest
Re: Is astyle supposed to touch comment (/* */)?
« Reply #12 on: January 08, 2006, 02:11:49 pm »
There are two options in the aStyle plugin configuration:

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

which don't seem to do anything.

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

Code
        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:
Code
        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.