fayalite_proc_macros/
lib.rs

1// SPDX-License-Identifier: LGPL-3.0-or-later
2// See Notices.txt for copyright information
3//! proc macros for `fayalite`
4//!
5//! see `fayalite::hdl_module` and `fayalite::hdl` for docs
6
7// intentionally not documented here, see `fayalite::hdl_module` for docs
8#[proc_macro_attribute]
9pub fn hdl_module(
10    attr: proc_macro::TokenStream,
11    item: proc_macro::TokenStream,
12) -> proc_macro::TokenStream {
13    match fayalite_proc_macros_impl::hdl_module(attr.into(), item.into()) {
14        Ok(retval) => retval.into(),
15        Err(err) => err.into_compile_error().into(),
16    }
17}
18
19// intentionally not documented here, see `fayalite::hdl` for docs
20#[proc_macro_attribute]
21pub fn hdl(
22    attr: proc_macro::TokenStream,
23    item: proc_macro::TokenStream,
24) -> proc_macro::TokenStream {
25    match fayalite_proc_macros_impl::hdl_attr(attr.into(), item.into()) {
26        Ok(retval) => retval.into(),
27        Err(err) => err.into_compile_error().into(),
28    }
29}