fayalite/crates/fayalite-proc-macros/src/lib.rs

30 lines
956 B
Rust
Raw Normal View History

2024-06-11 06:09:13 +00:00
// SPDX-License-Identifier: LGPL-3.0-or-later
// See Notices.txt for copyright information
2024-07-17 02:46:52 +00:00
//! proc macros for `fayalite`
//!
//! see `fayalite::hdl_module` and `fayalite::hdl` for docs
2024-07-17 02:46:52 +00:00
// intentionally not documented here, see `fayalite::hdl_module` for docs
2024-06-11 06:09:13 +00:00
#[proc_macro_attribute]
pub fn hdl_module(
attr: proc_macro::TokenStream,
item: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
match fayalite_proc_macros_impl::hdl_module(attr.into(), item.into()) {
2024-06-11 06:09:13 +00:00
Ok(retval) => retval.into(),
Err(err) => err.into_compile_error().into(),
}
}
// intentionally not documented here, see `fayalite::hdl` for docs
#[proc_macro_attribute]
pub fn hdl(
attr: proc_macro::TokenStream,
item: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
match fayalite_proc_macros_impl::hdl_attr(attr.into(), item.into()) {
2024-06-11 06:09:13 +00:00
Ok(retval) => retval.into(),
Err(err) => err.into_compile_error().into(),
}
}