diff options
Diffstat (limited to 'Source/Core/InputCommon/ControlReference/ExpressionParser.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControlReference/ExpressionParser.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp index 00afc5e036..8e9b154bf7 100644 --- a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp +++ b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp @@ -136,6 +136,8 @@ Token Lexer::NextToken() return Token(TOK_GTHAN); case ',': return Token(TOK_COMMA); + case '^': + return Token(TOK_XOR); case '\'': return GetDelimitedLiteral(); case '$': @@ -278,6 +280,12 @@ public: lhs->GetValue(); return rhs->GetValue(); } + case TOK_XOR: + { + const auto lval = lhs->GetValue(); + const auto rval = rhs->GetValue(); + return std::max(std::min(1 - lval, rval), std::min(lval, 1 - rval)); + } default: assert(false); return 0; @@ -621,12 +629,14 @@ private: return 3; case TOK_AND: return 4; - case TOK_OR: + case TOK_XOR: return 5; - case TOK_ASSIGN: + case TOK_OR: return 6; - case TOK_COMMA: + case TOK_ASSIGN: return 7; + case TOK_COMMA: + return 8; default: assert(false); return 0; |
