Skip to main content

aranya_policy_derive/
lib.rs

1//! A set of proc macros for policy lang compiler stuff.
2//!
3//! Do not use this crate directly. Use the `policy-vm` crate
4//! instead.
5
6#![allow(unstable_name_collisions)]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8#![warn(missing_docs)]
9
10mod attr;
11mod ffi;
12
13use proc_macro::TokenStream;
14use syn::Error;
15
16// See the `policy-vm` crate for documentation.
17#[proc_macro_attribute]
18#[allow(missing_docs)]
19pub fn ffi(attr: TokenStream, item: TokenStream) -> TokenStream {
20    ffi::parse(attr.into(), item.into())
21        .unwrap_or_else(Error::into_compile_error)
22        .into()
23}