Skip to content

Commit

Permalink
fix: parser behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopodl committed Sep 2, 2024
1 parent 637038b commit 1743b50
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions argon/lang/parser2/parser2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1743b50

Please sign in to comment.