From 1743b50ce42333318dce852a1ab5aa3c7e44cc72 Mon Sep 17 00:00:00 2001 From: jacopodl Date: Mon, 2 Sep 2024 15:26:33 +0200 Subject: [PATCH] fix: parser behavior --- argon/lang/parser2/parser2.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/argon/lang/parser2/parser2.cpp b/argon/lang/parser2/parser2.cpp index 556db532..0c45f660 100644 --- a/argon/lang/parser2/parser2.cpp +++ b/argon/lang/parser2/parser2.cpp @@ -21,10 +21,12 @@ using namespace argon::lang::parser2::node; #define TKCUR_END this->tkcur_.loc.end bool Parser::CheckIDExt() const { - return this->Match(scanner::TokenType::IDENTIFIER, - scanner::TokenType::KW_DEFAULT, - scanner::TokenType::SELF, - scanner::TokenType::BLANK); + return this->Match( + scanner::TokenType::BLANK, + scanner::TokenType::IDENTIFIER, + scanner::TokenType::KW_DEFAULT, + scanner::TokenType::KW_PANIC, + scanner::TokenType::SELF); } int Parser::PeekPrecedence(TokenType type) { @@ -915,8 +917,8 @@ Node *Parser::ParseOOBCall(Context *context) { this->Eat(true); auto *expr = this->ParseExpression(context, Parser::PeekPrecedence(TokenType::COMMA)); - if(expr == nullptr) - throw ParserException(this->tkcur_.loc,kStandardError[0]); + if (expr == nullptr) + throw ParserException(this->tkcur_.loc, kStandardError[0]); if (expr->node_type != NodeType::CALL) { Release(expr);