Skip to content

Commit

Permalink
Undo
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Apr 12, 2024
1 parent d0a132e commit 7eeecdf
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static bool isClassStructUnionEnumStart(const Token * tok)

//---------------------------------------------------------------------------

Tokenizer::Tokenizer(const Settings &settings, ErrorLogger &errorLogger, const Preprocessor* preprocessor) :
Tokenizer::Tokenizer(const Settings &settings, ErrorLogger &errorLogger) :
list(&settings),
mSettings(settings),
mErrorLogger(errorLogger),
Expand Down Expand Up @@ -1738,7 +1738,7 @@ void Tokenizer::simplifyTypedefCpp()
}
++scope;
}
if (Token::Match(tok2->tokAt(-3), "enum class %name%"))
if (Token::Match(tok2->tokAt(-3), "enum class %name%")) // TODO: handle types
inEnumClass = true;
if (tok2->strAt(-1) == "enum" || Token::Match(tok2->tokAt(-2), "enum %name%"))
inEnum = true;
Expand Down Expand Up @@ -3302,10 +3302,8 @@ bool Tokenizer::simplifyUsing()
tok2->insertToken("0");
after = tok2->next();
}
else { // just replace simple type aliases
const bool skipElaboratedType = Token::simpleMatch(tok1->next(), "::") && Token::Match(start, "class|struct|union|enum");
Token* copyStart = skipElaboratedType ? start->next() : start;
TokenList::copyTokens(tok1, copyStart, usingEnd->previous());
else { // just replace simple type aliases
TokenList::copyTokens(tok1, start, usingEnd->previous());
tok1->deleteThis();
}
substitute = true;
Expand Down Expand Up @@ -3359,7 +3357,7 @@ void Tokenizer::simplifyUsingError(const Token* usingStart, const Token* usingEn
str += " ;";
std::list<const Token *> callstack(1, usingStart);
mErrorLogger.reportErr(ErrorMessage(callstack, &list, Severity::debug, "simplifyUsing",
"Failed to parse \'" + str + "\'. The checking continues anyway.", Certainty::normal));
"Failed to parse \'" + str + "\'. The checking continues anyway.", Certainty::normal));
}
}

Expand Down Expand Up @@ -5920,7 +5918,7 @@ void Tokenizer::dump(std::ostream &out) const

outs += " <directivelist>";
outs += '\n';
for (const Directive& dir : mDirectives) {
for (const Directive &dir : mDirectives) {
outs += " <directive ";
outs += "file=\"";
outs += ErrorLogger::toxml(Path::getRelativePath(dir.file, mSettings.basePaths));
Expand All @@ -5932,7 +5930,7 @@ void Tokenizer::dump(std::ostream &out) const
// could result in invalid XML, so run it through toxml().
outs += "str=\"";
outs += ErrorLogger::toxml(dir.str);
outs += "\"/>";
outs +="\"/>";
outs += '\n';
}
outs += " </directivelist>";
Expand Down

0 comments on commit 7eeecdf

Please sign in to comment.