From 54268d2903e87145352746a5eb1c7ac8b18935c8 Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Fri, 20 Dec 2024 02:49:47 +0800 Subject: [PATCH] Empty statement in Parser class. --- src/n8/parser/Parser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/n8/parser/Parser.cpp b/src/n8/parser/Parser.cpp index 1ec6a59..7547fbd 100644 --- a/src/n8/parser/Parser.cpp +++ b/src/n8/parser/Parser.cpp @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -1049,9 +1050,12 @@ std::shared_ptr Parser::statement() { return this->stmtUse(); else if(this->isNext("wait", TokenType::KEYWORD)) return this->stmtWait(); + else if(this->isNext(";", TokenType::OPERATOR)) + return std::make_shared( + std::make_shared(this->consume(";")) + ); std::shared_ptr expr = this->expression(); - if(this->isNext(";", TokenType::OPERATOR)) this->consume(";");