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>
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 ());