diff --git a/src/parser/Parser.cpp b/src/parser/Parser.cpp index 1f695f2..03d6205 100644 --- a/src/parser/Parser.cpp +++ b/src/parser/Parser.cpp @@ -873,7 +873,7 @@ std::unique_ptr Parser::stmtTest() { std::unique_ptr Parser::stmtVal() { std::string nativePath = ""; - this->consume("val"); + Token address = this->consume("val"); if(this->isNext("(", TokenType::OPERATOR)) { this->consume("("); @@ -882,21 +882,29 @@ std::unique_ptr Parser::stmtVal() { this->consume(")"); } - std::unique_ptr value; - Token address = this->consume(TokenType::IDENTIFIER); + std::map> declarations; + while(!this->isNext(";", TokenType::OPERATOR)) { + if(!declarations.empty()) + this->consume(","); + + std::unique_ptr value; + Token variable = this->consume(TokenType::IDENTIFIER); - if(nativePath == "") { - this->consume("="); - value = this->expression(); + if(nativePath == "") { + this->consume("="); + value = this->expression(); + } + else value = std::make_unique( + std::make_unique(variable) + ); + + declarations.insert({variable, std::move(value)}); } - else value = std::make_unique( - std::make_unique(address) - ); this->consume(";"); return std::make_unique( std::make_unique(address), - std::move(value), + std::move(declarations), nativePath ); }