1use proc_macro::TokenStream;
25
26mod attributes;
27mod codegen;
28mod parsers;
29mod types;
30mod validation;
31
32mod kw {
33 syn::custom_keyword!(dynamic);
34 syn::custom_keyword!(volatile);
35 syn::custom_keyword!(constant);
36 syn::custom_keyword!(persistent);
37 syn::custom_keyword!(block);
38 syn::custom_keyword!(assign);
39 syn::custom_keyword!(op);
40 syn::custom_keyword!(branch);
41 syn::custom_keyword!(barrier);
42 syn::custom_keyword!(dep);
43 syn::custom_keyword!(after);
44 syn::custom_keyword!(before);
45 syn::custom_keyword!(transfer);
46 syn::custom_keyword!(cache);
47 syn::custom_keyword!(read);
48 syn::custom_keyword!(write);
49 syn::custom_keyword!(increment);
50 syn::custom_keyword!(decrement);
51 syn::custom_keyword!(reset);
52 syn::custom_keyword!(init);
53 syn::custom_keyword!(pattern);
54 syn::custom_keyword!(table);
55 syn::custom_keyword!(fixed);
56 syn::custom_keyword!(auto_dim);
57}
58
59use crate::types::GraphDsl;
60
61#[proc_macro]
63pub fn graph(input: TokenStream) -> TokenStream {
64 let ast = syn::parse_macro_input!(input as GraphDsl);
65 match ast.expand() {
66 Ok(ts) => ts,
67 Err(err) => err.to_compile_error().into(),
68 }
69}
70
71#[cfg(test)]
72mod parse_tests;