Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / ASTInterpreter.cpp
diff options
context:
space:
mode:
Commit09e59ae226f2fcb469b944c815b1e1bf46d4c569 (patch)
Author
 ValeriHristov <valeri.dhristov@gmail.com>
2018-11-25 17:49:14 +0200
Committer
 Martin Dobrev <martindobrev0@gmail.com>
2018-11-25 17:49:14 +0200
Filesd8273d7a27cab059957720e06dc19c2c0fd728d1 /JSImpl/src/ASTInterpreter.cpp
IPL-09e59ae226f2fcb469b944c815b1e1bf46d4c569.tar
IPL-09e59ae226f2fcb469b944c815b1e1bf46d4c569.tar.gz
IPL-09e59ae226f2fcb469b944c815b1e1bf46d4c569.zip
Parent2425ccff65421e82dc406125c52b7bf804dcc918 (diff)
Implement comparison operators (#71)
* Implement comparison operators. * Remove debug code. * Undo test code.
1 files changed, 9 insertions, 0 deletions
-rw-r--r--JSImpl/src/ASTInterpreter.cpp9
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;