fielder_proc/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! # `fielder-proc`
//!
//! This crate contains the proc-macros used by
//! [`fielder`](https://docs.rs/fielder/latest/fielder).
use proc_macro::TokenStream;
use syn::parse_macro_input;

extern crate proc_macro;

mod bitfield;

#[proc_macro]
pub fn bitfield(input: TokenStream) -> TokenStream {
    bitfield::to_tokens(parse_macro_input!(input as bitfield::Bitfield))
}