diff --git a/tessesscriptengine.hpp b/tessesscriptengine.hpp index 0ef4ace..b0dae90 100644 --- a/tessesscriptengine.hpp +++ b/tessesscriptengine.hpp @@ -1886,24 +1886,7 @@ namespace Tesses::WebServer::ScriptEngine } }; - class EachNode : public Node { - public: - Node* item; - Node* list; - Node* body; - EachNode(Node* item,Node* list,Node* body) - { - this->item = item; - this->list = list; - this->body = body; - } - ~EachNode() - { - delete item; - delete list; - delete body; - } - }; + class FunctionDeclarationNode : public Node { public: @@ -2954,26 +2937,7 @@ namespace Tesses::WebServer::ScriptEngine NextTokenIs(";"); return new WhileNode(cond,body,true); } - if(NextTokenIs("each")) - { - Ensure("("); - Node* list = ParseExpression(); - Node* item = nullptr; - - if(NextTokenIs(":")) - { - item = list; - list = ParseExpression(); - } - else - { - item = new GetVariableExpression("item"); - } - Ensure(")"); - Node* body = ParseNode(); - NextTokenIs(";"); - return new EachNode(item,list,body); - } + if(NextTokenIs("func")) { Node* fn = ParseExpression(); @@ -3377,7 +3341,6 @@ namespace Tesses::WebServer::ScriptEngine auto whileNode = dynamic_cast(n); auto breakNode = dynamic_cast(n); auto cont = dynamic_cast(n); - auto eachLoop = dynamic_cast(n); auto forLoop = dynamic_cast(n); auto lOr = dynamic_cast(n); auto lAnd = dynamic_cast(n);