ExpressionParser: Rename ParseStatus' Success member to Successful

This clashes with X11's preprocessor define named Success (because using
non-prefixed lowercase identifiers in C was apparently a fantastic idea
at some point), causing compilation errors.
This commit is contained in:
Lioncash 2017-04-02 06:13:12 -04:00
parent c09f7bd84b
commit 05872336a9
3 changed files with 15 additions and 15 deletions

View File

@ -407,7 +407,7 @@ bool ControlDialog::Validate()
UpdateGUI();
const auto parse_status = control_reference->GetParseStatus();
return parse_status == ParseStatus::Success || parse_status == ParseStatus::NoDevice;
return parse_status == ParseStatus::Successful || parse_status == ParseStatus::NoDevice;
}
void InputConfigDialog::SetDevice(wxCommandEvent&)

View File

@ -203,7 +203,7 @@ public:
if (tok.type == TOK_EOF)
break;
}
return ParseStatus::Success;
return ParseStatus::Successful;
}
};
@ -373,11 +373,11 @@ public:
{
ExpressionNode* node;
ParseStatus status = Toplevel(&node);
if (status != ParseStatus::Success)
if (status != ParseStatus::Successful)
return status;
*expr_out = new Expression(node);
return ParseStatus::Success;
return ParseStatus::Successful;
}
private:
@ -409,7 +409,7 @@ private:
}
*expr_out = new ControlExpression(tok.qualifier, device, control);
return ParseStatus::Success;
return ParseStatus::Successful;
}
case TOK_LPAREN:
return Paren(expr_out);
@ -439,7 +439,7 @@ private:
if (status == ParseStatus::SyntaxError)
return status;
*expr_out = new UnaryExpression(tok.type, atom_expr);
return ParseStatus::Success;
return ParseStatus::Successful;
}
return Atom(expr_out);
@ -478,7 +478,7 @@ private:
*expr_out = new BinaryExpression(tok.type, *expr_out, unary_expr);
}
return ParseStatus::Success;
return ParseStatus::Successful;
}
ParseStatus Paren(ExpressionNode** expr_out)
@ -486,7 +486,7 @@ private:
ParseStatus status;
// lparen already chewed
if ((status = Toplevel(expr_out)) != ParseStatus::Success)
if ((status = Toplevel(expr_out)) != ParseStatus::Successful)
return status;
if (!Expects(TOK_RPAREN))
@ -495,7 +495,7 @@ private:
return ParseStatus::SyntaxError;
}
return ParseStatus::Success;
return ParseStatus::Successful;
}
ParseStatus Toplevel(ExpressionNode** expr_out) { return Binary(expr_out); }
@ -530,21 +530,21 @@ static ParseStatus ParseExpressionInner(const std::string& str, ControlFinder& f
*expr_out = nullptr;
if (str == "")
return ParseStatus::Success;
return ParseStatus::Successful;
Lexer l(str);
std::vector<Token> tokens;
status = l.Tokenize(tokens);
if (status != ParseStatus::Success)
if (status != ParseStatus::Successful)
return status;
Parser p(tokens, finder);
status = p.Parse(&expr);
if (status != ParseStatus::Success)
if (status != ParseStatus::Successful)
return status;
*expr_out = expr;
return ParseStatus::Success;
return ParseStatus::Successful;
}
ParseStatus ParseExpression(const std::string& str, ControlFinder& finder, Expression** expr_out)
@ -561,7 +561,7 @@ ParseStatus ParseExpression(const std::string& str, ControlFinder& finder, Expre
if (control)
{
*expr_out = new Expression(new ControlExpression(qualifier, device, control));
return ParseStatus::Success;
return ParseStatus::Successful;
}
return ParseExpressionInner(str, finder, expr_out);

View File

@ -61,7 +61,7 @@ public:
enum class ParseStatus
{
Success,
Successful,
SyntaxError,
NoDevice,
};