mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Fix custom menu function not being compared case-insensitive
This commit is contained in:
parent
2a6318e3ca
commit
00c866c246
@ -36,7 +36,9 @@ namespace menu
|
||||
std::vector<std::unique_ptr<CommonFunctionDef>> m_functions;
|
||||
std::vector<std::unique_ptr<CommonMenuDef>> m_menus;
|
||||
|
||||
// Function names are case-insensitive, therefore keys are always lowercase
|
||||
std::map<std::string, CommonFunctionDef*> m_functions_by_name;
|
||||
|
||||
std::map<std::string, CommonMenuDef*> m_menus_by_name;
|
||||
|
||||
bool m_in_global_scope;
|
||||
|
@ -34,10 +34,13 @@ namespace menu::function_scope_sequences
|
||||
throw ParsingException(result.NextCapture(CAPTURE_TOKEN).GetPos(), ss.str());
|
||||
}
|
||||
|
||||
const auto existingFunction = state->m_functions_by_name.find(state->m_current_function->m_name);
|
||||
auto lowerCaseName = state->m_current_function->m_name;
|
||||
utils::MakeStringLowerCase(lowerCaseName);
|
||||
|
||||
const auto existingFunction = state->m_functions_by_name.find(lowerCaseName);
|
||||
if (existingFunction == state->m_functions_by_name.end())
|
||||
{
|
||||
state->m_functions_by_name.emplace(std::make_pair(state->m_current_function->m_name, state->m_current_function));
|
||||
state->m_functions_by_name.emplace(std::make_pair(lowerCaseName, state->m_current_function));
|
||||
state->m_current_function = nullptr;
|
||||
}
|
||||
else if (!state->m_current_function->m_value->Equals(existingFunction->second->m_value.get()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user