Remove unneeded firstLineChar member in ASBeautifier

This commit is contained in:
Peter Vingelmann 2016-09-21 21:09:58 +02:00
parent a3ccecfa4a
commit 063a8b06b6
2 changed files with 5 additions and 7 deletions

View File

@ -254,7 +254,6 @@ ASBeautifier::ASBeautifier(const ASBeautifier& other) : ASBase(other)
currentNonSpaceCh = other.currentNonSpaceCh; currentNonSpaceCh = other.currentNonSpaceCh;
currentNonLegalCh = other.currentNonLegalCh; currentNonLegalCh = other.currentNonLegalCh;
prevNonLegalCh = other.prevNonLegalCh; prevNonLegalCh = other.prevNonLegalCh;
lineFirstChar = other.lineFirstChar;
} }
/** /**
@ -370,7 +369,6 @@ void ASBeautifier::init(ASSourceIterator* iter)
prevNonLegalCh = '{'; prevNonLegalCh = '{';
currentNonLegalCh = '{'; currentNonLegalCh = '{';
quoteChar = ' '; quoteChar = ' ';
lineFirstChar = ' ';
probationHeader = NULL; probationHeader = NULL;
lastLineHeader = NULL; lastLineHeader = NULL;
backslashEndsPrevLine = false; backslashEndsPrevLine = false;
@ -885,7 +883,6 @@ string ASBeautifier::beautify(const string& originalLine)
haveLineContinuationChar = false; haveLineContinuationChar = false;
lineOpeningBlocksNum = 0; lineOpeningBlocksNum = 0;
lineClosingBlocksNum = 0; lineClosingBlocksNum = 0;
lineFirstChar = ' ';
if (isImmediatelyPostObjCMethodDefinition) if (isImmediatelyPostObjCMethodDefinition)
clearObjCMethodDefinitionAlignment(); clearObjCMethodDefinitionAlignment();
@ -927,7 +924,6 @@ string ASBeautifier::beautify(const string& originalLine)
line = trim(originalLine); line = trim(originalLine);
if (line.length() > 0) if (line.length() > 0)
{ {
lineFirstChar = line[0];
if (line[0] == '{') if (line[0] == '{')
lineBeginsWithOpenBracket = true; lineBeginsWithOpenBracket = true;
else if (line[0] == '}') else if (line[0] == '}')
@ -2599,7 +2595,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
// < // <
// class Argument // class Argument
// > // >
if (lineFirstChar == '>' && !lineStartsInComment) if (line[0] == '>')
{ {
if (!inStatementIndentStack->empty()) if (!inStatementIndentStack->empty())
spaceIndentCount = inStatementIndentStack->back(); spaceIndentCount = inStatementIndentStack->back();
@ -2649,7 +2645,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
// Argument1, // Argument1,
// Argument2 // Argument2
// > // >
if (lineFirstChar == '>' && !lineStartsInComment) if (line[0] == '>')
{ {
if (!inStatementIndentStack->empty()) if (!inStatementIndentStack->empty())
spaceIndentCount = inStatementIndentStack->back(); spaceIndentCount = inStatementIndentStack->back();

View File

@ -279,6 +279,7 @@ protected: // functions definitions are at the end of ASResource.cpp
bool isCharPotentialOperator(char ch) const; bool isCharPotentialOperator(char ch) const;
bool isDigitSeparator(const string& line, int i) const; bool isDigitSeparator(const string& line, int i) const;
char peekNextChar(const string& line, int i) const; char peekNextChar(const string& line, int i) const;
}; // Class ASBase }; // Class ASBase
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -518,7 +519,6 @@ private: // variables
char currentNonSpaceCh; char currentNonSpaceCh;
char currentNonLegalCh; char currentNonLegalCh;
char prevNonLegalCh; char prevNonLegalCh;
char lineFirstChar;
}; // Class ASBeautifier }; // Class ASBeautifier
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -593,6 +593,7 @@ private:
// SQL variables // SQL variables
bool nextLineIsDeclareIndent; // begin declare section indent is reached bool nextLineIsDeclareIndent; // begin declare section indent is reached
bool isInDeclareSection; // need to indent a declare section bool isInDeclareSection; // need to indent a declare section
}; // Class ASEnhancer }; // Class ASEnhancer
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -988,6 +989,7 @@ private: // inline functions
// sort comparison functions for ASResource // sort comparison functions for ASResource
bool sortOnLength(const string* a, const string* b); bool sortOnLength(const string* a, const string* b);
bool sortOnName(const string* a, const string* b); bool sortOnName(const string* a, const string* b);
} // end of astyle namespace } // end of astyle namespace
// end of astyle namespace -------------------------------------------------- // end of astyle namespace --------------------------------------------------