cameleon_impl_macros/
lib.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5#![allow(
6    clippy::module_name_repetitions,
7    clippy::similar_names,
8    clippy::missing_errors_doc
9)]
10
11mod memory;
12mod register_map;
13mod util;
14
15#[proc_macro_attribute]
16pub fn register_map(
17    args: proc_macro::TokenStream,
18    input: proc_macro::TokenStream,
19) -> proc_macro::TokenStream {
20    match register_map::expand(args, input) {
21        Ok(ts) => ts,
22        Err(e) => e.to_compile_error().into(),
23    }
24}
25
26#[proc_macro_attribute]
27pub fn memory(
28    _args: proc_macro::TokenStream,
29    input: proc_macro::TokenStream,
30) -> proc_macro::TokenStream {
31    match memory::expand(input) {
32        Ok(ts) => ts,
33        Err(e) => e.to_compile_error().into(),
34    }
35}