diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-04-04 11:26:51 +0200 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2023-04-05 08:09:09 +0000 |
commit | 28f445767e8dbeb9899319d7b5cc91f1db6e6a7e (patch) | |
tree | 39b23cfd8e4bbda85dd78fe32f00b08a788e7bd7 /gcc | |
parent | 75ec5f4f4879b96afcf6eec70dad81b9c59d4172 (diff) | |
download | gcc-28f445767e8dbeb9899319d7b5cc91f1db6e6a7e.zip gcc-28f445767e8dbeb9899319d7b5cc91f1db6e6a7e.tar.gz gcc-28f445767e8dbeb9899319d7b5cc91f1db6e6a7e.tar.bz2 |
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.cc | 2 |
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 |