From b2b2fe9c2c404681fb479018b52a07f3133b7d6b Mon Sep 17 00:00:00 2001 From: martin dobrev Date: Thu, 15 Nov 2018 09:39:00 +0200 Subject: Implement byte generation for "for statement" --- 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 b2fb83d..c15458e 100644 --- a/JSImpl/src/main.cpp +++ b/JSImpl/src/main.cpp @@ -67,8 +67,8 @@ void Generate() { IPLVector tokens; //Tokenize("var a = 0; var b = a + 123;a+b;", tokens); - Tokenize("var a; if(a < 4) { a = 8;} else { a = 2} ", tokens); - + /*Tokenize("var a; if(a < 4) { a = 8; if(a < 7) {var b = 4;}} else { a = 2} ", tokens);*/ + Tokenize("var i = 0; for (var j = 0; j < 10; j = j + 1) { i = i + j; }", tokens); std::cout << GenerateByteCode(Parse(tokens)); } -- cgit v1.3.1-23-gd82d