aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 0ffb03d..2b2ba62 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -14464,12 +14464,17 @@ Parser<ManagedTokenSource>::parse_closure_expr_pratt (const_TokenPtr tok,
if (lexer.peek_token ()->get_id () != COMMA)
{
+ if (lexer.peek_token ()->get_id () == OR)
+ lexer.split_current_token (PIPE, PIPE);
// not an error but means param list is done
break;
}
// skip comma
lexer.skip_token ();
+ if (lexer.peek_token ()->get_id () == OR)
+ lexer.split_current_token (PIPE, PIPE);
+
t = lexer.peek_token ();
}