Skip to content

Commit ad55a0d

Browse files
committed
chore: Prefer to use Parser::lookat() instead of Parser::LA()
1 parent 80a34cf commit ad55a0d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/parser/cxx/parser.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ auto Parser::parse_simple_capture(LambdaCaptureAST*& yyast) -> bool {
10831083
return true;
10841084
}
10851085

1086-
if (LA().is(TokenKind::T_STAR) && LA(1).is(TokenKind::T_THIS)) {
1086+
if (lookat(TokenKind::T_STAR, TokenKind::T_THIS)) {
10871087
auto ast = new (pool) DerefThisLambdaCaptureAST();
10881088
yyast = ast;
10891089

@@ -2723,7 +2723,7 @@ auto Parser::parse_statement(StatementAST*& yyast) -> bool {
27232723
return false;
27242724
}
27252725
default:
2726-
if (LA().is(TokenKind::T_IDENTIFIER) && LA(1).is(TokenKind::T_COLON)) {
2726+
if (lookat(TokenKind::T_IDENTIFIER, TokenKind::T_COLON)) {
27272727
return parse_labeled_statement(yyast);
27282728
}
27292729

@@ -7698,7 +7698,7 @@ auto Parser::parse_template_type_parameter(DeclarationAST*& yyast) -> bool {
76987698
parse_error("expected a type parameter");
76997699
}
77007700

7701-
if ((LA().is(TokenKind::T_IDENTIFIER) && LA(1).is(TokenKind::T_EQUAL)) ||
7701+
if (lookat(TokenKind::T_IDENTIFIER, TokenKind::T_EQUAL) ||
77027702
LA().is(TokenKind::T_EQUAL)) {
77037703
auto ast = new (pool) TemplateTypeParameterAST();
77047704
yyast = ast;
@@ -7764,7 +7764,7 @@ auto Parser::parse_constraint_type_parameter(DeclarationAST*& yyast) -> bool {
77647764
return false;
77657765
}
77667766

7767-
if ((LA().is(TokenKind::T_IDENTIFIER) && LA(1).is(TokenKind::T_EQUAL)) ||
7767+
if (lookat(TokenKind::T_IDENTIFIER, TokenKind::T_EQUAL) ||
77687768
LA().is(TokenKind::T_EQUAL)) {
77697769
SourceLocation identifierLoc;
77707770

0 commit comments

Comments
 (0)