Bug 138699 - formater messes up space around parenthesis
Summary: formater messes up space around parenthesis
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Astyle (show other bugs)
Version: git master
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-12 02:30 UTC by Andreas Pakulat
Modified: 2007-07-02 13:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pakulat 2006-12-12 02:30:32 UTC
Version:           3.4 SVN, r612104 (using KDE KDE 3.5.5)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Hi,

Having 

if( ( *it ) )

in the code. The formatter makes that

if (( *it ) )

Also

for( something )

gets converted to

for ( something )

My formatting options are:
BlockBreak=false
BlockBreakAll=false
BlockIfElse=false
Brackets=None
BracketsAttach=false
BracketsBreak=false
BracketsCloseHeaders=false
BracketsLinux=false
BracketsNone=true
FStyle=UserDefined
FillConvertTabs=false
FillCount=4
FillEmptyLines=false
FillForce=true
FillForceTabs=false
FillSpaceCount=2
FillSpaces=true
FillTabCount=2
FillTabs=false
IndentBlocks=false
IndentClasses=true
IndentLabels=false
IndentPreprocessors=false
IndentSwitches=true
Options=BlockBreak=0,BlockBreakAll=0,BlockIfElse=0,Brackets=Break,BracketsCloseHeaders=0,FStyle=Use
rDefined,Fill=Spaces,FillCount=4,FillEmptyLines=0,FillForce=1,IndentBlocks=0,IndentBrackets=0,Inden
tCases=1,IndentClasses=1,IndentLabels=1,IndentNamespaces=1,IndentPreprocessors=0,IndentSwitches=0,K
eepBlocks=0,KeepStatements=0,MaxStatement=40,MinConditional=-1,PadOperators=1,PadParenthesesIn=1,Pa
dParenthesesOut=0,PadParenthesesUn=1,
PadOperators=true
PadParentheses=true
PadParenthesesIn=true
PadParenthesesOut=false
PadParenthesesUn=true
Comment 1 Andreas Pakulat 2006-12-12 02:32:16 UTC
And just in case it might matter astyle is version 1.18.
Comment 2 Megan Webb 2006-12-12 07:33:09 UTC
Only the Options=... line is used. The other options are not read any more (and can be deleted)

Kdevelop has the astyle version 1.19 in it. If your using astyle at the commandline there are bug fixes for the 1.19 version that you might want. (or not)

Testing on astyle 1.19 on the commandline: testtt.cpp with the sample above confirms the problem.  The default for commandline astyle is no formatting (check that there isn't an .astylerc file first).

int main(int argc, char *argv[])
{
    if((*it) )
        a = 1;
    for( something);

    return EXIT_SUCCESS;
}

astyle testtt.cpp

Artistic Style 1.19
formatting testtt.cpp

diff testtt.cpp testtt.cpp.orig
33c33
<     if ((*it) )
---
>     if((*it) )
35c35
<     for ( something);
---
>     for( something);


Bug in astyle.
Comment 3 Megan Webb 2007-07-02 13:21:32 UTC
SVN commit 682308 by webb:

Update to Astyle 1.21
Fixes:
BUG: 138699
BUG: 69106




 M  +233 -89   ASBeautifier.cpp  
 M  +44 -45    ASEnhancer.cpp  
 M  +855 -423  ASFormatter.cpp  
 M  +55 -40    ASResource.cpp  
 M  +94 -45    astyle.h