Style fixes.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-11-08 15:44:58 +01:00
parent 5fb64e12e1
commit bfb47d9b5f
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
3 changed files with 19 additions and 26 deletions

View File

@ -21,20 +21,20 @@ namespace MalachScript {
};
enum class LogicOperator : uint8_t {
LogicalAnd, // &&, and
LogicalOr, // ||, or
LogicalXor, // ^^, xor
LogicalAnd, // &&, and
LogicalOr, // ||, or
LogicalXor, // ^^, xor
};
enum class ComparisonOperator : uint8_t {
Equality, // ==
Inequality, // !=
LessThan, // <
LessThanEquals, // <=
GreaterThan, // >
GreaterThanEquals, // >=
Identity, // is
InverseIdentity, // !is
Equality, // ==
Inequality, // !=
LessThan, // <
LessThanEquals, // <=
GreaterThan, // >
GreaterThanEquals, // >=
Identity, // is
InverseIdentity, // !is
};
enum class MathOperator : uint8_t {
@ -55,15 +55,7 @@ namespace MalachScript {
ArithmeticRightShift,
};
enum class PreOperator : uint8_t {
Negation,
Identity,
Inversion,
Increment,
Decrement,
BitwiseComplement,
Handle
};
enum class PreOperator : uint8_t { Negation, Identity, Inversion, Increment, Decrement, BitwiseComplement, Handle };
}
#endif // MALACHSCRIPT_OPERATORS_HPP

View File

@ -867,7 +867,7 @@ namespace MalachScript::Parser {
return true;
}
bool Parser::ParseExprStat(const ParsedStatement*& out, const LexToken*& currentToken) {
if (!ParseAssign(out, currentToken)){
if (!ParseAssign(out, currentToken)) {
return false;
}
EXPECT_TOKEN(currentToken, SemicolonSymbol);

View File

@ -319,11 +319,12 @@ namespace MalachScript::Parser {
: ParsedStatementImpl(span), _literalValue(literalValue) {}
[[nodiscard]] inline const T& GetLiteralValue() const noexcept { return _literalValue; }
private:
T _literalValue;
};
class ParsedReturnStatement : public ParsedStatementImpl<ParsedStatementKind::Return>{
class ParsedReturnStatement : public ParsedStatementImpl<ParsedStatementKind::Return> {
public:
ParsedReturnStatement(const TextSpan& span, const ParsedStatement* statement)
: ParsedStatementImpl(span), _statement(statement) {}
@ -332,16 +333,16 @@ namespace MalachScript::Parser {
std::unique_ptr<const ParsedStatement> _statement;
};
class ParsedVarAccessStatement : public ParsedStatementImpl<ParsedStatementKind::VarAccess>{
class ParsedVarAccessStatement : public ParsedStatementImpl<ParsedStatementKind::VarAccess> {
public:
ParsedVarAccessStatement(const TextSpan& span, std::vector<Identifier> scope)
ParsedVarAccessStatement(const TextSpan& span, std::vector<Identifier> scope)
: ParsedStatementImpl(span), _scope(std::move(scope)) {}
private:
std::vector<Identifier> _scope;
};
class ParsedIncrementStatement : public ParsedStatementImpl<ParsedStatementKind::Increment>{
class ParsedIncrementStatement : public ParsedStatementImpl<ParsedStatementKind::Increment> {
public:
ParsedIncrementStatement(const TextSpan& span, const ParsedStatement* statement)
: ParsedStatementImpl(span), _statement(statement) {}
@ -350,7 +351,7 @@ namespace MalachScript::Parser {
std::unique_ptr<const ParsedStatement> _statement;
};
class ParsedDecrementStatement : public ParsedStatementImpl<ParsedStatementKind::Decrement>{
class ParsedDecrementStatement : public ParsedStatementImpl<ParsedStatementKind::Decrement> {
public:
ParsedDecrementStatement(const TextSpan& span, const ParsedStatement* statement)
: ParsedStatementImpl(span), _statement(statement) {}