Skip to content

Commit 14ea8d7

Browse files
authored
Align keywords with c++20 standard for CodeEditor (#3247)
1 parent b8de694 commit 14ea8d7

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

gui/codeeditor.cpp

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,83 @@ Highlighter::Highlighter(QTextDocument *parent,
1515
mKeywordFormat.setForeground(mWidgetStyle->keywordColor);
1616
mKeywordFormat.setFontWeight(mWidgetStyle->keywordWeight);
1717
QStringList keywordPatterns;
18-
keywordPatterns << "bool"
18+
keywordPatterns << "alignas"
19+
<< "alignof"
20+
<< "asm"
21+
<< "auto"
22+
<< "bool"
1923
<< "break"
2024
<< "case"
25+
<< "catch"
2126
<< "char"
27+
<< "char8_­t"
28+
<< "char16_­t"
29+
<< "char32_­t"
2230
<< "class"
31+
<< "concept"
2332
<< "const"
33+
<< "consteval"
34+
<< "constexpr"
35+
<< "constinit"
36+
<< "const_­cast"
2437
<< "continue"
38+
<< "co_­await"
39+
<< "co_­return"
40+
<< "co_­yield"
41+
<< "decltype"
2542
<< "default"
43+
<< "delete"
2644
<< "do"
2745
<< "double"
46+
<< "dynamic_­cast"
2847
<< "else"
2948
<< "enum"
3049
<< "explicit"
50+
<< "export"
51+
<< "extern"
52+
<< "false"
53+
<< "float"
3154
<< "for"
3255
<< "friend"
56+
<< "goto"
3357
<< "if"
3458
<< "inline"
3559
<< "int"
3660
<< "long"
61+
<< "mutable"
3762
<< "namespace"
63+
<< "new"
64+
<< "noexcept"
65+
<< "nullptr"
3866
<< "operator"
3967
<< "private"
4068
<< "protected"
4169
<< "public"
70+
<< "reinterpret_­cast"
71+
<< "requires"
4272
<< "return"
4373
<< "short"
4474
<< "signed"
4575
<< "static"
76+
<< "static_­assert"
77+
<< "static_­cast"
4678
<< "struct"
4779
<< "switch"
4880
<< "template"
81+
<< "this"
82+
<< "thread_­local"
4983
<< "throw"
84+
<< "true"
85+
<< "try"
5086
<< "typedef"
87+
<< "typeid"
5188
<< "typename"
5289
<< "union"
5390
<< "unsigned"
5491
<< "virtual"
5592
<< "void"
5693
<< "volatile"
94+
<< "wchar_­t"
5795
<< "while";
5896
foreach (const QString &pattern, keywordPatterns) {
5997
rule.pattern = QRegularExpression("\\b" + pattern + "\\b");

gui/resultstree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ bool ResultsTree::addErrorItem(const ErrorItem &item)
228228
stditem->setData(QVariant(data));
229229

230230
//Add backtrace files as children
231-
if (item.errorPath.size() > 1U) {
231+
if (item.errorPath.size() > 1) {
232232
for (int i = 0; i < item.errorPath.size(); i++) {
233233
const QErrorPathItem &e = item.errorPath[i];
234234
line.file = e.file;

0 commit comments

Comments
 (0)