@@ -21,7 +21,7 @@ using namespace argon::lang::parser2::node;
21
21
#define TKCUR_END this ->tkcur_.loc.end
22
22
23
23
bool Parser::CheckIDExt () const {
24
- return this ->Match (scanner::TokenType::IDENTIFIER, scanner::TokenType::SELF);
24
+ return this ->Match (scanner::TokenType::IDENTIFIER, scanner::TokenType::KW_DEFAULT, scanner::TokenType:: SELF);
25
25
}
26
26
27
27
int Parser::PeekPrecedence (TokenType type) {
@@ -332,7 +332,7 @@ Node *Parser::ParseDecls(Context *context) {
332
332
pub = true ;
333
333
334
334
if (!Parser::CheckScopeExt (context, ContextType::MODULE, ContextType::STRUCT, ContextType::TRAIT))
335
- throw ParserException (TKCUR_LOC, " 'pub' modifier not allowed in %s" , kContextName [(int ) context->type ]);
335
+ throw ParserException (TKCUR_LOC, " 'pub' modifier not allowed in %s" , kContextName [(int ) context->type ]);
336
336
}
337
337
338
338
this ->EatNL ();
@@ -1070,8 +1070,7 @@ Node *Parser::ParseStatement(Context *context) {
1070
1070
expr = this ->ParseAssertion (context);
1071
1071
break ;
1072
1072
case TokenType::KW_BREAK:
1073
- if (!Parser::CheckScope (context, ContextType::SWITCH)
1074
- && !Parser::CheckScopeRecursive (context, ContextType::LOOP))
1073
+ if (!Parser::CheckScopeRecursive (context, ContextType::LOOP, ContextType::SWITCH))
1075
1074
throw ParserException (TKCUR_LOC, kStandardError [13 ], " break" , kContextName [(int ) context->type ]);
1076
1075
1077
1076
expr = this ->ParseBCFStatement (context);
0 commit comments