From 324a3a2edc4367593d77294469260c3dbeb1150e Mon Sep 17 00:00:00 2001 From: chrchr Date: Tue, 26 Sep 2023 14:19:50 +0200 Subject: [PATCH] Use helper function --- lib/token.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/token.cpp b/lib/token.cpp index f047cb456d6..02f2852343c 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -22,6 +22,7 @@ #include "errortypes.h" #include "library.h" #include "settings.h" +#include "simplecpp.h" #include "symboldatabase.h" #include "tokenlist.h" #include "utils.h" @@ -143,7 +144,7 @@ void Token::update_property_info() tokType(eKeyword); else if (mTokType != eVariable && mTokType != eFunction && mTokType != eType && mTokType != eKeyword) tokType(eName); - } else if (std::isdigit((unsigned char)mStr[0]) || (mStr.length() > 1 && mStr[0] == '-' && std::isdigit((unsigned char)mStr[1]))) { + } else if (simplecpp::Token::isNumberLike(mStr)) { if (MathLib::isInt(mStr) || MathLib::isFloat(mStr)) tokType(eNumber); else