forked from libre-chip/fayalite
initial public commit
This commit is contained in:
commit
0b958e7852
56 changed files with 30235 additions and 0 deletions
14
crates/fayalite-proc-macros/Cargo.toml
Normal file
14
crates/fayalite-proc-macros/Cargo.toml
Normal file
|
@ -0,0 +1,14 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
# See Notices.txt for copyright information
|
||||
[package]
|
||||
name = "fayalite-proc-macros"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
workspace = "../.."
|
||||
license = "LGPL-3.0-or-later"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
fayalite-proc-macros-impl = { version = "=0.1.0", path = "../fayalite-proc-macros-impl" }
|
20
crates/fayalite-proc-macros/src/lib.rs
Normal file
20
crates/fayalite-proc-macros/src/lib.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
// See Notices.txt for copyright information
|
||||
#[proc_macro_attribute]
|
||||
pub fn hdl_module(
|
||||
attr: proc_macro::TokenStream,
|
||||
item: proc_macro::TokenStream,
|
||||
) -> proc_macro::TokenStream {
|
||||
match fayalite_proc_macros_impl::module(attr.into(), item.into()) {
|
||||
Ok(retval) => retval.into(),
|
||||
Err(err) => err.into_compile_error().into(),
|
||||
}
|
||||
}
|
||||
|
||||
#[proc_macro_derive(Value, attributes(hdl))]
|
||||
pub fn value_derive(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||
match fayalite_proc_macros_impl::value_derive(item.into()) {
|
||||
Ok(retval) => retval.into(),
|
||||
Err(err) => err.into_compile_error().into(),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue