aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-04-11 18:11:09 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2023-04-11 17:03:32 +0000
commitdc5f674759ecea1531e857e35ebccc1d302be7d4 (patch)
treec490c5ada4f9f1cb3ab9c060154556d51f52d53a
parent626dabb43d1d7a788d2370dc13fbafba14de6d8d (diff)
downloadgcc-dc5f674759ecea1531e857e35ebccc1d302be7d4.zip
gcc-dc5f674759ecea1531e857e35ebccc1d302be7d4.tar.gz
gcc-dc5f674759ecea1531e857e35ebccc1d302be7d4.tar.bz2
ast: Fix inner attribute tokenstream
Inner attribute did not output exclamation tokens as there was no way to differentiate inner from outer attributes previously. gcc/rust/ChangeLog: * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix inner attribute tokenstream output. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--gcc/rust/ast/rust-ast-tokenstream.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast-tokenstream.cc b/gcc/rust/ast/rust-ast-tokenstream.cc
index 3e2fdfc..d4e23bf 100644
--- a/gcc/rust/ast/rust-ast-tokenstream.cc
+++ b/gcc/rust/ast/rust-ast-tokenstream.cc
@@ -155,6 +155,8 @@ void
TokenStream::visit (Attribute &attrib)
{
tokens.push_back (Rust::Token::make (HASH, attrib.get_locus ()));
+ if (attrib.is_inner_attribute ())
+ tokens.push_back (Rust::Token::make (EXCLAM, Location ()));
tokens.push_back (Rust::Token::make (LEFT_SQUARE, Location ()));
visit (attrib.get_path ());