aboutsummaryrefslogtreecommitdiff
path: root/vendor/proc-macro2/src/extra.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
committerValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
commita990de90fe41456a23e58bd087d2f107d321f3a1 (patch)
tree15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/proc-macro2/src/extra.rs
parent3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff)
downloadfparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz
fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip
Deleted vendor folder
Diffstat (limited to 'vendor/proc-macro2/src/extra.rs')
-rw-r--r--vendor/proc-macro2/src/extra.rs84
1 files changed, 0 insertions, 84 deletions
diff --git a/vendor/proc-macro2/src/extra.rs b/vendor/proc-macro2/src/extra.rs
deleted file mode 100644
index 4a69d46..0000000
--- a/vendor/proc-macro2/src/extra.rs
+++ /dev/null
@@ -1,84 +0,0 @@
-//! Items which do not have a correspondence to any API in the proc_macro crate,
-//! but are necessary to include in proc-macro2.
-
-use crate::fallback;
-use crate::imp;
-use crate::marker::Marker;
-use crate::Span;
-use core::fmt::{self, Debug};
-
-/// An object that holds a [`Group`]'s `span_open()` and `span_close()` together
-/// (in a more compact representation than holding those 2 spans individually.
-///
-/// [`Group`]: crate::Group
-#[derive(Copy, Clone)]
-pub struct DelimSpan {
- inner: DelimSpanEnum,
- _marker: Marker,
-}
-
-#[derive(Copy, Clone)]
-enum DelimSpanEnum {
- #[cfg(wrap_proc_macro)]
- Compiler {
- join: proc_macro::Span,
- open: proc_macro::Span,
- close: proc_macro::Span,
- },
- Fallback(fallback::Span),
-}
-
-impl DelimSpan {
- pub(crate) fn new(group: &imp::Group) -> Self {
- #[cfg(wrap_proc_macro)]
- let inner = match group {
- imp::Group::Compiler(group) => DelimSpanEnum::Compiler {
- join: group.span(),
- open: group.span_open(),
- close: group.span_close(),
- },
- imp::Group::Fallback(group) => DelimSpanEnum::Fallback(group.span()),
- };
-
- #[cfg(not(wrap_proc_macro))]
- let inner = DelimSpanEnum::Fallback(group.span());
-
- DelimSpan {
- inner,
- _marker: Marker,
- }
- }
-
- /// Returns a span covering the entire delimited group.
- pub fn join(&self) -> Span {
- match &self.inner {
- #[cfg(wrap_proc_macro)]
- DelimSpanEnum::Compiler { join, .. } => Span::_new(imp::Span::Compiler(*join)),
- DelimSpanEnum::Fallback(span) => Span::_new_fallback(*span),
- }
- }
-
- /// Returns a span for the opening punctuation of the group only.
- pub fn open(&self) -> Span {
- match &self.inner {
- #[cfg(wrap_proc_macro)]
- DelimSpanEnum::Compiler { open, .. } => Span::_new(imp::Span::Compiler(*open)),
- DelimSpanEnum::Fallback(span) => Span::_new_fallback(span.first_byte()),
- }
- }
-
- /// Returns a span for the closing punctuation of the group only.
- pub fn close(&self) -> Span {
- match &self.inner {
- #[cfg(wrap_proc_macro)]
- DelimSpanEnum::Compiler { close, .. } => Span::_new(imp::Span::Compiler(*close)),
- DelimSpanEnum::Fallback(span) => Span::_new_fallback(span.last_byte()),
- }
- }
-}
-
-impl Debug for DelimSpan {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- Debug::fmt(&self.join(), f)
- }
-}