derive_deftly_macros/
prelude.rs

1//! private prelude for proc macro stuff
2//!
3//! Should be included with `use super::prelude::*`, not `crate::`,
4//! so that it works with `tests/directly.rs` too.
5
6pub use std::cell::Cell;
7pub use std::cmp;
8pub use std::collections::{BTreeSet, HashSet, VecDeque};
9pub use std::convert::{TryFrom, TryInto};
10pub use std::default::Default;
11pub use std::fmt::{self, Debug, Display, Write as _};
12pub use std::iter;
13pub use std::marker::PhantomData;
14pub use std::mem;
15pub use std::ops::Deref;
16pub use std::ptr;
17pub use std::str::FromStr;
18pub use std::thread::panicking;
19
20pub use itertools::{chain, izip, Either, Either::*, EitherOrBoth, Itertools};
21pub use proc_macro2::{Delimiter, Ident, Punct};
22pub use proc_macro2::{Span, TokenStream, TokenTree};
23pub use quote::{format_ident, quote, quote_spanned, ToTokens};
24pub use strum::IntoEnumIterator as _;
25pub use strum::{AsRefStr, Display};
26pub use strum::{EnumIter, EnumString};
27pub use syn::ext::IdentExt;
28pub use syn::parse::{Lookahead1, Parse, ParseBuffer, ParseStream, Parser};
29pub use syn::punctuated::Punctuated;
30pub use syn::token;
31pub use syn::Token;
32pub use syn::{braced, bracketed, parenthesized};
33pub use void::{ResultVoidErrExt as _, ResultVoidExt as _, Void};
34
35pub use TokenTree as TT;
36
37pub use super::approx_equal::{tokens_cmpeq, Equality};
38pub use super::define::escape_dollars;
39pub use super::framework::TokenAccumulator;
40pub use super::paste::TokenPastesAsIdent;
41
42pub use super::utils::{
43    braced_group, delimit_token_group, dummy_path, engine_macro_name,
44    group_clone_set_stream, group_new_with_span, respan_hygiene, spans_join,
45    typepath_add_missing_argument_colons, DocAttributes, ErrorAccumulator,
46    ErrorGenerator, ErrorLoc, Grouping, IdentAny, MacroExport, MakeError,
47    ModuleName, ModulePath, TemplateName, TemplatePath,
48    ToTokensPunctComposable, TokenOutputTrimmer,
49};
50
51pub(super) use super::{
52    accum, adviseable, beta, check, concat, dbg_allkw, define, engine,
53    framework, general_context, meta, modules,
54};
55
56#[allow(unused_imports)] // used in tests
57pub use super::utils::{Concatenated, Discard};
58
59pub use meta::CheckUsed as mCU;
60
61// this is used by the dprintln! macro, which can't just use crate
62// but which doesn't use the import if it's not enabled
63#[allow(unused_imports)]
64pub use super::utils::dprint;
65
66pub use super::compat_syn_2::*;
67pub use super::compat_syn_common::*;
68
69pub use super::options::*;