[gcc r14-7450] gccrs: ast: Fix macros in tokenstreams
Arthur Cohen
cohenarthur@gcc.gnu.org
Tue Jan 16 17:35:48 GMT 2024
https://gcc.gnu.org/g:efb24f60a818a8bec65a6204de9bb7f6866a4539
commit r14-7450-gefb24f60a818a8bec65a6204de9bb7f6866a4539
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Tue Apr 4 18:22:56 2023 +0200
gccrs: ast: Fix macros in tokenstreams
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>
Diff:
---
gcc/rust/ast/rust-ast-tokenstream.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/ast/rust-ast-tokenstream.cc b/gcc/rust/ast/rust-ast-tokenstream.cc
index 42609535bce..2fc7c2b3039 100644
--- a/gcc/rust/ast/rust-ast-tokenstream.cc
+++ b/gcc/rust/ast/rust-ast-tokenstream.cc
@@ -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 ()));
}
More information about the Gcc-cvs
mailing list