]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: Fix macros in tokenstreams
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 4 Apr 2023 16:22:56 +0000 (18:22 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:28:44 +0000 (18:28 +0100)
A default token was used as a separator, wich resulted in a wrong token
stream.

gcc/rust/ChangeLog:

* ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove
default separator.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-tokenstream.cc

index 42609535bce425041b1775164a38ae435629f161..2fc7c2b3039c28e7d4d2a35dcbe2b58c9005981c 100644 (file)
@@ -2310,7 +2310,10 @@ TokenStream::visit (MacroMatcher &matcher)
 
   tokens.push_back (Rust::Token::make (delimiters.first, Location ()));
 
-  visit_items_joined_by_separator (matcher.get_matches (), {});
+  for (auto &item : matcher.get_matches ())
+    {
+      visit (item);
+    }
 
   tokens.push_back (Rust::Token::make (delimiters.second, Location ()));
 }