aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-04-04 11:26:51 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:28:43 +0100
commit1dcc60c25c29a1e35067dc89d1be7fae7d06da5a (patch)
treea1d1c26394aaf0e07321380deb96dbbdb05e134f /gcc
parente2b0bc4a02379b93175d266306ebfa7900a84766 (diff)
downloadgcc-1dcc60c25c29a1e35067dc89d1be7fae7d06da5a.zip
gcc-1dcc60c25c29a1e35067dc89d1be7fae7d06da5a.tar.gz
gcc-1dcc60c25c29a1e35067dc89d1be7fae7d06da5a.tar.bz2
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 <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-ast-tokenstream.cc2
1 files changed, 1 insertions, 1 deletions
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