Struct dialectic_compiler::Spanned [−][src]
A thing attached to some Span
that tracks its origin in the macro invocation.
Fields
inner: T
The thing to which the Span
is attached.
span: Span
The Span
which is attache to the thing.
Implementations
impl Spanned<Syntax>
[src]
pub fn to_token_stream_with<F: ?Sized>(
&self,
add_optional: &mut F
) -> TokenStream where
F: FnMut() -> bool,
[src]
&self,
add_optional: &mut F
) -> TokenStream where
F: FnMut() -> bool,
Convenience function for converting a Spanned<Syntax>
into a TokenStream
via
Spanned::to_tokens_with
.
pub fn to_tokens_with<F: ?Sized>(
&self,
add_optional: &mut F,
tokens: &mut TokenStream
) where
F: FnMut() -> bool,
[src]
&self,
add_optional: &mut F,
tokens: &mut TokenStream
) where
F: FnMut() -> bool,
Convert a Spanned<Syntax>
into tokens and append them to the provided token stream, with a
predicate to determine whether or not optional syntax should be added or not.
The added optional syntax predicate is an FnMut
closure so that we can randomly choose to
add or not add optional trailing commas and similar during testing.
impl Spanned<Target>
[src]
pub fn to_token_stream_with_crate_name(
&self,
dialectic_crate: &Path
) -> TokenStream
[src]
&self,
dialectic_crate: &Path
) -> TokenStream
Convert this Spanned<Target>
into a TokenStream
using a provided crate name when
referencing types from dialectic.
pub fn to_tokens_with_crate_name(
&self,
dialectic_crate: &Path,
tokens: &mut TokenStream
)
[src]
&self,
dialectic_crate: &Path,
tokens: &mut TokenStream
)
Convert this Spanned<Target>
into tokens and append them to the provided TokenStream
using a provided crate name when referencing types from dialectic.
Trait Implementations
impl Arbitrary for Spanned<Syntax>
[src]
Currently, we have a bit of a limitation on the arbitrary impl for syntax. The first part of
this is that it’s annoying to generate valid labels for lifetimes, so for now we’re using a
set of known valid lifetime names. The second is that generating valid Rust types is
somewhat nontrivial and the syn crate does not have a way to ask it to implement Arbitrary
for its Type
AST node. So currently we just use the unit type ()
wherever we may need to
place a type.
impl<T: Clone> Clone for Spanned<T>
[src]
impl<T: Copy> Copy for Spanned<T>
[src]
impl<T: Debug> Debug for Spanned<T>
[src]
impl<T: Display> Display for Spanned<T>
[src]
impl<T> From<T> for Spanned<T>
[src]
impl Parse for Spanned<Syntax>
[src]
fn parse(input: ParseStream<'_>) -> Result<Self>
[src]
impl ToTokens for Spanned<Syntax>
[src]
fn to_tokens(&self, tokens: &mut TokenStream)
[src]
pub fn to_token_stream(&self) -> TokenStream
[src]
pub fn into_token_stream(self) -> TokenStream
[src]
impl ToTokens for Spanned<Target>
[src]
fn to_tokens(&self, tokens: &mut TokenStream)
[src]
pub fn to_token_stream(&self) -> TokenStream
[src]
pub fn into_token_stream(self) -> TokenStream
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Spanned<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for Spanned<T>
impl<T> !Sync for Spanned<T>
impl<T> Unpin for Spanned<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Spanned<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Spanned for T where
T: Spanned + ?Sized,
[src]
T: Spanned + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,