From 1dcc60c25c29a1e35067dc89d1be7fae7d06da5a Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Tue, 4 Apr 2023 11:26:51 +0200 Subject: gccrs: ast: Fix match case comma output Even though the comma may be optional with blocks of expressions, it is mandatory for a single expression alone. By changing this behavior we ensure a working behavior with any kind of expressions. gcc/rust/ChangeLog: * ast/rust-ast-tokenstream.cc (TokenStream::visit): Make comma mandatory. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-tokenstream.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/rust/ast/rust-ast-tokenstream.cc b/gcc/rust/ast/rust-ast-tokenstream.cc index b947309..b248aee 100644 --- a/gcc/rust/ast/rust-ast-tokenstream.cc +++ b/gcc/rust/ast/rust-ast-tokenstream.cc @@ -1509,7 +1509,7 @@ TokenStream::visit (MatchCase &match_case) visit (match_case.get_arm ()); tokens.push_back (Rust::Token::make (MATCH_ARROW, Location ())); visit (match_case.get_expr ()); - trailing_comma (); + tokens.push_back (Rust::Token::make (COMMA, Location ())); } void -- cgit v1.1