Skip to content

Commit a04555d

Browse files
committed
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 <[email protected]>
1 parent 6122e01 commit a04555d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gcc/rust/ast/rust-ast.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum class Kind
4444
UNKNOWN,
4545
MACRO_RULES_DEFINITION,
4646
MACRO_INVOCATION,
47+
IDENTIFIER,
4748
};
4849

4950
// Abstract base class for all AST elements
@@ -1073,6 +1074,8 @@ class IdentifierExpr : public ExprWithoutBlock
10731074
outer_attrs = std::move (new_attrs);
10741075
}
10751076

1077+
Kind get_ast_kind () const override { return Kind::IDENTIFIER; }
1078+
10761079
protected:
10771080
// Clone method implementation
10781081
IdentifierExpr *clone_expr_without_block_impl () const final override

0 commit comments

Comments
 (0)