Skip to main content

nil_num_macros/
lib.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4#![cfg_attr(docsrs, feature(doc_cfg))]
5#![doc(html_favicon_url = "https://nil.dev.br/favicon.png")]
6
7mod big_int;
8
9use proc_macro::TokenStream;
10use syn::DeriveInput;
11
12#[proc_macro_derive(BigIntU64)]
13pub fn derive_big_int_u64(input: TokenStream) -> TokenStream {
14  let ast = syn::parse::<DeriveInput>(input).unwrap();
15  big_int::impl_big_int_u64(&ast)
16}
17
18#[proc_macro_derive(BigIntUsize)]
19pub fn derive_big_int_usize(input: TokenStream) -> TokenStream {
20  let ast = syn::parse::<DeriveInput>(input).unwrap();
21  big_int::impl_big_int_usize(&ast)
22}