diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.cpp b/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.cpp index 2cd7a59bf2..2023debd56 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.cpp @@ -108,7 +108,7 @@ public: return false; } - Token GetControlQualifier() + Token GetFullyQualifiedControl() { ControlQualifier qualifier; std::string value; @@ -126,6 +126,24 @@ public: return Token(TOK_CONTROL, qualifier); } + Token GetBarewordsControl(char c) + { + std::string name; + name += c; + + while (it != expr.end()) { + c = *it; + if (!isalpha(c)) + break; + name += c; + it++; + } + + ControlQualifier qualifier; + qualifier.control_name = name; + return Token(TOK_CONTROL, qualifier); + } + Token NextToken() { if (it == expr.end()) @@ -152,9 +170,12 @@ public: case '+': return Token(TOK_ADD); case '`': - return GetControlQualifier(); + return GetFullyQualifiedControl(); default: - return Token(TOK_INVALID); + if (isalpha(c)) + return GetBarewordsControl(c); + else + return Token(TOK_INVALID); } }