From 09e59ae226f2fcb469b944c815b1e1bf46d4c569 Mon Sep 17 00:00:00 2001 From: ValeriHristov Date: Sun, 25 Nov 2018 17:49:14 +0200 Subject: Implement comparison operators (#71) * Implement comparison operators. * Remove debug code. * Undo test code. --- JSImpl/src/ASTInterpreter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'JSImpl/src/ASTInterpreter.cpp') diff --git a/JSImpl/src/ASTInterpreter.cpp b/JSImpl/src/ASTInterpreter.cpp index f7d1dc2..25f5c02 100644 --- a/JSImpl/src/ASTInterpreter.cpp +++ b/JSImpl/src/ASTInterpreter.cpp @@ -185,6 +185,15 @@ void ASTInterpreter::Visit(BinaryExpression* e) { case TokenType::Less: m_Evaluation.push_back(left < right); break; + case TokenType::LessEqual: + m_Evaluation.push_back(left <= right); + break; + case TokenType::Greater: + m_Evaluation.push_back(left > right); + break; + case TokenType::GreaterEqual: + m_Evaluation.push_back(left >= right); + break; case TokenType::Comma: m_Evaluation.push_back(right); break; -- cgit v1.3.1-23-gd82d