Skip to content

Commit

Permalink
astyle 3.4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Nov 9, 2023
1 parent 7b3478d commit 4ad1440
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Instructions for using Artistic Style are included in the *doc* directory.
The file **install.html** contains instructions for compiling and
installing Artistic Style.

The file **astyle.html**' contains information on using Artistic Style.
The file **astyle.html** contains information on using Artistic Style.

The files **news.html** and **notes.html** contain information on changes
made to the various releases.
8 changes: 7 additions & 1 deletion doc/notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@

<h1>Artistic Style Release Notes</h1>

<h3>Artistic Style 3.4.9 (September 2023)</h3>
<h3>Artistic Style 3.4.10 (October 2023)</h3>

<ul>
<li>fixed missing indent in function parameter list (https://gitlab.com/saalen/astyle/-/issues/16)</li>
</ul>

<h3>Artistic Style 3.4.9 (October 2023)</h3>

<ul>
<li>applied one wording for <span style="white-space: nowrap;">Objective-C</span> in the docs</li>
Expand Down
9 changes: 8 additions & 1 deletion src/ASBeautifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ASBeautifier::ASBeautifier()
setPreprocDefineIndent(false);
setPreprocConditionalIndent(false);
setAlignMethodColon(false);
isInAssignment = false;

// initialize ASBeautifier member vectors
beautifierFileType = INVALID_TYPE; // reset to an invalid type
Expand Down Expand Up @@ -209,6 +210,7 @@ ASBeautifier::ASBeautifier(const ASBeautifier& other) : ASBase(other)
caseIndent = other.caseIndent;
squeezeWhitespace = other.squeezeWhitespace;
attemptLambdaIndentation = other.attemptLambdaIndentation;
isInAssignment = other.isInAssignment;
namespaceIndent = other.namespaceIndent;
braceIndent = other.braceIndent;
braceIndentVtk = other.braceIndentVtk;
Expand Down Expand Up @@ -1387,9 +1389,10 @@ void ASBeautifier::registerContinuationIndent(const std::string& line, int i, in
continuationIndentCount = minIndent + spaceIndentCount_;

// this is not done for an in-statement array
int multiplier = isInAssignment ? 1 : 2; // GH16 - no multiply in assignments
if (continuationIndentCount > maxContinuationIndent
&& !(prevNonLegalCh == '=' && currentNonLegalCh == '{'))
continuationIndentCount = indentLength /* * 2*/ + spaceIndentCount_; // GH16
continuationIndentCount = indentLength * multiplier + spaceIndentCount_;

if (!continuationIndentStack->empty()
&& continuationIndentCount < continuationIndentStack->back())
Expand Down Expand Up @@ -3501,6 +3504,8 @@ void ASBeautifier::parseCurrentLine(const std::string& line)
// handle ends of statements
if ((ch == ';' && parenDepth == 0) || ch == '}')
{
isInAssignment = false;

if (ch == '}')
{

Expand Down Expand Up @@ -3866,6 +3871,8 @@ void ASBeautifier::parseCurrentLine(const std::string& line)

else if (foundAssignmentOp != nullptr)
{

isInAssignment = true;
foundPreCommandHeader = false; // clears this for array assignments
foundPreCommandMacro = false;

Expand Down
5 changes: 4 additions & 1 deletion src/astyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#endif

#define ASTYLE_VERSION "3.4.9"
#define ASTYLE_VERSION "3.4.10"

//-----------------------------------------------------------------------------
// astyle namespace
Expand Down Expand Up @@ -561,6 +561,9 @@ class ASBeautifier : protected ASBase
bool shouldIndentPreprocConditional;
bool squeezeWhitespace;
bool attemptLambdaIndentation;

bool isInAssignment;

int indentCount;
int spaceIndentCount;
int spaceIndentObjCMethodAlignment;
Expand Down

0 comments on commit 4ad1440

Please sign in to comment.