Renamed _isC and _isCPP

This commit is contained in:
Daniel Marjamäki 2018-06-16 16:28:03 +02:00
parent d81fe83ca6
commit 807fbfd318
2 changed files with 15 additions and 15 deletions

View File

@ -40,8 +40,8 @@ static const unsigned int AST_MAX_DEPTH = 50U;
TokenList::TokenList(const Settings* settings) : TokenList::TokenList(const Settings* settings) :
mTokensFrontBack(), mTokensFrontBack(),
mSettings(settings), mSettings(settings),
_isC(false), mIsC(false),
_isCPP(false) mIsCpp(false)
{ {
} }
@ -81,14 +81,14 @@ unsigned int TokenList::appendFileIfNew(const std::string &fileName)
// The "mFiles" vector remembers what files have been tokenized.. // The "mFiles" vector remembers what files have been tokenized..
mFiles.push_back(Path::simplifyPath(fileName)); mFiles.push_back(Path::simplifyPath(fileName));
// Update _isC and _isCPP properties // Update mIsC and mIsCpp properties
if (mFiles.size() == 1) { // Update only useful if first file added to _files if (mFiles.size() == 1) { // Update only useful if first file added to _files
if (!mSettings) { if (!mSettings) {
_isC = Path::isC(getSourceFilePath()); mIsC = Path::isC(getSourceFilePath());
_isCPP = Path::isCPP(getSourceFilePath()); mIsCpp = Path::isCPP(getSourceFilePath());
} else { } else {
_isC = mSettings->enforcedLang == Settings::C || (mSettings->enforcedLang == Settings::None && Path::isC(getSourceFilePath())); mIsC = mSettings->enforcedLang == Settings::C || (mSettings->enforcedLang == Settings::None && Path::isC(getSourceFilePath()));
_isCPP = mSettings->enforcedLang == Settings::CPP || (mSettings->enforcedLang == Settings::None && Path::isCPP(getSourceFilePath())); mIsCpp = mSettings->enforcedLang == Settings::CPP || (mSettings->enforcedLang == Settings::None && Path::isCPP(getSourceFilePath()));
} }
} }
return mFiles.size() - 1U; return mFiles.size() - 1U;
@ -270,14 +270,14 @@ void TokenList::createTokens(const simplecpp::TokenList *tokenList)
else else
mFiles.clear(); mFiles.clear();
_isC = _isCPP = false; mIsC = mIsCpp = false;
if (!mFiles.empty()) { if (!mFiles.empty()) {
_isC = Path::isC(getSourceFilePath()); mIsC = Path::isC(getSourceFilePath());
_isCPP = Path::isCPP(getSourceFilePath()); mIsCpp = Path::isCPP(getSourceFilePath());
} }
if (mSettings && mSettings->enforcedLang != Settings::None) { if (mSettings && mSettings->enforcedLang != Settings::None) {
_isC = (mSettings->enforcedLang == Settings::C); mIsC = (mSettings->enforcedLang == Settings::C);
_isCPP = (mSettings->enforcedLang == Settings::CPP); mIsCpp = (mSettings->enforcedLang == Settings::CPP);
} }
for (const simplecpp::Token *tok = tokenList->cfront(); tok; tok = tok->next) { for (const simplecpp::Token *tok = tokenList->cfront(); tok; tok = tok->next) {

View File

@ -55,12 +55,12 @@ public:
/** Is the code C. Used for bailouts */ /** Is the code C. Used for bailouts */
bool isC() const { bool isC() const {
return _isC; return mIsC;
} }
/** Is the code CPP. Used for bailouts */ /** Is the code CPP. Used for bailouts */
bool isCPP() const { bool isCPP() const {
return _isCPP; return mIsCpp;
} }
/** /**
@ -191,7 +191,7 @@ private:
const Settings* mSettings; const Settings* mSettings;
/** File is known to be C/C++ code */ /** File is known to be C/C++ code */
bool _isC, _isCPP; bool mIsC, mIsCpp;
}; };
/// @} /// @}