public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] parser: Fix if let parsing
@ 2023-03-05 11:41 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-03-05 11:41 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1f24ea4b3cdd25b019e2f972753a992beaacdd3a

commit 1f24ea4b3cdd25b019e2f972753a992beaacdd3a
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed Mar 1 14:13:01 2023 +0100

    parser: Fix if let parsing
    
    Fix if let parsing in null_notation function. This problem was due to
    the current token already being passed in the function parameters and
    already out of the buffered queue. Hence why the peeked token was let
    and not if.
    
    gcc/rust/ChangeLog:
    
            * parse/rust-parse-impl.h (Parser::null_denotation): Fix if let
            parsing.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Diff:
---
 gcc/rust/parse/rust-parse-impl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 7988d12309d..2cea013ce56 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -13090,7 +13090,7 @@ Parser<ManagedTokenSource>::null_denotation (const_TokenPtr tok,
       return parse_block_expr (std::move (outer_attrs), tok->get_locus ());
     case IF:
       // if or if let, so more lookahead to find out
-      if (lexer.peek_token (1)->get_id () == LET)
+      if (lexer.peek_token ()->get_id () == LET)
 	{
 	  // if let expr
 	  return parse_if_let_expr (std::move (outer_attrs), tok->get_locus ());

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-05 11:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-05 11:41 [gcc/devel/rust/master] parser: Fix if let parsing Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).