From 86a46d7973f204085aec8630eb76e3ed35956a85 Mon Sep 17 00:00:00 2001 From: Alexey Sakovets Date: Fri, 30 Jul 2021 23:44:40 +0300 Subject: Use correct lookahead to peek after 'while' token when parsing expression with block (parse_expr_with_block). --- gcc/rust/parse/rust-parse-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/rust/parse/rust-parse-impl.h') diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 340fea7..122a3c3 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -7085,7 +7085,7 @@ Parser::parse_expr_with_block (AST::AttrVec outer_attrs) break; case WHILE: { // while or while let, so more lookahead to find out - if (lexer.peek_token ()->get_id () == LET) + if (lexer.peek_token (1)->get_id () == LET) { // while let loop expr expr_parsed = parse_while_let_loop_expr (std::move (outer_attrs)); -- cgit v1.1