]> gcc.gnu.org Git - gcc.git/commitdiff
Use correct lookahead to peek after 'while' token when parsing expression with block...
authorAlexey Sakovets <alexeysakovets@gmail.com>
Fri, 30 Jul 2021 20:44:40 +0000 (23:44 +0300)
committerAlexey Sakovets <alexeysakovets@gmail.com>
Fri, 30 Jul 2021 20:44:40 +0000 (23:44 +0300)
gcc/rust/parse/rust-parse-impl.h

index 340fea7020171d081f27ea138d70dcdb6c44c589..122a3c361b0ed9c1860210c507076b34a044b66e 100644 (file)
@@ -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));
This page took 0.066644 seconds and 5 git commands to generate.