Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / main.cpp
diff options
context:
space:
mode:
Commit560a585091f1948efb47d58c82dede281ebef54d (patch)
Author
 martin dobrev <martindobrev0@gmail.com>
2018-09-07 19:00:01 +0300
Committer
 martin dobrev <martindobrev0@gmail.com>
2018-09-07 19:00:01 +0300
Filese62ac68d4fe03881be70b7ce6f400fb0a63060a9 /JSImpl/src/main.cpp
IPL-560a585091f1948efb47d58c82dede281ebef54d.tar
IPL-560a585091f1948efb47d58c82dede281ebef54d.tar.gz
IPL-560a585091f1948efb47d58c82dede281ebef54d.zip
Parent23067c0e3a92d452c1f8f3519c64d970a27732e3 (diff)
Introduce Parser and Expression hierarchy.
1 files changed, 11 insertions, 0 deletions
-rw-r--r--JSImpl/src/main.cpp11
diff --git a/JSImpl/src/main.cpp b/JSImpl/src/main.cpp
index 1b345c3..43c063d 100644
--- a/JSImpl/src/main.cpp
+++ b/JSImpl/src/main.cpp
@@ -1,7 +1,10 @@
#include "Lexer.h"
+#include "Parser.h"
#include <iostream>
#define LOG(msg) std::cout << msg << std::endl
#define EXECUTE_TEST(test) std::cout << #test << " "; test();
+
+// Lexer Tests
void TestLess()
{
auto tokens = Tokenize("<");
@@ -70,6 +73,13 @@ void TestVariableDeclaration()
LOG("FAIL");
}
}
+// Parser Tests
+void TestParseUnaryExpr()
+{
+ // TODO make actual test :D
+ auto expr = Parse(Tokenize("-10"));
+ expr->Print(std::cout);
+}
int main()
{
@@ -78,6 +88,7 @@ int main()
EXECUTE_TEST(TestString);
EXECUTE_TEST(TestKeyWord);
EXECUTE_TEST(TestVariableDeclaration);
+ EXECUTE_TEST(TestParseUnaryExpr);
std::system("pause");
return 0;
} \ No newline at end of file