Skip to content

Commit

Permalink
Merge pull request Laupetin#53 from diamante0018/main
Browse files Browse the repository at this point in the history
fix(menus): make functions case insensitive
  • Loading branch information
Laupetin authored Dec 10, 2023
2 parents 20af6c4 + b8b76ad commit 2a6318e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ std::unique_ptr<ISimpleExpression> MenuExpressionMatchers::ProcessOperandExtensi

const auto& functionCallToken = result.NextCapture(CAPTURE_FUNCTION_NAME);
auto functionCallName = functionCallToken.IdentifierValue();
utils::MakeStringLowerCase(functionCallName);

const auto& baseFunctionMap = GetBaseFunctionMapForFeatureLevel(m_state->m_feature_level);
const auto foundBaseFunction = baseFunctionMap.find(functionCallName);
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/Utils/StringUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ namespace utils
void MakeStringLowerCase(std::string& str)
{
for (auto& c : str)
c = static_cast<char>(tolower(c));
c = static_cast<char>(tolower(static_cast<unsigned char>(c)));
}

void MakeStringUpperCase(std::string& str)
{
for (auto& c : str)
c = static_cast<char>(toupper(c));
c = static_cast<char>(toupper(static_cast<unsigned char>(c)));
}
} // namespace utils

0 comments on commit 2a6318e

Please sign in to comment.