Skip to content

Commit

Permalink
added TODOs about Keywords usage
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Feb 24, 2023
1 parent eded740 commit 381fc33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions gui/codeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Highlighter::Highlighter(QTextDocument *parent,
mKeywordFormat.setForeground(mWidgetStyle->keywordColor);
mKeywordFormat.setFontWeight(mWidgetStyle->keywordWeight);
QStringList keywordPatterns;
// TODO: use Keywords::getX()
keywordPatterns << "alignas"
<< "alignof"
<< "asm"
Expand Down
2 changes: 2 additions & 0 deletions lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,7 @@ void SymbolDatabase::createSymbolDatabaseEnums()

void SymbolDatabase::createSymbolDatabaseIncompleteVars()
{
// TODO: replace with Keywords::getX()
static const std::unordered_set<std::string> cpp20keywords = {
"alignas",
"alignof",
Expand Down Expand Up @@ -1477,6 +1478,7 @@ void SymbolDatabase::createSymbolDatabaseIncompleteVars()
// Skip goto labels
if (Token::simpleMatch(tok->previous(), "goto"))
continue;
// TODO: handle all C/C++ standards
if (cppkeywords.count(tok->str()) > 0)
continue;
if (mSettings->standards.cpp >= Standards::CPP20 && cpp20keywords.count(tok->str()) > 0)
Expand Down
1 change: 1 addition & 0 deletions lib/token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ static const std::unordered_set<std::string> controlFlowKeywords = {
"return"
};

// TODO: replace with Keywords::getX()?
// Another list of keywords
static const std::unordered_set<std::string> baseKeywords = {
"asm",
Expand Down

0 comments on commit 381fc33

Please sign in to comment.