public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] libproc_macro: Move Delimiter type to group module
@ 2023-04-06 21:30 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-04-06 21:30 UTC (permalink / raw)
  To: gcc-cvs

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

commit e59c6f19aa7c4b6d7090d7af23fb407c2fc397ef
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Mon Feb 13 14:24:37 2023 +0100

    libproc_macro: Move Delimiter type to group module
    
    The Delimiter rust type is inherently tied to the Group type in the
    group module.
    
    ChangeLog:
    
            * librust/proc_macro/rust/group.rs: Add Delimiter type.
            * librust/proc_macro/rust/lib.rs: Remove Delimiter type.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Diff:
---
 librust/proc_macro/rust/group.rs | 14 +++++++++++++-
 librust/proc_macro/rust/lib.rs   | 15 +--------------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/librust/proc_macro/rust/group.rs b/librust/proc_macro/rust/group.rs
index 0434d6c1206..e0e3de98452 100644
--- a/librust/proc_macro/rust/group.rs
+++ b/librust/proc_macro/rust/group.rs
@@ -1,8 +1,20 @@
 use std::fmt;
-use Delimiter;
 use Span;
 use TokenStream;
 
+/// Describes how a sequence of token trees is delimited.
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub enum Delimiter {
+    /// The sequence is delimited by a parenthesis `(...)`.
+    Parenthesis,
+    /// The sequence is delimited by a brace `{...}`.
+    Brace,
+    /// The sequence is delimited by a bracket `[...]`.
+    Bracket,
+    /// Invisible delimiter to preserve operator priority.
+    None,
+}
+
 /// A delimited token stream.
 #[derive(Clone)]
 pub struct Group {
diff --git a/librust/proc_macro/rust/lib.rs b/librust/proc_macro/rust/lib.rs
index 26011f8a724..bdafacf8279 100644
--- a/librust/proc_macro/rust/lib.rs
+++ b/librust/proc_macro/rust/lib.rs
@@ -1,4 +1,4 @@
-pub use group::Group;
+pub use group::{Delimiter, Group};
 pub use ident::Ident;
 pub use literal::Literal;
 pub use punct::{Punct, Spacing};
@@ -12,19 +12,6 @@ mod literal;
 mod punct;
 mod span;
 
-/// Describes how a sequence of token trees is delimited.
-#[derive(Copy, Clone, Debug, PartialEq, Eq)]
-pub enum Delimiter {
-    /// The sequence is delimited by a parenthesis `(...)`.
-    Parenthesis,
-    /// The sequence is delimited by a brace `{...}`.
-    Brace,
-    /// The sequence is delimited by a bracket `[...]`.
-    Bracket,
-    /// Invisible delimiter to preserve operator priority.
-    None,
-}
-
 /// Error returned from `from_str` functions.
 #[derive(Debug)]
 pub struct LexError;

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

only message in thread, other threads:[~2023-04-06 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 21:30 [gcc/devel/rust/master] libproc_macro: Move Delimiter type to group module 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).