Skip to content
Permalink
Browse files

Tokenizer: Ensure replacement identifiers are also lowercased

  • Loading branch information...
Kingcom committed Apr 28, 2019
1 parent d7e3ba4 commit b4340ac428b39bcda0a116c7c9db7a1df96d6d03
Showing with 5 additions and 1 deletion.
  1. +5 −1 Parser/Tokenizer.cpp
@@ -146,9 +146,13 @@ void Tokenizer::registerReplacement(const std::wstring& identifier, std::vector<

void Tokenizer::registerReplacement(const std::wstring& identifier, const std::wstring& newValue)
{
// Ensure the new identifier is lower case as it would be as a normally parsed string
std::wstring lowerCase = newValue;
std::transform(lowerCase.begin(), lowerCase.end(), lowerCase.begin(), ::towlower);

Token tok;
tok.type = TokenType::Identifier;
tok.setStringValue(newValue);
tok.setStringValue(lowerCase);
tok.setOriginalText(newValue);

Replacement replacement;

0 comments on commit b4340ac

Please sign in to comment.
You can’t perform that action at this time.