From 989f1a892db29d70c8085ffa768e96a816ecea81 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 3 Mar 2023 18:11:06 +0800 Subject: [PATCH] - fix: Hex float point literal is not correctly colored. --- NEWS.md | 1 + libs/qsynedit/qsynedit/syntaxer/cpp.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 83380a2c..bdb4d2c7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,6 +19,7 @@ Red Panda C++ Version 2.16 - enhancement: Switch current call stack frame in the CPU info dialog - fix: Shouldn't try evaluate value of the selection in the cpu info dialog. - enhancement: Show oct/bin/bin value in the memory view's tooltip. + - fix: Hex float point literal is not correctly colored. Red Panda C++ Version 2.15 diff --git a/libs/qsynedit/qsynedit/syntaxer/cpp.cpp b/libs/qsynedit/qsynedit/syntaxer/cpp.cpp index e1f86cfd..4ee426bd 100644 --- a/libs/qsynedit/qsynedit/syntaxer/cpp.cpp +++ b/libs/qsynedit/qsynedit/syntaxer/cpp.cpp @@ -686,7 +686,7 @@ void CppSyntaxer::numberProc() } break; case '.': - if (mTokenId != TokenId::Hex && mTokenId != TokenId::Octal) { + if (mTokenId != TokenId::Octal) { mTokenId = TokenId::Float; } else { mTokenId = TokenId::Unknown; @@ -724,13 +724,10 @@ void CppSyntaxer::numberProc() break; case 'p': case 'P': - if (mTokenId!=TokenId::Hex) { - mTokenId = TokenId::Float; + mTokenId = TokenId::Float; + mRun++; + if (mRun < mLineSize && (mLine[mRun]== '+' || mLine[mRun]== '-')) // number = float, but no exponent. an arithmetic operator mRun++; - if (mRun < mLineSize && (mLine[mRun]== '+' || mLine[mRun]== '-')) // number = float, but no exponent. an arithmetic operator - mRun++; - break; - } break; default: return;