From 22341d11fabde7a35fd25f9a772176e533146a7b Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Sat, 2 Oct 2021 14:54:49 +0800 Subject: [PATCH] work save --- RedPandaIDE/parser/cpptokenizer.cpp | 5 +++-- RedPandaIDE/qsynedit/highlighter/cpp.cpp | 5 +++++ RedPandaIDE/qsynedit/highlighter/cpp.h | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/RedPandaIDE/parser/cpptokenizer.cpp b/RedPandaIDE/parser/cpptokenizer.cpp index 85cb986e..9fcfb03c 100644 --- a/RedPandaIDE/parser/cpptokenizer.cpp +++ b/RedPandaIDE/parser/cpptokenizer.cpp @@ -616,8 +616,9 @@ void CppTokenizer::advance() bool CppTokenizer::isLetterChar(const QChar &ch) { - return (ch>= 'A' && ch<='Z') - || (ch>='a' && ch<='z') +// return (ch>= 'A' && ch<='Z') +// || (ch>='a' && ch<='z') + return ch.isLetter() || ch == '_' || ch == '*' || ch == '&' diff --git a/RedPandaIDE/qsynedit/highlighter/cpp.cpp b/RedPandaIDE/qsynedit/highlighter/cpp.cpp index 494b2247..87750889 100644 --- a/RedPandaIDE/qsynedit/highlighter/cpp.cpp +++ b/RedPandaIDE/qsynedit/highlighter/cpp.cpp @@ -1589,3 +1589,8 @@ SynRangeState SynEditCppHighlighter::getRangeState() const { return mRange; } + +bool SynEditCppHighlighter::isIdentChar(const QChar &ch) const +{ + return ch=='_' || ch.isDigit() || ch.isLetter(); +} diff --git a/RedPandaIDE/qsynedit/highlighter/cpp.h b/RedPandaIDE/qsynedit/highlighter/cpp.h index 5f4c73b0..a40c004e 100644 --- a/RedPandaIDE/qsynedit/highlighter/cpp.h +++ b/RedPandaIDE/qsynedit/highlighter/cpp.h @@ -186,6 +186,10 @@ public: // SynHighlighter interface public: SynRangeState getRangeState() const override; + + // SynHighlighter interface +public: + bool isIdentChar(const QChar &ch) const override; }; #endif // SYNEDITCPPHIGHLIGHTER_H