diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-04-03 18:48:45 +0300 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:34:08 +0100 |
commit | b503080cd219b8f05184f6322d943d1c03f56b08 (patch) | |
tree | 3846fe5d952e9f57ef91e6a315d76189df3f18f4 | |
parent | 635a63c032491f6da2c82d9fdac0b2c8c020d68e (diff) | |
download | gcc-b503080cd219b8f05184f6322d943d1c03f56b08.zip gcc-b503080cd219b8f05184f6322d943d1c03f56b08.tar.gz gcc-b503080cd219b8f05184f6322d943d1c03f56b08.tar.bz2 |
gccrs: ast: Add AST::Kind::IDENTIFIER
...and return it from IdentifierExpr::get_ast_kind (). This enables
other code to dynamically test whether an expression is in fact an
IdentifierExpr.
gcc/rust/ChangeLog:
* ast/rust-ast.h: Add AST::Kind::IDENTIFIER
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 3aed56a..921832e 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -44,6 +44,7 @@ enum class Kind UNKNOWN, MACRO_RULES_DEFINITION, MACRO_INVOCATION, + IDENTIFIER, }; class Visitable @@ -1072,6 +1073,8 @@ public: outer_attrs = std::move (new_attrs); } + Kind get_ast_kind () const override { return Kind::IDENTIFIER; } + protected: // Clone method implementation IdentifierExpr *clone_expr_without_block_impl () const final override |