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:
parent
c09f7bd84b
commit
05872336a9
|
@ -407,7 +407,7 @@ bool ControlDialog::Validate()
|
||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
|
|
||||||
const auto parse_status = control_reference->GetParseStatus();
|
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&)
|
void InputConfigDialog::SetDevice(wxCommandEvent&)
|
||||||
|
|
|
@ -203,7 +203,7 @@ public:
|
||||||
if (tok.type == TOK_EOF)
|
if (tok.type == TOK_EOF)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -373,11 +373,11 @@ public:
|
||||||
{
|
{
|
||||||
ExpressionNode* node;
|
ExpressionNode* node;
|
||||||
ParseStatus status = Toplevel(&node);
|
ParseStatus status = Toplevel(&node);
|
||||||
if (status != ParseStatus::Success)
|
if (status != ParseStatus::Successful)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
*expr_out = new Expression(node);
|
*expr_out = new Expression(node);
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -409,7 +409,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
*expr_out = new ControlExpression(tok.qualifier, device, control);
|
*expr_out = new ControlExpression(tok.qualifier, device, control);
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
}
|
}
|
||||||
case TOK_LPAREN:
|
case TOK_LPAREN:
|
||||||
return Paren(expr_out);
|
return Paren(expr_out);
|
||||||
|
@ -439,7 +439,7 @@ private:
|
||||||
if (status == ParseStatus::SyntaxError)
|
if (status == ParseStatus::SyntaxError)
|
||||||
return status;
|
return status;
|
||||||
*expr_out = new UnaryExpression(tok.type, atom_expr);
|
*expr_out = new UnaryExpression(tok.type, atom_expr);
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Atom(expr_out);
|
return Atom(expr_out);
|
||||||
|
@ -478,7 +478,7 @@ private:
|
||||||
*expr_out = new BinaryExpression(tok.type, *expr_out, unary_expr);
|
*expr_out = new BinaryExpression(tok.type, *expr_out, unary_expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseStatus Paren(ExpressionNode** expr_out)
|
ParseStatus Paren(ExpressionNode** expr_out)
|
||||||
|
@ -486,7 +486,7 @@ private:
|
||||||
ParseStatus status;
|
ParseStatus status;
|
||||||
|
|
||||||
// lparen already chewed
|
// lparen already chewed
|
||||||
if ((status = Toplevel(expr_out)) != ParseStatus::Success)
|
if ((status = Toplevel(expr_out)) != ParseStatus::Successful)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
if (!Expects(TOK_RPAREN))
|
if (!Expects(TOK_RPAREN))
|
||||||
|
@ -495,7 +495,7 @@ private:
|
||||||
return ParseStatus::SyntaxError;
|
return ParseStatus::SyntaxError;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseStatus Toplevel(ExpressionNode** expr_out) { return Binary(expr_out); }
|
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;
|
*expr_out = nullptr;
|
||||||
|
|
||||||
if (str == "")
|
if (str == "")
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
|
|
||||||
Lexer l(str);
|
Lexer l(str);
|
||||||
std::vector<Token> tokens;
|
std::vector<Token> tokens;
|
||||||
status = l.Tokenize(tokens);
|
status = l.Tokenize(tokens);
|
||||||
if (status != ParseStatus::Success)
|
if (status != ParseStatus::Successful)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
Parser p(tokens, finder);
|
Parser p(tokens, finder);
|
||||||
status = p.Parse(&expr);
|
status = p.Parse(&expr);
|
||||||
if (status != ParseStatus::Success)
|
if (status != ParseStatus::Successful)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
*expr_out = expr;
|
*expr_out = expr;
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseStatus ParseExpression(const std::string& str, ControlFinder& finder, Expression** expr_out)
|
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)
|
if (control)
|
||||||
{
|
{
|
||||||
*expr_out = new Expression(new ControlExpression(qualifier, device, control));
|
*expr_out = new Expression(new ControlExpression(qualifier, device, control));
|
||||||
return ParseStatus::Success;
|
return ParseStatus::Successful;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ParseExpressionInner(str, finder, expr_out);
|
return ParseExpressionInner(str, finder, expr_out);
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
|
|
||||||
enum class ParseStatus
|
enum class ParseStatus
|
||||||
{
|
{
|
||||||
Success,
|
Successful,
|
||||||
SyntaxError,
|
SyntaxError,
|
||||||
NoDevice,
|
NoDevice,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue