public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Add AST::TuplePatternItems::TuplePatternItemType to differentiate between them
@ 2022-06-08 12:33 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4eaec8530371eb736717ec02daad6c252332c159

commit 4eaec8530371eb736717ec02daad6c252332c159
Author: Philip Herron <philip.herron@embecosm.com>
Date:   Wed Apr 20 18:03:15 2022 +0100

    Add AST::TuplePatternItems::TuplePatternItemType to differentiate between them

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

diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h
index 62456e89f82..a3193f79584 100644
--- a/gcc/rust/ast/rust-pattern.h
+++ b/gcc/rust/ast/rust-pattern.h
@@ -1135,6 +1135,12 @@ protected:
 class TuplePatternItems
 {
 public:
+  enum TuplePatternItemType
+  {
+    MULTIPLE,
+    RANGED,
+  };
+
   virtual ~TuplePatternItems () {}
 
   // TODO: should this store location data?
@@ -1150,6 +1156,8 @@ public:
 
   virtual void accept_vis (ASTVisitor &vis) = 0;
 
+  virtual TuplePatternItemType get_pattern_type () const = 0;
+
 protected:
   // pure virtual clone implementation
   virtual TuplePatternItems *clone_tuple_pattern_items_impl () const = 0;
@@ -1234,6 +1242,11 @@ public:
     return patterns;
   }
 
+  TuplePatternItemType get_pattern_type () const override
+  {
+    return TuplePatternItemType::MULTIPLE;
+  }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1312,6 +1325,11 @@ public:
     return upper_patterns;
   }
 
+  TuplePatternItemType get_pattern_type () const override
+  {
+    return TuplePatternItemType::RANGED;
+  }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */


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

only message in thread, other threads:[~2022-06-08 12:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:33 [gcc/devel/rust/master] Add AST::TuplePatternItems::TuplePatternItemType to differentiate between them 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).