Skip to content

Commit 224ae3c

Browse files
rikardfalkeborndanmar
authored andcommitted
Bump simplecpp (cppcheck-opensource#2297)
1 parent b35091b commit 224ae3c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

externals/simplecpp/simplecpp.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,10 @@ void simplecpp::TokenList::combineOperators()
780780
}
781781
// match: [0-9.]+E [+-] [0-9]+
782782
const char lastChar = tok->str()[tok->str().size() - 1];
783-
if (tok->number && !isHex(tok->str()) && !isOct(tok->str()) && (lastChar == 'E' || lastChar == 'e') && tok->next && tok->next->isOneOf("+-") && tok->next->next && tok->next->next->number) {
783+
if (tok->number && !isOct(tok->str()) &&
784+
((!isHex(tok->str()) && (lastChar == 'E' || lastChar == 'e')) ||
785+
(isHex(tok->str()) && (lastChar == 'P' || lastChar == 'p'))) &&
786+
tok->next && tok->next->isOneOf("+-") && tok->next->next && tok->next->next->number) {
784787
tok->setstr(tok->str() + tok->next->op + tok->next->next->str());
785788
deleteToken(tok->next);
786789
deleteToken(tok->next);

0 commit comments

Comments
 (0)