diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-04-11 18:11:09 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:28:46 +0100 |
commit | 5444ed27a8139d5d584859321a88cadaafdb1cb0 (patch) | |
tree | 45db40a7dfe83e16e660d7dc401053478066de71 /gcc | |
parent | cd773704975f399a8c736a84509dfe2e106412a7 (diff) | |
download | gcc-5444ed27a8139d5d584859321a88cadaafdb1cb0.zip gcc-5444ed27a8139d5d584859321a88cadaafdb1cb0.tar.gz gcc-5444ed27a8139d5d584859321a88cadaafdb1cb0.tar.bz2 |
gccrs: 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>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-ast-tokenstream.cc | 2 |
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 ()); |