fix: Unary operators not working correctly in math evaluator

This commit is contained in:
WerWolv
2023-11-16 21:23:58 +01:00
parent 1df8d19399
commit 0bace013a1
2 changed files with 46 additions and 13 deletions

View File

@@ -79,8 +79,10 @@ namespace hex {
Modulus = 0x0C2,
Exponentiation = 0x1D0,
Combine = 0x0E0,
BitwiseNot = 0x0F0,
Not = 0x0F1
BitwiseNot = 0x2F0,
Not = 0x2F1,
Plus = 0x2F2,
Minus = 0x2F3
};
enum class BracketType : std::uint8_t
@@ -104,6 +106,7 @@ namespace hex {
static i16 comparePrecedence(const Operator &a, const Operator &b);
static bool isLeftAssociative(const Operator &op);
static bool isUnary(const Operator &op);
static std::pair<Operator, size_t> toOperator(const std::string &input);
private: