Align keywords with c++20 standard for CodeEditor (#3247)

This commit is contained in:
Maksim Derbasov 2021-05-05 08:35:13 +03:00 committed by GitHub
parent b8de69489d
commit 14ea8d7e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 2 deletions

View File

@ -15,45 +15,83 @@ Highlighter::Highlighter(QTextDocument *parent,
mKeywordFormat.setForeground(mWidgetStyle->keywordColor);
mKeywordFormat.setFontWeight(mWidgetStyle->keywordWeight);
QStringList keywordPatterns;
keywordPatterns << "bool"
keywordPatterns << "alignas"
<< "alignof"
<< "asm"
<< "auto"
<< "bool"
<< "break"
<< "case"
<< "catch"
<< "char"
<< "char8_­t"
<< "char16_­t"
<< "char32_­t"
<< "class"
<< "concept"
<< "const"
<< "consteval"
<< "constexpr"
<< "constinit"
<< "const_­cast"
<< "continue"
<< "co_­await"
<< "co_­return"
<< "co_­yield"
<< "decltype"
<< "default"
<< "delete"
<< "do"
<< "double"
<< "dynamic_­cast"
<< "else"
<< "enum"
<< "explicit"
<< "export"
<< "extern"
<< "false"
<< "float"
<< "for"
<< "friend"
<< "goto"
<< "if"
<< "inline"
<< "int"
<< "long"
<< "mutable"
<< "namespace"
<< "new"
<< "noexcept"
<< "nullptr"
<< "operator"
<< "private"
<< "protected"
<< "public"
<< "reinterpret_­cast"
<< "requires"
<< "return"
<< "short"
<< "signed"
<< "static"
<< "static_­assert"
<< "static_­cast"
<< "struct"
<< "switch"
<< "template"
<< "this"
<< "thread_­local"
<< "throw"
<< "true"
<< "try"
<< "typedef"
<< "typeid"
<< "typename"
<< "union"
<< "unsigned"
<< "virtual"
<< "void"
<< "volatile"
<< "wchar_­t"
<< "while";
foreach (const QString &pattern, keywordPatterns) {
rule.pattern = QRegularExpression("\\b" + pattern + "\\b");

View File

@ -228,7 +228,7 @@ bool ResultsTree::addErrorItem(const ErrorItem &item)
stditem->setData(QVariant(data));
//Add backtrace files as children
if (item.errorPath.size() > 1U) {
if (item.errorPath.size() > 1) {
for (int i = 0; i < item.errorPath.size(); i++) {
const QErrorPathItem &e = item.errorPath[i];
line.file = e.file;