diff options
author | Alexey Sakovets <alexeysakovets@gmail.com> | 2021-07-30 23:44:40 +0300 |
---|---|---|
committer | Alexey Sakovets <alexeysakovets@gmail.com> | 2021-07-30 23:44:40 +0300 |
commit | 86a46d7973f204085aec8630eb76e3ed35956a85 (patch) | |
tree | 398f685ebbab25ab50194d3edc4f725e53a7be87 /gcc/rust/parse/rust-parse-impl.h | |
parent | f76ddb42f82c04baf6b14aef1b532ccb5a0425bb (diff) | |
download | gcc-86a46d7973f204085aec8630eb76e3ed35956a85.zip gcc-86a46d7973f204085aec8630eb76e3ed35956a85.tar.gz gcc-86a46d7973f204085aec8630eb76e3ed35956a85.tar.bz2 |
Use correct lookahead to peek after 'while' token when parsing expression with block (parse_expr_with_block).
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 2 |
1 files changed, 1 insertions, 1 deletions
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<ManagedTokenSource>::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)); |