1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#![deny(rustdoc::broken_intra_doc_links)]
#![forbid(unsafe_code)]
#[macro_use]
extern crate quote;
mod ast;
mod attrs;
mod r#impl;
use proc_macro::TokenStream;
use syn::{parse_macro_input, DeriveInput};
use r#impl::*;
#[doc(hidden)]
#[proc_macro_derive(Instruction, attributes(insn))]
pub fn instruction(input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as DeriveInput);
impl_instruction(&input)
.unwrap_or_else(|e| e.to_compile_error())
.into()
}