diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2018-12-30 16:11:42 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2019-10-11 17:14:45 -0500 |
| commit | 718efce1dce86e18fb42c319627b5490cd1f8d94 (patch) | |
| tree | 015199d7a5d0ffb1be6e4d8104a2316e39f4f792 /Source/Core/InputCommon/ControlReference/ExpressionParser.cpp | |
| parent | 35e51ebbaa025bad87deb4668e0b32249dd62d77 (diff) | |
ExpressionParser: Add less-than and greater-than operators.
Diffstat (limited to 'Source/Core/InputCommon/ControlReference/ExpressionParser.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControlReference/ExpressionParser.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp index f375c465d7..7a114e95a0 100644 --- a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp +++ b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp @@ -36,6 +36,8 @@ enum TokenType TOK_DIV, TOK_MOD, TOK_ASSIGN, + TOK_LTHAN, + TOK_GTHAN, TOK_CONTROL, TOK_LITERAL, TOK_VARIABLE, @@ -61,6 +63,10 @@ inline std::string OpName(TokenType op) return "Mod"; case TOK_ASSIGN: return "Assign"; + case TOK_LTHAN: + return "LThan"; + case TOK_GTHAN: + return "GThan"; case TOK_VARIABLE: return "Var"; default: @@ -105,6 +111,10 @@ public: return "%"; case TOK_ASSIGN: return "="; + case TOK_LTHAN: + return "<"; + case TOK_GTHAN: + return ">"; case TOK_CONTROL: return "Device(" + data + ")"; case TOK_LITERAL: @@ -226,6 +236,10 @@ public: return Token(TOK_MOD); case '=': return Token(TOK_ASSIGN); + case '<': + return Token(TOK_LTHAN); + case '>': + return Token(TOK_GTHAN); case '\'': return GetLiteral(); case '$': @@ -348,6 +362,10 @@ public: // TODO: Should this instead GetValue(lhs) ? return rhsValue; } + case TOK_LTHAN: + return lhsValue < rhsValue; + case TOK_GTHAN: + return lhsValue > rhsValue; default: assert(false); return 0; @@ -733,6 +751,8 @@ private: case TOK_DIV: case TOK_MOD: case TOK_ASSIGN: + case TOK_LTHAN: + case TOK_GTHAN: return true; default: return false; |
