From d51e7e38448e24123af13f0fa2682b861a64f964 Mon Sep 17 00:00:00 2001 From: martin dobrev Date: Fri, 2 Nov 2018 00:12:31 +0200 Subject: Add many fixes to parser. Introduce Object Literal and Call expression. Add more test for parser. Little enhance around interpreter. --- JSImpl/src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'JSImpl/src/main.cpp') 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 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() -- cgit v1.3.1-23-gd82d