public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] ast: Add AST::Kind::IDENTIFIER
@ 2023-04-18 16:45 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-04-18 16:45 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:bfd8e24c2ad0034d2ad0ca59d680d0f9c1250691

commit bfd8e24c2ad0034d2ad0ca59d680d0f9c1250691
Author: Sergey Bugaev <bugaevc@gmail.com>
Date:   Mon Apr 3 18:48:45 2023 +0300

    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>

Diff:
---
 gcc/rust/ast/rust-ast.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index ee3c89a298d..a4db7c7d968 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-18 16:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-18 16:45 [gcc/devel/rust/master] ast: Add AST::Kind::IDENTIFIER Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).