diff --git a/include/Interpreter.h b/include/Interpreter.h index c3a3329..9298a99 100644 --- a/include/Interpreter.h +++ b/include/Interpreter.h @@ -60,7 +60,7 @@ class Interpreter { bool checkCompatibility(Token *op, Object left, Object right) { if ((left.type == string_type && right.type == num_type) || - right.type == num_type && left.type == string_type) { + left.type == num_type && right.type == string_type) { return true; } else { return false; diff --git a/main.cpp b/main.cpp index e11f6f0..d082021 100644 --- a/main.cpp +++ b/main.cpp @@ -1,4 +1,3 @@ -#include "AstPrinter.h" #include "Error.h" #include "Interpreter.h" #include "Scanner.h" diff --git a/test/TestInterpreter.cpp b/test/TestInterpreter.cpp index 9529a5d..ea5fce1 100644 --- a/test/TestInterpreter.cpp +++ b/test/TestInterpreter.cpp @@ -65,6 +65,5 @@ TEST(IntrepreterTest, TestStringNumExpressions) { Expr *expression2 = p2.parse(); ASSERT_EQ(Interpreter{}.interpret(expression1), "test8.000000"); - // todo: test not passing ASSERT_EQ(Interpreter{}.interpret(expression2), - // "8.000000test"); + ASSERT_EQ(Interpreter{}.interpret(expression2), "8.000000test"); }