mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 08:35:43 +00:00
fix(menus): make functions case insensitive
This commit is contained in:
parent
20af6c4ba5
commit
b8b76adc73
@ -92,6 +92,7 @@ std::unique_ptr<ISimpleExpression> MenuExpressionMatchers::ProcessOperandExtensi
|
|||||||
|
|
||||||
const auto& functionCallToken = result.NextCapture(CAPTURE_FUNCTION_NAME);
|
const auto& functionCallToken = result.NextCapture(CAPTURE_FUNCTION_NAME);
|
||||||
auto functionCallName = functionCallToken.IdentifierValue();
|
auto functionCallName = functionCallToken.IdentifierValue();
|
||||||
|
utils::MakeStringLowerCase(functionCallName);
|
||||||
|
|
||||||
const auto& baseFunctionMap = GetBaseFunctionMapForFeatureLevel(m_state->m_feature_level);
|
const auto& baseFunctionMap = GetBaseFunctionMapForFeatureLevel(m_state->m_feature_level);
|
||||||
const auto foundBaseFunction = baseFunctionMap.find(functionCallName);
|
const auto foundBaseFunction = baseFunctionMap.find(functionCallName);
|
||||||
|
@ -92,12 +92,12 @@ namespace utils
|
|||||||
void MakeStringLowerCase(std::string& str)
|
void MakeStringLowerCase(std::string& str)
|
||||||
{
|
{
|
||||||
for (auto& c : 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)
|
void MakeStringUpperCase(std::string& str)
|
||||||
{
|
{
|
||||||
for (auto& c : str)
|
for (auto& c : str)
|
||||||
c = static_cast<char>(toupper(c));
|
c = static_cast<char>(toupper(static_cast<unsigned char>(c)));
|
||||||
}
|
}
|
||||||
} // namespace utils
|
} // namespace utils
|
||||||
|
Loading…
x
Reference in New Issue
Block a user