mirror of
https://github.com/Noratrieb/mono-fmt.git
synced 2026-01-16 16:25:07 +01:00
core tests build
This commit is contained in:
parent
bfd86b1338
commit
010126ce0b
5 changed files with 147 additions and 18 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use std::cell::Cell;
|
||||
|
||||
use proc_macro2::{Ident, Span, TokenStream};
|
||||
use proc_macro2::{Ident, TokenStream};
|
||||
use quote::{quote, ToTokens};
|
||||
|
||||
use crate::{
|
||||
|
|
@ -90,13 +90,14 @@ impl ToTokens for Scoped<'_, FormatArg<'_>> {
|
|||
.iter()
|
||||
.find(|(arg, _)| arg == name)
|
||||
.map(|(_, expr)| expr.to_token_stream())
|
||||
.unwrap_or_else(|| Ident::new(name, Span::call_site()).to_token_stream()),
|
||||
.unwrap_or_else(|| {
|
||||
Ident::new(name, self.input.format_str.span()).to_token_stream()
|
||||
}),
|
||||
};
|
||||
|
||||
let opt_ty = opt_ty_tokens(self.scope(&self.inner.format_spec.formatter_args));
|
||||
let opt_values = opt_value_tokens(self.scope(&self.inner.format_spec.formatter_args));
|
||||
|
||||
|
||||
tokens.extend(quote! { #prefix::#base::<_, #opt_ty>(#expr, #opt_values) })
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue