aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-02-13 14:24:37 +0100
committerPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-03-30 13:52:29 +0200
commite59c6f19aa7c4b6d7090d7af23fb407c2fc397ef (patch)
tree449eae6207a8165a17c8ce54eb66520b6feae951
parent44a0fd574f00070d5dd1ec3f5cfbd39c0791ca57 (diff)
downloadgcc-e59c6f19aa7c4b6d7090d7af23fb407c2fc397ef.zip
gcc-e59c6f19aa7c4b6d7090d7af23fb407c2fc397ef.tar.gz
gcc-e59c6f19aa7c4b6d7090d7af23fb407c2fc397ef.tar.bz2
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>
-rw-r--r--librust/proc_macro/rust/group.rs14
-rw-r--r--librust/proc_macro/rust/lib.rs15
2 files changed, 14 insertions, 15 deletions
diff --git a/librust/proc_macro/rust/group.rs b/librust/proc_macro/rust/group.rs
index 0434d6c..e0e3de9 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 26011f8..bdafacf 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;