diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-07-31 18:31:51 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:04:33 +0100 |
commit | 5ea74345459e72a8cd5b9ff00d78428893251edd (patch) | |
tree | 54c3393a75110c6b4eeb7270f72f0c24612e20cb /gcc | |
parent | 7c265ce70b5104b6c6ea2ec0efe3b0f47ea0bbb8 (diff) | |
download | gcc-5ea74345459e72a8cd5b9ff00d78428893251edd.zip gcc-5ea74345459e72a8cd5b9ff00d78428893251edd.tar.gz gcc-5ea74345459e72a8cd5b9ff00d78428893251edd.tar.bz2 |
gccrs: Add proc macros abstractions to crate structure
Add multiple setters for a crate object in order to add macro
abstractions previously introduced.
gcc/rust/ChangeLog:
* ast/rust-ast.h (struct Crate): Add proc macro members.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index b78c429..ca11784 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -2026,6 +2026,10 @@ struct Crate NodeId node_id; + std::vector<AttributeProcMacro> attribute_macros; + std::vector<CustomDeriveProcMacro> derive_macros; + std::vector<BangProcMacro> bang_macros; + public: // Constructor Crate (std::vector<std::unique_ptr<Item>> items, @@ -2088,6 +2092,16 @@ public: { items = std::move (new_items); } + + void add_bang_macro (ProcMacro::Bang macro) { bang_macros.push_back (macro); } + void add_attribute_macro (ProcMacro::Attribute macro) + { + attribute_macros.push_back (macro); + } + void add_derive_macro (ProcMacro::CustomDerive macro) + { + derive_macros.push_back (macro); + } }; // Base path expression AST node - abstract |