Skip to content

Commit 1743b50

Browse files
committed
fix: parser behavior
1 parent 637038b commit 1743b50

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

argon/lang/parser2/parser2.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ using namespace argon::lang::parser2::node;
2121
#define TKCUR_END this->tkcur_.loc.end
2222

2323
bool Parser::CheckIDExt() const {
24-
return this->Match(scanner::TokenType::IDENTIFIER,
25-
scanner::TokenType::KW_DEFAULT,
26-
scanner::TokenType::SELF,
27-
scanner::TokenType::BLANK);
24+
return this->Match(
25+
scanner::TokenType::BLANK,
26+
scanner::TokenType::IDENTIFIER,
27+
scanner::TokenType::KW_DEFAULT,
28+
scanner::TokenType::KW_PANIC,
29+
scanner::TokenType::SELF);
2830
}
2931

3032
int Parser::PeekPrecedence(TokenType type) {
@@ -915,8 +917,8 @@ Node *Parser::ParseOOBCall(Context *context) {
915917
this->Eat(true);
916918

917919
auto *expr = this->ParseExpression(context, Parser::PeekPrecedence(TokenType::COMMA));
918-
if(expr == nullptr)
919-
throw ParserException(this->tkcur_.loc,kStandardError[0]);
920+
if (expr == nullptr)
921+
throw ParserException(this->tkcur_.loc, kStandardError[0]);
920922

921923
if (expr->node_type != NodeType::CALL) {
922924
Release(expr);

0 commit comments

Comments
 (0)