feat: TODO
This commit is contained in:
@@ -18,7 +18,8 @@ use proc_macro::TokenStream;
|
||||
use proc_macro2::Span;
|
||||
use quote::{ToTokens, format_ident, quote};
|
||||
use syn::{
|
||||
parse_macro_input, FnArg, Item, ItemConst, ItemFn, ItemMod, Pat, PatIdent, PatType, Type, Visibility
|
||||
FnArg, Item, ItemConst, ItemFn, ItemMod, Pat, PatIdent, PatType, Type, Visibility,
|
||||
parse_macro_input,
|
||||
};
|
||||
|
||||
/// The implementation of the `#[builtins]` macro.
|
||||
@@ -69,14 +70,13 @@ pub fn builtins_impl(input: TokenStream) -> TokenStream {
|
||||
// Public functions are added to the global scope, private ones to a scoped set.
|
||||
if matches!(item_fn.vis, Visibility::Public(_)) {
|
||||
global.push(primop);
|
||||
pub_item_mod.push(quote! { #item_fn }.into());
|
||||
pub_item_mod.push(quote! { #item_fn });
|
||||
} else {
|
||||
scoped.push(primop);
|
||||
pub_item_mod.push(
|
||||
quote! {
|
||||
pub #item_fn
|
||||
}
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
wrappers.push(wrapper);
|
||||
@@ -125,7 +125,7 @@ fn generate_const_wrapper(
|
||||
item_const: &ItemConst,
|
||||
) -> syn::Result<(proc_macro2::TokenStream, proc_macro2::TokenStream)> {
|
||||
let const_name = &item_const.ident;
|
||||
let const_val = &item_const.expr;
|
||||
let const_val = &item_const.expr;
|
||||
let name_str = const_name
|
||||
.to_string()
|
||||
.from_case(Case::UpperSnake)
|
||||
|
||||
Reference in New Issue
Block a user