Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / main.cpp
diff options
context:
space:
mode:
Commitd51e7e38448e24123af13f0fa2682b861a64f964 (patch)
Author
 martin dobrev <martindobrev0@gmail.com>
2018-11-02 00:12:31 +0200
Committer
 martin dobrev <martindobrev0@gmail.com>
2018-11-02 00:12:31 +0200
Filesff687e7a9aba1f8d53af110afe3e1e079e7b2614 /JSImpl/src/main.cpp
IPL-d51e7e38448e24123af13f0fa2682b861a64f964.tar
IPL-d51e7e38448e24123af13f0fa2682b861a64f964.tar.gz
IPL-d51e7e38448e24123af13f0fa2682b861a64f964.zip
Parent8f90af904002a028d37cbf25a07d81f7984577d1 (diff)
Add many fixes to parser.
Introduce Object Literal and Call expression. Add more test for parser. Little enhance around interpreter.
1 files changed, 2 insertions, 2 deletions
-rw-r--r--JSImpl/src/main.cpp4
diff --git a/JSImpl/src/main.cpp b/JSImpl/src/main.cpp
index 3fe6f99..0d78a10 100644
--- a/JSImpl/src/main.cpp
+++ b/JSImpl/src/main.cpp
@@ -8,7 +8,7 @@ void RunParseCalc()
{
IPLVector<Token> tokens;
//Tokenize("var a = 0; var b = a + 123;a+b;", tokens);
- Tokenize("var s = 0; for (var i = 0; i < 10; ++i + --s) { s };", tokens);
+ Tokenize("var a = 5; if(a == 5){a++;}", tokens);
// TODO make actual test :D
auto expr = Parse(tokens);
@@ -22,7 +22,7 @@ void RunParseCalc()
std::cout << result.back() << std::endl;
result.pop_back();
}
- std::cout << "S = " << i.ModifyVariable("s") << std::endl;
+ std::cout << "S = " << i.ModifyVariable("a") << std::endl;
}
int main()