aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r--gcc/rust/ast/rust-ast.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index b94c19c..60ea2a5 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -681,12 +681,20 @@ protected:
virtual MetaItemInner *clone_meta_item_inner_impl () const = 0;
public:
+ enum class Kind
+ {
+ LitExpr,
+ MetaItem,
+ };
+
// Unique pointer custom clone function
std::unique_ptr<MetaItemInner> clone_meta_item_inner () const
{
return std::unique_ptr<MetaItemInner> (clone_meta_item_inner_impl ());
}
+ virtual Kind get_kind () = 0;
+
virtual ~MetaItemInner ();
virtual location_t get_locus () const = 0;
@@ -897,6 +905,24 @@ class AttrInputLiteral;
// abstract base meta item class
class MetaItem : public MetaItemInner
{
+public:
+ enum class ItemKind
+ {
+ Path,
+ Word,
+ NameValueStr,
+ PathLit,
+ Seq,
+ ListPaths,
+ ListNameValueStr,
+ };
+
+ MetaItemInner::Kind get_kind () override
+ {
+ return MetaItemInner::Kind::MetaItem;
+ }
+
+ virtual ItemKind get_item_kind () const = 0;
};
// Forward decl - defined in rust-expr.h