summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2016-07-31 17:25:40 +0200
committerGitHub <noreply@github.com>2016-07-31 17:25:40 +0200
commit18a669abcca0a60c3b4d64b7ba634291fa394f6c (patch)
tree4a3b3d8923160645b631ac35ecbd9548b8adbee6 /Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
parentbfa42a3f1561d8ca2e6e5c77c024f40c362843b2 (diff)
parent77fab5940c66685ef8eb3ab033b17f42ef57051b (diff)
Merge pull request #4067 from leoetlino/no-device
InputConfigDiag: Don't prevent closing dialog if device not found
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
index 2960888148..5e4c2375af 100644
--- a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
@@ -401,7 +401,7 @@ private:
if (control == nullptr)
{
*expr_out = new DummyExpression(tok.qualifier);
- return EXPRESSION_PARSE_SUCCESS;
+ return EXPRESSION_PARSE_NO_DEVICE;
}
*expr_out = new ControlExpression(tok.qualifier, device, control);
@@ -427,13 +427,12 @@ private:
ExpressionParseStatus Unary(ExpressionNode** expr_out)
{
- ExpressionParseStatus status;
-
if (IsUnaryExpression(Peek().type))
{
Token tok = Chew();
ExpressionNode* atom_expr;
- if ((status = Atom(&atom_expr)) != EXPRESSION_PARSE_SUCCESS)
+ ExpressionParseStatus status = Atom(&atom_expr);
+ if (status == EXPRESSION_PARSE_SYNTAX_ERROR)
return status;
*expr_out = new UnaryExpression(tok.type, atom_expr);
return EXPRESSION_PARSE_SUCCESS;
@@ -457,16 +456,16 @@ private:
ExpressionParseStatus Binary(ExpressionNode** expr_out)
{
- ExpressionParseStatus status;
-
- if ((status = Unary(expr_out)) != EXPRESSION_PARSE_SUCCESS)
+ ExpressionParseStatus status = Unary(expr_out);
+ if (status == EXPRESSION_PARSE_SYNTAX_ERROR)
return status;
while (IsBinaryToken(Peek().type))
{
Token tok = Chew();
ExpressionNode* unary_expr;
- if ((status = Unary(&unary_expr)) != EXPRESSION_PARSE_SUCCESS)
+ status = Unary(&unary_expr);
+ if (status == EXPRESSION_PARSE_SYNTAX_ERROR)
{
delete *expr_out;
return status;